Download MetaTrader 5

Correct way of calling indictor on different timeframe?

To add comments, please log in or register
Publish the program in the Market and sell it to millions of traders!
gangsta1 2015.01.05 17:55 
    if (iCCI(NULL, PERIOD_D1,14,PRICE_OPEN,1) > 100)
Does this look correct? I have a feeling that the 100 will be referenced from the timeframe the EA is running on rather than d1?
honest_knave 2015.01.05 18:05  

Take a look at iBarShift()

The code you have posted will retrieve the value of iCCI from the previous D1 bar. Not the previous bar of the chart timeframe (unless that also happens to be on D1).

100 is 100, regardless of what timeframe. 

To add comments, please log in or register