Hello, I'm seeking assistance because I'm confused about the behavior of the code below. It returns identical values for both the current day and the previous day. Specifically, the values for price and price[1], as well as ema and ema[1], are the same. Any help would be greatly appreciated.
Thanks,
Banya
Thanks,
Banya
Code:
input length = 21;
input Symbol = "SPY";
def Price = Fundamental(FundamentalType.CLOSE, symbol = Symbol, period = "day");
def Ema = ExpAverage(Price, length);
AddLabel(yes, "Price: " + Price + "Price[1]: " + Price[1] + " Ema: " + Ema + " Ema[1] " + Ema[1]);