Need to have my tradingview pine script code corrected
Budget: $10 – $30 USD
//@version=5
indicator("Heikin Ashi Reversal Indicator", overlay=true)
// Import heikinashi() function from ta lib
import ta.heikinashi
// Use heikinashi() to calculate Heikin Ashi candles
[ha_open, ha_high, ha_low, ha_close] =
ta.heikinashi(syminfo.tickerid, timeframe.period, open, high, low, close)
// Calculate body, upper shadow, and lower shadow of current candle
body = abs(ha_close - ha_open)
upper_shadow = ha_high - max(ha_open, ha_close)
lower_shadow = min(ha_open, ha_close) - ha_low
// Check for spinning top pattern
is_spinning_top = (body < upper_shadow) and (body < lower_shadow)
// Check for bullish or bearish reversal patterns
is_bullish_reversal = (ha_close < ha_open) and (ha_open - ha_low >= body * 2)
is_bearish_reversal = (ha_close > ha_open) and (ha_high - ha_open >= body * 2)
// Plot spinning top pattern as yellow dot
plotshape(is_spinning_top, style=shape.circle,
location=location.absolute, color=color.yellow)
// Plot bullish and bearish reversal patterns as green and red arrows, respectively
plotshape(is_bullish_reversal, style=shape.arrowup,
location=location.absolute, color=color.green)
plotshape(is_bearish_reversal, style=shape.arrowdown,
location=location.absolute, color=color.red)
I am receiving an error with my script
indicator("Heikin Ashi Reversal Indicator", overlay=true)
// Import heikinashi() function from ta lib
import ta.heikinashi
// Use heikinashi() to calculate Heikin Ashi candles
[ha_open, ha_high, ha_low, ha_close] =
ta.heikinashi(syminfo.tickerid, timeframe.period, open, high, low, close)
// Calculate body, upper shadow, and lower shadow of current candle
body = abs(ha_close - ha_open)
upper_shadow = ha_high - max(ha_open, ha_close)
lower_shadow = min(ha_open, ha_close) - ha_low
// Check for spinning top pattern
is_spinning_top = (body < upper_shadow) and (body < lower_shadow)
// Check for bullish or bearish reversal patterns
is_bullish_reversal = (ha_close < ha_open) and (ha_open - ha_low >= body * 2)
is_bearish_reversal = (ha_close > ha_open) and (ha_high - ha_open >= body * 2)
// Plot spinning top pattern as yellow dot
plotshape(is_spinning_top, style=shape.circle,
location=location.absolute, color=color.yellow)
// Plot bullish and bearish reversal patterns as green and red arrows, respectively
plotshape(is_bullish_reversal, style=shape.arrowup,
location=location.absolute, color=color.green)
plotshape(is_bearish_reversal, style=shape.arrowdown,
location=location.absolute, color=color.red)
I am receiving an error with my script