Values chaining when zooming in chart. (Multi Timeframe functions used)

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:
zoomout

zoomin

@KirtiKher, using your code I'm unable to reproduce the problem. For testing I use the vertical quote marker as a reference, making sure it always remains visible when zooming.

1 Like

I already made sure that my vertical quote marker did not go out of the screen while taking this screenshot.

Could it be my data's fault?

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.