79710689

Date: 2025-07-22 15:10:17
Score: 1
Natty:
Report link
pine_rma(src, length) =>
    alpha = 1/length
    sum = 0.0
    sum := na(sum[1]) ? ta.sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])
pine_atr(length) =>
    trueRange = na(high[1])? high-low : math.max(math.max(high - low, math.abs(high - close[1])), math.abs(low - close[1]))
    pine_rma(trueRange, length)

Simply use instead of ta.atr() the pine function pine_atr().
You also need the pine_rma() to get rid of your error message.

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Tom