Session levels without look-ahead

Session levels read by name: the prior session's point of control and value area from the Session Volume Profile held as lines, the developing point of control traced through today, the London high and low from Trading Sessions, and a marker when price closes back inside the prior value area from outside it. Needs Session Volume Profile and Trading Sessions on the chart; each part says so when its indicator is missing.

//@xfscript 1
indicator("Session Levels")

let value_color: color = input.color("#6B7280", "valueColor", "Prior value area")
let poc_color: color = input.color("#F59E0B", "pocColor", "Prior POC")
let london_color: color = input.color("#3B82F6", "londonColor", "London")

let has_profile: bool = session_profile.available() && session_profile.count() > 1
var prior_poc: float = nan
var prior_vah: float = nan
var prior_val: float = nan
prior_poc := nz(prior_poc[1], nan)
prior_vah := nz(prior_vah[1], nan)
prior_val := nz(prior_val[1], nan)
if has_profile {
  prior_poc := session_profile.poc(1)
  prior_vah := session_profile.vah(1)
  prior_val := session_profile.val(1)
}
plot.hline(prior_poc, poc_color, 2, "solid", "Prior POC")
plot.hline(prior_vah, value_color, 1, "dashed", "Prior VAH")
plot.hline(prior_val, value_color, 1, "dashed", "Prior VAL")
plot.line(session_profile.poc(0), "#E5E7EB", 1, "dotted")

let inside_value: bool = close <= prior_vah && close >= prior_val
let back_inside: bool = has_profile && inside_value && !(bar_index > 0 && inside_value[1])
plot.marker(back_inside, close, poc_color, "diamond", "above", 10, 4)

let london: int = trading_sessions.find("London")
plot.line(trading_sessions.high(london), london_color, 1, "dashed")
plot.line(trading_sessions.low(london), london_color, 1, "dashed")

if !session_profile.available() {
  plot.label("ADD SESSION VOLUME PROFILE TO THIS CHART", "#6B7280")
} else if !trading_sessions.available() {
  plot.label("ADD TRADING SESSIONS TO THIS CHART", "#6B7280")
} else {
  plot.label(str.concat("PRIOR POC ", format.fixed(prior_poc, 2), "  LONDON ", format.fixed(trading_sessions.low(london), 2), " TO ", format.fixed(trading_sessions.high(london), 2)), "#E5E7EB")
}

Všechny vrstvy trhu – od Orderflow po optionflow – v jednom grafu.

Orderflow data institucionální kvality s vestavěným backtestingem a obchodním deníkem. Zapište se na čekací listinu a získejte předběžný přístup.

Získat přístup