I am trying to plot the closing values of daily candles (the last 10 daily candles, including the current day candle) on a smaller timeframe chart, for example, when I am using a 4-hours chart. Please see below the code. I am not able to plot this because of the following error:
line 34: Cannot call 'plot' with argument 'series'='_1d_close'. An argument of 'float[]' type was used but a 'series float' is expected
Any idea of how to convert the float[] type to series float?
Thank you
//@version=5
indicator("Close MTF", overlay=true)
//////////////
// 1D Close //
//////////////
var int lookback = 10
daily_close = request.security(symbol=syminfo.tickerid, timeframe="1D", expression=close)
CurrentDayclose = request.security(syminfo.tickerid, '1D', close)
var float[] daily_closes = array.new_float(lookback)
if ta.change(time("1D")) != 0
array.unshift(daily_closes, daily_close)
array.pop(daily_closes)
_1d_close = array.new_float(0)
array.push(id=_1d_close, value=CurrentDayclose)
for i=0 to lookback-2
array.push(id=_1d_close, value=array.get(id=daily_closes, index=i))
// plot(_1d_close, title="1D Close", color=color.new(color.green,0), linewidth=2, style=plot.style_line)