Download MetaTrader 5
To add comments, please log in or register
Having troubles understanding the code? Perhaps, you can find an article on that topic!
Beepsi 2014.07.27 21:47 


I have a weird problem:

Using EURUSD D1 (Day) data from the History Center for a specific day I see as the Closure value:  1.34286 

Now when I run an EA to calculate the RSI for the past 100 D1 bars using closure values, those don't match the RSI indicator in the chart. 

When I printf the specific Bar closure value used by the EA its 1.34287, so wrong by +1 Tick. OHL are +2 ticks wrong. This applies to all Bars.

 The History Center and the EA use different price information ?!


 Messy code, just for testing:

void start() 
   for(int i =0; i < 100; i++)
      double Input_RSI = iRSI("EURUSD", PERIOD_D1, 4, PRICE_CLOSE, i);
      printf("Bar: %d Bid: %.5f RSI: %.5f", i, iClose("EURUSD", PERIOD_D1, i), Input_RSI);
      Print("Time/Open/High/Low/Close/Vol: ",iTime("EURUSD",PERIOD_D1,i),", ",  iOpen("EURUSD",PERIOD_D1,i),", ",
                                      iHigh("EURUSD",PERIOD_D1,i),", ",  iLow("EURUSD",PERIOD_D1,i),", ",
                                      iClose("EURUSD",PERIOD_D1,i),", ", iVolume("EURUSD",PERIOD_D1,i));
To add comments, please log in or register