CM_Forex-Sessions-Highlight_V1

AdrianHummel · study · 45 行 · 点赞 3,079 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//Created by user ChrisMoody 2-17-2014
//Modified by user PathToProfits 07-01-2016
//Modified by user AdrianHummel 08-19-2019
//Forex Session Templates Based on EST-New York Time Zone
 
study(title="CM_Forex-Sessions-Highlight_V1",shorttitle="CM_forex_Sess_Highlight", overlay=true)
timeinrange(res, sess) => time(res, sess) != 0
 
//Change true to false = You have to turn on, won't show up by default
//****Always use lowercase letters
 
doNYOpen = input(defval=true, type = bool, title="NY Open On")
doNYSession = input(defval=true, type = bool, title="NY Session On")
doNYClose = input(defval=true, type = bool, title="NY Close On")
 
doAussieOpen = input(defval=true, type = bool, title="Aussie Open On")
doAussieSession = input(defval=true, type = bool, title="Aussie Session On")
doAussieClose = input(defval=true, type = bool, title="Aussie Close On")
 
doAsiaOpen = input(defval=true, type = bool, title="Asia Open On")
doAsiaSession = input(defval=true, type = bool, title="Asia Session On")
doAsiaClose = input(defval=true, type = bool, title="Asia Close On")
 
doEurOpen = input(defval=true, type = bool, title="Euro Open On")
doEurSession = input(defval=true, type = bool, title="Euro Session On")
doEurClose = input(defval=true, type = bool, title="Euro Close On")
 
//You can copy and paste these colors. white - silver - gray - maroon - red - purple - fuchsia - green - lime
//   olive - yellow - navy - blue - teal - aqua - orange 
 
nySessionStart = navy
nySession = navy
nySessionEnd = navy
asiaSessionStart = yellow
asiaSession = yellow
asiaSessionEnd = yellow
europeSessionStart = red
europeSession = red
europeSessionEnd = red
 
//****Note ---- Use Military Times --- So 3:00PM = 1500
 
bgcolor(doAsiaSession and timeinrange(period, "1900-0400") ? asiaSession : na, transp=70)
bgcolor(doEurSession and timeinrange(period, "0200-1000") ? europeSession : na, transp=70)
bgcolor(doNYSession and timeinrange(period, "0700-1600") ? nySession : na, transp=70)

← 返回列表