PROTECTED SOURCE SCRIPT

My script

57
//version=5
indicator("Session Highs and Lows", overlay=true)

// Session Time Inputs
asiaStart = timestamp(year, month, day, 0, 0)
asiaEnd = timestamp(year, month, day, 8, 0)
londonStart = timestamp(year, month, day, 8, 0)
londonEnd = timestamp(year, month, day, 13, 0)
usStart = timestamp(year, month, day, 13, 0)
usEnd = timestamp(year, month, day, 21, 0)

// Variables to store session highs and lows
var float asiaHigh = na
var float asiaLow = na
var float londonHigh = na
var float londonLow = na
var float usHigh = na
var float usLow = na

// Update session highs and lows
asiaHigh := (time >= asiaStart and time < asiaEnd) ? math.max(asiaHigh, high) : asiaHigh
asiaLow := (time >= asiaStart and time < asiaEnd) ? math.min(asiaLow, low) : asiaLow

londonHigh := (time >= londonStart and time < londonEnd) ? math.max(londonHigh, high) : londonHigh
londonLow := (time >= londonStart and time < londonEnd) ? math.min(londonLow, low) : londonLow

usHigh := (time >= usStart and time < usEnd) ? math.max(usHigh, high) : usHigh
usLow := (time >= usStart and time < usEnd) ? math.min(usLow, low) : usLow

// Plot Highs and Lows
plot(asiaHigh, color=color.blue, linewidth=2, title="Asia High")
plot(asiaLow, color=color.blue, linewidth=2, title="Asia Low")
plot(londonHigh, color=color.green, linewidth=2, title="London High")
plot(londonLow, color=color.green, linewidth=2, title="London Low")
plot(usHigh, color=color.red, linewidth=2, title="US High")
plot(usLow, color=color.red, linewidth=2, title="US Low")

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。