英文:
Start Session & End Session In Moving Average
问题
ma=ta.sma(close,100)
issession=time(timeframe.period,"0900-1650:1234567")
time_Condition= not na(issession)
plot(time_Condition and ma ? 1 : 0 , color.black, linewidth=2)
英文:
I Want To Calculate and Plot Simple Moving Average Based On Start Session Time And End Session Time
ma=ta.sma(close,100)
issession=time(timeframe.period,"0900-1650:1234567")
time_Condition= not na(issession)
plot(time_Condition and ma ? 1 : 0 , color.black, linewidth=2)
答案1
得分: 0
//@version=5
indicator("我的脚本", overlay=true)
ma = ta.sma(close, 100)
issession = time(timeframe.period, "0901-1650:1234567")
time_Condition = not na(issession)
plot(ma, color = time_Condition ? color.red : color(na), linewidth = 2)
英文:
You can use a transparent color for the plot to hide a moving average that is outside a defined session:
//@version=5
indicator("My script", overlay = true)
ma = ta.sma(close,100)
issession = time(timeframe.period,"0901-1650:1234567")
time_Condition = not na(issession)
plot(ma, color = time_Condition? color.red : color(na), linewidth = 2)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论