Reputation: 9561
I'm trying to create a new study in tradingview using Pine Script.
isCurrentMonth = month(timenow) == month(time)
plot(isCurrentMonth ? close : na)
This piece of code could help me display for current month, but I want to display only for current day.
Thanks for any help!
Upvotes: 3
Views: 5171
Reputation: 9561
I managed to come up with a solution. Hope it could help someone.
isToday = false
if year(timenow) == year(time) and month(timenow) == month(time) and dayofmonth(timenow) == dayofmonth(time)
isToday := true
Upvotes: 16