iHigh, definign previous bar high

 

Have some issues to get previous bar high price. I can not figure out how to shift it.

int e;

Print("Current bar for EURUSD D1: Time ", iTime(NULL,PERIOD_D1,e),", Open ", iOpen(NULL,PERIOD_D1,e),", High ",

iHigh(NULL,PERIOD_D1,e),", Low ", iLow(NULL,PERIOD_D1,e),", Close ",

iClose(NULL,PERIOD_D1,e),", Volume ", iVolume(NULL,PERIOD_D1,e));


return (0);

 

You did it just fine, except u have no value for variable e...

int e = 1;   // for current bar e=0, for previous bar e=1, etc.

Next time:

 

Yes, that was my problem.

 int e = 1;
      Print("Current bar for EURUSD D1: Time ", iTime(NULL,PERIOD_D1,e),", Open ", iOpen(NULL,PERIOD_D1,e),", High ",
                                          iHigh(NULL,PERIOD_D1,e),", Low ",  iLow(NULL,PERIOD_D1,e),", Close ",
                                          iClose(NULL,PERIOD_D1,e),", Volume ", iVolume(NULL,PERIOD_D1,e));

Thank you for shearing!

Reason: