I made a simple crossover strategy using EMA20 and EMA200. I wanted to plot the 15 minute version of the chart on 1 min chart.(NOTE: Doing it for practicing) so I did it using AFL's built in timeframe functions.
The issue I am facing: I noticed that when I zoomed in the chart My EMA200 value is changing. (NOTE: I also made sure that my candle selected was not going out of the screen. and I also made sure that I was on the same candle ).
My Code:
TimeFrameSet(in15Minute);
ema20 = EMA(Close,20);
ema200 = EMA(Close,200);
a = Cross(EMA(Close,20),EMA(C,200));
b = Cross(EMA(Close,200),EMA(C,20));
TimeFrameRestore();
Plot(TimeFrameExpand(ema20,in15Minute),"EMA20",colorWhite);
Plot(TimeFrameExpand(ema200,in15Minute),"EMA200",colorAqua);
Buy = TimeFrameExpand(a,in15Minute);
Sell = TimeFrameExpand(b,in15Minute);
Screen shots to prove where it happened: