pine-scriptoverlay

EMA Indicator Shifts with Zoom Level and Chart View in overlay mode


I'm experiencing an issue with my Pine Script strategy on TradingView. Depending on the zoom level or chart view, the displayed EMA (Exponential Moving Average) shifts and shows different values at the same chart time point. Here is an easy extract part of my script:

//@version=6
strategy("Test1", overlay=true, initial_capital=100000)
len = input.int(40, minval=1, title="Length")
srcEMA = input(close, title="Source")
ema = ta.ema(srcEMA, len)
plot(ema, title="EMA", color=color.blue)

Does anyone know what might be causing this issue and how to fix it? Cause it wasn't like that the past days, I assume a problem on TradingView's site. Anyone else encountering the same problem?

Thanks in advance for your help!

Joe

I restarted the browser but the problem still persists. Opening TradingView in another browser didn't help either.


Solution

  • It's not a Pinescript problem
    You need to change your setting.

    Try "Pin to right scale"

    scale