← All Analyses
EXNESSXAUUSD
Neutral

6AM Strategy

Arayansh Kumar
7h ago
6AM Strategy

// GOLD 6AM IST Strategy — LipiScript for GoCharting
// =====================================================
// Bias : 6:00–6:15 AM IST candle direction
// Entry : 5-min breakout of bias HIGH/LOW → next candle open
// SL : Opposite end of bias candle
// TP : 1:3 Risk Reward
// Max : 1 trade per day

indicator("GOLD 6AM IST Strategy", overlay=true)

// ─── INPUT ───────────────────────────────────────────
rr = input(3.0, "Risk:Reward Ratio")

// ─── IST TIME ────────────────────────────────────────
// GoCharting me time milliseconds me hota hai
// IST = UTC + 5:30 = UTC + 330 minutes
ist_offset = 330 * 60 * 1000
ist_time = time + ist_offset
ist_hour = math.floor((ist_time / (1000 * 60 * 60)) % 24)
ist_minute = math.floor((ist_time / (1000 * 60)) % 60)

// ─── SESSION CONDITIONS ──────────────────────────────
is_weekday = dayofweek != 1 and dayofweek != 7 // 1=Sun, 7=Sat in GoCharting
is_600am = ist_hour == 6 and ist_minute == 0
is_after_615 = (ist_hour == 6 and ist_minute >= 15) or ist_hour > 6
is_new_day = dayofmonth != dayofmonth[1]

// ─── BIAS CANDLE FROM 15-MIN CHART ───────────────────
bias_high_15 = request.security(syminfo.tickerid, "15", high)
bias_low_15 = request.security(syminfo.tickerid, "15", low)
bias_open_15 = request.security(syminfo.tickerid, "15", open)
bias_close_15 = request.security(syminfo.tickerid, "15", close)

// ─── STATE VARIABLES ─────────────────────────────────
var float bias_high = na
var float bias_low = na
var int bias_dir = 0 // 1=Long, -1=Short
var bool trade_done = false
var bool breakout_seen = false

// ─── RESET EVERY NEW DAY ─────────────────────────────
if (is_new_day) {
bias_high := na
bias_low := na
bias_dir := 0
trade_done := false
breakout_seen := false
}

// ─── STEP 1: CAPTURE 6:00 AM IST BIAS CANDLE ─────────
if (is_600am and is_weekday and na(bias_high)) {
bias_high := bias_high_15
bias_low := bias_low_15
bias_dir := bias_close_15 >= bias_open_15 ? 1 : -1
}

// ─── STEP 2: BREAKOUT AFTER 6:15 AM IST ──────────────
long_breakout = false
short_breakout = false

if (is_weekday and is_after_615 and not trade_done and not breakout_seen and not na(bias_high)) {

// SHORT BIAS: price 6:00-6:15 ka LOW tod de
if (bias_dir == -1 and low < bias_low) {
short_breakout := true
breakout_seen := true
}

// LONG BIAS: price 6:00-6:15 ka HIGH tod de
if (bias_dir == 1 and high > bias_high) {
long_breakout := true
breakout_seen := true
}
}

// ─── STEP 3: MARK ENTRY NEXT CANDLE ──────────────────
if (short_breakout and not trade_done) {
trade_done := true
}

if (long_breakout and not trade_done) {
trade_done := true
}

// ─── VISUALS ─────────────────────────────────────────

// Yellow background = 6:00 to 6:15 AM IST bias window
is_bias_window = is_weekday and ist_hour == 6 and ist_minute < 15
bgcolor(is_bias_window ? color.new(color.yellow, 85) : na)

// Draw bias HIGH and LOW lines
var line ln_high = na
var line ln_low = na

if (is_600am and is_weekday and not na(bias_high)) {
ln_high := line.new(bar_index, bias_high, bar_index + 100, bias_high,
color=color.red, width=2, style=line.style_dashed)
ln_low := line.new(bar_index, bias_low, bar_index + 100, bias_low,
color=color.green, width=2, style=line.style_dashed)

// Bias label
lbl_text = bias_dir == 1 ? "LONG BIAS" : "SHORT BIAS"
lbl_color = bias_dir == 1 ? color.green : color.red
lbl_y = bias_dir == 1 ? bias_low : bias_high
lbl_style = bias_dir == 1 ? label.style_label_up : label.style_label_down
label.new(bar_index, lbl_y, text=lbl_text, color=lbl_color,
textcolor=color.white, style=lbl_style, size=size.normal)
}

// Entry signal arrows
plotshape(long_breakout, title="Long Entry", location=location.belowbar,
style=shape.triangleup, color=color.lime, size=size.normal)
plotshape(short_breakout, title="Short Entry", location=location.abovebar,
style=shape.triangledown, color=color.red, size=size.normal)

// SL and TP lines on entry
if (short_breakout) {
sl_val = bias_high
risk = math.abs(sl_val - close)
tp_val = close - risk * rr
line.new(bar_index, sl_val, bar_index + 60, sl_val, color=color.red, width=1, style=line.style_solid)
line.new(bar_index, tp_val, bar_index + 60, tp_val, color=color.green, width=1, style=line.style_solid)
}

if (long_breakout) {
sl_val = bias_low
risk = math.abs(close - sl_val)
tp_val = close + risk * rr
line.new(bar_index, sl_val, bar_index + 60, sl_val, color=color.red, width=1, style=line.style_solid)
line.new(bar_index, tp_val, bar_index + 60, tp_val, color=color.green, width=1, style=line.style_solid)
 

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by GoCharting. Read more in the Terms of Use.

Comments (0)

Loading comments…