Reputation: 1
How to get the value of an ema with a offset applied (id want the offset) to be in the past aka -5 bars for example
plot(ema(close, 15), offset=-5)
Upvotes: 0
Views: 940
Reputation: 65
you can just try this
LIFE32 = ta.ema(close, 3)
plotshape(LIFE32[2] < close, "LIFE UP", shape.triangleup, location.belowbar, color=color.green)
Upvotes: 0
Reputation: 1961
It is possible to refer to past values of time series using the [] history-referencing operator
//@version=5
indicator("My Script")
ema = ta.ema(close, 15)
plot(ema15[5], color = color.red)
Upvotes: 1