如何只为今天绘制?

Pug*_*azh 3 pine-script

我正在尝试使用 Pine Script 在 tradeview 中创建一项新研究。

isCurrentMonth = month(timenow) == month(time)
plot(isCurrentMonth ? close : na)
Run Code Online (Sandbox Code Playgroud)

这段代码可以帮助我显示当前月份,但我只想显示当前日期

谢谢你的帮助!

Pug*_*azh 15

我设法想出了一个解决方案。希望它可以帮助某人。

isToday = false

if year(timenow) == year(time) and month(timenow) == month(time) and dayofmonth(timenow) == dayofmonth(time) 
    isToday := true
Run Code Online (Sandbox Code Playgroud)