本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
// Gold Fix Indicator — Tokyo Fix (free teaser, PUBLIC library)
// Marks the Tokyo gold fix (09:55 Asia/Tokyo — Japan has no DST) on any XAUUSD chart,
// with today's and yesterday's fix price. That's all it does, on purpose.
// The full clock — both Tokyo fixes and both London auctions — is free via
// The Weekly Fix: whop.com/fix-your-trading
//
// Publish as OPEN-SOURCE (nothing here is secret; a time marker can't be a signal),
// which also sits best with TradingView House Rules for public scripts.
//@version=6
indicator("Gold Fix — Tokyo Fix (Fix Your Trading)", overlay=true, max_lines_count=10, max_labels_count=10)
bool i_bg = input.bool(true, "Highlight the fix minute/bar")
bool i_ray = input.bool(true, "Draw fix price line")
bool i_lbl = input.bool(true, "Show label")
bool i_yday = input.bool(true, "Keep yesterday's fix (faded)")
color C_TOK = input.color(#00ff88, "Tokyo Fix")
int _transBG = 78
int _transOld = 85
// Bar overlapping the fix minute (works on any timeframe; DST-free, JST is fixed)
inTok = not na(time(timeframe.period, "0955-0956", "Asia/Tokyo"))
fireTok = inTok and not inTok[1]
bgcolor(i_bg and inTok ? color.new(C_TOK, _transBG) : na)
var line today_ln = na
var label today_lb = na
var line yday_ln = na
if fireTok
// retire yesterday's, fade today's into yesterday's, draw the new one
line.delete(yday_ln)
if i_yday and not na(today_ln)
line.set_color(today_ln, color.new(C_TOK, _transOld))
yday_ln := today_ln
else
line.delete(today_ln)
label.delete(today_lb)
today_ln := i_ray ? line.new(bar_index, close, bar_index + 1, close, extend=extend.right, color=C_TOK, width=1) : na
today_lb := i_lbl and i_ray ? label.new(bar_index, close, "Tokyo fix", style=label.style_label_left, textcolor=C_TOK, color=color.new(color.black, 100), size=size.small) : na
// The fix price recorded is your chart's close of the fix minute — a time anchor,
// not the official auction print. No signals, no direction, no promises.