MQL4 - automated forex trading   /  

Forum

System tester fails if expert uses two or more different pairs

Back to topics list To post a new topic, please log in or register

avatar
86
cbalta 2006.11.09 08:45 
System tester fails if expert uses two or more different pairs.
Even all used pairs having historical minute data, tester simulates only main pair (EURUSD)
The others in the expert are not simulated in this case (USDCHF, GBPUSD, USDJPY)

Thanks.
Cengiz
article

Transferring an Indicator Code into an Expert Advisor Code. General Structural Schemes of an Expert Advisor and Indicator Functions

This article dwells on the ways of transferring an indicator code into an Expert Advisor Code and on writing Expert Advisors with no calling to custom indicators, and with the whole program code for the calculation of necessary indicator values inside the Expert Advisor. This article gives a general scheme of Expert Advisor changing and the idea of building an indicator function based on a custom indicator. The article is intended for readers, already having experience of programming in MQL4 language.


avatar
Moderator
5089
stringo 2006.11.09 15:46 
Of course. Other symbols are not modelled. Don't use their current (0) bar

You can access to current bar of M1 for current close price

avatar
86
cbalta 2006.11.09 17:43 

Ok, I've learned only working pair is simulated in the tester. Here is part of the code that I use.
Tester is working on EURUSD 1H data. %90 quality tick values available for all pairs.


for(i=0;i<4;i++) EurHma4[i] = iCustom("EURUSD", PERIOD_H4, "HMA", 12, 0, i);
for(i=0;i<4;i++) GbpHma4[i] = iCustom("GBPUSD", PERIOD_H4, "HMA", 12, 0, i);
for(i=0;i<4;i++) ChfHma4[i] = iCustom("USDCHF", PERIOD_H4, "HMA", 12, 0, i);

TrendUp = ( (EurHma4[0]<EurHma4[1]) && (GbpHma4[0]<GbpHma4[1]) && (ChfHma4[0]>ChfHma4[1]) );
TrendDown = ( (EurHma4[0]>EurHma4[1]) && (GbpHma4[0]>GbpHma4[1]) && (ChfHma4[0]<ChfHma4[1]) );


Can you please convert this code to how is tester is simulating it? So I can understand my faults deeply.
(I've optimed my expert according to tester and I want to convert it from tester's world to real world)

When I use following expression in this test:

GbpHma4[0]<GbpHma4[1]

which values are used by the tester excatly, to calculate this expression, altough GBPUSD is not simulated? Can this expression see the future, according to simulater time? If I learn this detail, I will be able to solve by problem. Even the value of this expressin may be freezed during simulation of last hour bar, it should be freeed by a past value, not a future value. I need to know the value it is locked during last bar simulation.


Thank you very much.
Cengiz

Back to topics list  

To add comments, please log in or register