Problem with iMA SHIFT in demo

 

I was running an expert in backtesting, using downloaded data, with the following code:

Period in test: 5 minutes.


sma_array [i] = iMA(NULL, 0, Ema, 0, MODE_SMMA, PRICE_CLOSE, i);


Then there was a wierd result. The "i" that was expected to be 1 bar shift to the left of the chart turned out NOT to be so.


I wrote the result in a file and found out that each "i" increment represented around 1 second instead of 1 period (5 minutes).


Could somebody help explain this ? How can I overcome this problem? Thanks ...

 


I think I know the answer now. It is the tick data that I evaluate. I now use the "Open price only".

Reason: