在日线图上识别月份名称和 ID 月份的第一个交易日

问题描述

我有一个 Tradingview Pinescript 脚本来识别星期几。我想添加识别月份名称功能,可以吗?

//@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",transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.tuesday : false,title="Wed Open",text="WO",transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.wednesday : false,title="Thur Open",text="RO",transp=10)
plotshape(showDOPEN ? hour == 17 and minute == 0 and dayofweek == dayofweek.thursday : false,title="Fri Open",text="FO",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,transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.tuesday : false,title="Tue",text="T",transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.wednesday : false,title="Wed",text="W",transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.thursday : false,title="Thur",text="R",transp=10)
plotshape(showDOW ? hour == 0 and minute == 0 and dayofweek == dayofweek.friday : false,title="Fri",text="F",transp=10)

谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)