There seems to be a bug in pine script that has broken an indicator I wrote. Previously (before ~Oct2020), I had an indicator that did some calculation inside a for loop using the ema function. Now, Pine Script throws an error when I try and add my script:
Add to Chart operation failed, reason: line 21: Cannot call 'ema' with arguments (series[float], series[integer]); available overloads: ema(series[float], integer) => series[float]
Here's a sample of what I'm trying to run:
//@version=4
study("My Script")
emastep = 5
emashort = 5
thisema = 0.0
emanum = 10
lastema = ema(close, emashort)
for i = 1 to emanum
thisema := ema(close, round(i*emastep))
plot(thisema)
The issue seems to be the "i" in the ema(close, round(i*emastep)) part. What's interesting is a sample script from the pine script manual (https://www.tradingview.com/pine-script-docs/en/v4/language/Expressions_declarations_and_statements.html#for-statement) also throws the same error now. The following sample from the above link doesn't work:
//@version=4
study("RMA in for loop")
sum = 0.0
for i = 1 to 2
sum := sum + rma(close, i)
plot(sum)
Any thoughts on how to get around this? i in a for loop shouldn't be a series form, right?

