Quote:
Originally Posted by pippiee
Not sure what you mean here. I would assume that you always get slightly different results with different currencies because the EAs action is triggered on each tick which arrives and different currencies mean different points of time when ticks arrive.
|
Not only that the time of the bars are not synchronized, go and test for yourself you will see what I mean.
This code should help a bit but it is not a true solution:
void OnTick()
{
string Symbols[3];
Symbols[0] = "EURJPY";
Symbols[1] = "USDJPY";
Symbols[2] = "EURUSD";
int N = 2;
int RoundNum;
ENUM_TIMEFRAMES TimeFrame = _Period;
int i;
datetime dta[1];
static datetime LastBarTime;
// pair 0 (among N) is the "driver"
CopyTime(Symbols[0],TimeFrame,0,1,dta);
if (dta[0] != LastBarTime) {
RoundNum++;
Print("Debug --- Round ",RoundNum);
LastBarTime = dta[0];
for (i=0; i<=N; i++) {
CopyTime(Symbols[i],Period(),0,1,dta);
Print("Debug --- Symbol ",Symbols[i]," : Time ",dta[0]);
}
// Do your stuff here.
Process();
}
}