0

如图所示,粉色线为开盘价。我希望这仅在今天显示,并且不会向后延伸。这有可能吗?对于这样的问题,我在这里找不到一个好的答案。在此处输入图像描述 这是我的代码:

study("Today Open Yesterday Close", overlay=true)
tdo = security(tickerid, 'D', open) // today
plot(tdo,linewidth=1,color=maroon)
4

1 回答 1

2
study("Today Open Yesterday Close", overlay=true)
tdo = security(tickerid, 'D', open) // today

isToday = false
if year(timenow) == year(time) and month(timenow) == month(time) and dayofmonth(timenow) == dayofmonth(time) 
    isToday := true


plot(tdo,linewidth=1,color=isToday ? maroon : na)
于 2021-10-13T16:47:43.763 回答