Enumeration of the bars

 

I tested the new programming construction

 

     CopyOpen("EURUSD",PERIOD_H1,0,5, XY); // 5 bars from 0 - 4

 

XY[0] // this is the oldest bar - the fourth bar

 

In MQL4 the [0] was the newest. In my test it was the oldest.

 

Will that enumeration be changed or is that the finall status ? 

 
24h-worker :

I tested the new programming construction

 

     CopyOpen("EURUSD",PERIOD_H1,0,5, XY); // 5 bars from 0 - 4

 

XY[0] // this is the oldest bar - the fourth bar

 

In MQL4 the [0] was the newest. In my test it was the oldest.

 

Will that enumeration be changed or is that the finall status ? 

Had the same problem. I believe it was Stringo from MetaQuotes that advised what to do.  To implement 1 = 1 bar back, 2 = 2 bars back and so on just call ArraySetAsSeries(XY,true);


ArraySetAsSeries(XY,true);

CopyOpen("EURUSD",PERIOD_H1,0,5, XY); // 5 bars from 0 - 4


Hope it works.

Reason: