0

I have a Tradingview Pinescript script for identifying day of week. I would like to add ability to identify name of month, is that possible?

//@version=4

study(title = "Day of Week & Open - Intraday", shorttitle = "Day of Week", overlay=true)

// Get User input - which time label to show
showDOPEN       = input(true, title="Identify Daily Open - 5PM EST")
showDOW         = input(true, title="Identify Days of Week - Midnight EST")

BarInSession(sess) =>
    not na(time(timeframe.period, sess))
    
// 5PM EST. *Sun open identified which is also Mondays bar open
dayOpen =   time(timeframe.period,"1700-1659")
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.sunday : false, title="Mon Open", text="MO", color=color.aqua, location=location.belowbar, style=shape.triangleup, textcolor=color.aqua, size=size.tiny, transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.monday : false, title="Tue Open", text="TO", color=color.aqua, location=location.belowbar, style=shape.triangleup, textcolor=color.aqua, size=size.tiny, transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.tuesday : false, title="Wed Open", text="WO", color=color.aqua, location=location.belowbar, style=shape.triangleup, textcolor=color.aqua, size=size.tiny, transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.wednesday : false, title="Thur Open", text="RO", color=color.aqua, location=location.belowbar, style=shape.triangleup, textcolor=color.aqua, size=size.tiny, transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.thursday : false, title="Fri Open", text="FO", color=color.aqua, location=location.belowbar, style=shape.triangleup, textcolor=color.aqua, size=size.tiny, transp=10)

// Midnight EST - Day of Week
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.monday : false, title="Mon", text="M", color=color.green, style=shape.diamond, textcolor=color.green, size=size.tiny, transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.tuesday : false, title="Tue", text="T", color=color.green, style=shape.diamond, textcolor=color.green, size=size.tiny, transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.wednesday : false, title="Wed", text="W", color=color.green, style=shape.diamond, textcolor=color.green, size=size.tiny, transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.thursday : false, title="Thur", text="R", color=color.green, style=shape.diamond, textcolor=color.green, size=size.tiny, transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.friday : false, title="Fri", text="F", color=color.green, style=shape.diamond, textcolor=color.green, size=size.tiny, transp=10)

Thanks.

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
  • What scripting language is that? To attract readers who know it please mention in your question and also add the relevant tag in addition to the dayofmonth tag. – Ole V.V. Jan 06 '21 at 04:35
  • Thanks, sorry, I did not know that. I thought this is a forum for Tradingview Pinescript. – fxxtrader Jan 14 '21 at 16:29
  • This Q&A site (which is not exactly the same as a forum) is for all coding questions, so hundreds of programming and scripting languages are asked about here. Thanks for answering the question. I have edited your question accordingly. Sorry that I don’t know Pinescript myself. – Ole V.V. Jan 14 '21 at 16:39

0 Answers0