绘制前一天的水平错过了当天的第一根蜡烛

Plot previous day levels misses the first candle of the day

我是 pine 脚本编码的新手。我只是想在当天的水平上绘制前一天的高点和前一天的低点。 对于当天剩余的蜡烛,似乎 draw/plot 正确,但在当天的第一根蜡烛上错过了 levels/lines。如何纠正?

第一根蜡烛线之后的水平似乎是正确绘制的。 步进线也是如此。

下面是我的 pinescript 代码

 // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © sukanya_a
    //@version=4
    study("BNiftyLevels", overlay=true)
    PDH=security(syminfo.tickerid, 'D', high) 
    PDL=security(syminfo.tickerid, 'D', low) 
    plot(PDH[1],style=plot.style_stepline, color=color.red,linewidth=2)
    plot(PDL[1],style=plot.style_stepline, color=color.green,linewidth=2)
study("BNiftyLevels", "BNL", overlay=true)

[h,l] = security(syminfo.ticker, "D", [high,low])

plot(h, style=plot.style_stepline, color=color.red,   linewidth=2)
plot(l, style=plot.style_stepline, color=color.green, linewidth=2)