Skip to content
TheChatArchiveThe Chat Archive
GLMglm-4.5-airHugging Face Arena Expert 5K

one last try, wait for london to start, only trade the oppisite CHOCH not the BOS, the…

  1. User

    one last try, wait for london to start, only trade the oppisite CHOCH not the BOS, the choch can occur anywhere doesnt matter, as long as its the first choch in the oppisite direction of the aisa breakout

  2. GLM Assistant

    Here's the final strategy that trades only the first CHoCH (not BOS) in the opposite direction of the Asia breakout, starting from London open:

    //@version=5
    strategy("Asia Breakout London CHoCH Reversal", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)
    
    // ===== Inputs =====
    // Session Times
    asia_session = input.session("2000-0000", "Asia Session (20:00-00:00)")
    london_session = input.session("0200-0500", "London Session (02:00-05:00)")
    trade_active_time = input.session("0200-1600", "Trade Active Time (02:00-16:00)")
    
    // Strategy Parameters
    take_profit_rr = input.float(2.0, "Take Profit (R:R)", minval=0.1, step=0.1, group="Risk Management")
    stop_loss_rr = input.float(1.0, "Stop Loss (R:R)", minval=0.1, step=0.1, group="Risk Management")
    enable_long = input.bool(true, "Enable Long Trades", group="Trade Direction")
    enable_short = input.bool(true, "Enable Short Trades", group="Trade Direction")
    
    // CHoCH Settings
    choch_lookback = input.int(10, "CHoCH Lookback Bars", minval=5, group="CHoCH Settings")
    min_choch_distance = input.float(0.1, "Min CHoCH Distance (in points)", minval=0, group="CHoCH Settings")
    
    // Visual Settings
    show_session_bg = input.bool(true, "Show Session Backgrounds", group="Visual")
    show_labels = input.bool(true, "Show Entry Labels", group="Visual")
    
    // ===== Session Detection =====
    in_asia = not na(time(timeframe.period, asia_session))
    in_london = not na(time(timeframe.period, london_session))
    in_trade_window = not na(time(timeframe.period, trade_active_time))
    
    // Highlight Sessions
    bgcolor(show_session_bg and in_asia ? color.new(color.blue, 90) : na, title="Asia Session")
    bgcolor(show_session_bg and in_london ? color.new(color.red, 90) : na, title="London Session")
    
    // ===== Daily Reset =====
    new_day = ta.change(time("D"))
    if new_day
        strategy.cancel_all()
        strategy.close_all()
    
    // ===== Asia Range Tracking =====
    var float asia_high = na
    var float asia_low = na
    var bool asia_complete = false
    var bool asia_breakout_up = false
    var bool asia_breakout_down = false
    var float breakout_level = na
    var bool trade_taken_today = false
    
    // Reset at start of Asia session
    if in_asia and not in_asia[1]
        asia_high := high
        asia_low := low
        asia_complete := false
        asia_breakout_up := false
        asia_breakout_down := false
        breakout_level := na
        trade_taken_today := false
    
    // Track Asia range
    if in_asia
        asia_high := math.max(asia_high, high)
        asia_low := math.min(asia_low, low)
    
    // Mark Asia completion
    if not in_asia and in_asia[1]
        asia_complete := true
    
    // ===== Breakout Detection (During London Session) =====
    if asia_complete and in_london and not trade_taken_today
        // Check for 3-minute candle close breakout
        if close > asia_high and not asia_breakout_up
            asia_breakout_up := true
            breakout_level := asia_high
        else if close < asia_low and not asia_breakout_down
            asia_breakout_down := true
            breakout_level := asia_low
    
    // Plot Asia range
    plot(asia_complete ? asia_high : na, "Asia High", color=color.blue, linewidth=2, style=plot.style_linebr)
    plot(asia_complete ? asia_low : na, "Asia Low", color=color.blue, linewidth=2, style=plot.style_linebr)
    
    // Mark breakout
    plotshape(asia_breakout_up and not asia_breakout_up[1] ? high : na, "Bullish Breakout", shape.triangleup, location.belowbar, color.green, size=size.small)
    plotshape(asia_breakout_down and not asia_breakout_down[1] ? low : na, "Bearish Breakout", shape.triangledown, location.abovebar, color.red, size=size.small)
    
    // ===== CHoCH Detection (Only CHoCH, not BOS) =====
    // Find swing highs and lows for CHoCH
    swing_high = ta.highest(high, choch_lookback)
    swing_low = ta.lowest(low, choch_lookback)
    
    var float last_swing_high = na
    var float last_swing_low = na
    var bool choch_bull = false
    var bool choch_bear = false
    
    // Update swings
    if high[choch_lookback/2] == swing_high
        last_swing_high := swing_high
    
    if low[choch_lookback/2] == swing_low
        last_swing_low := swing_low
    
    // Detect CHoCH only during trade window and after breakout
    if in_trade_window and not trade_taken_today
        // Looking for bearish CHoCH after bullish breakout (Asia broke up)
        if asia_breakout_up and enable_short
            // CHoCH: close below previous swing low
            if close < last_swing_low and math.abs(close - last_swing_low) > min_choch_distance
                choch_bear := true
                trade_taken_today := true
        
        // Looking for bullish CHoCH after bearish breakout (Asia broke down)
        if asia_breakout_down and enable_long
            // CHoCH: close above previous swing high
            if close > last_swing_high and math.abs(close - last_swing_high) > min_choch_distance
                choch_bull := true
                trade_taken_today := true
    
    // ===== Trade Execution =====
    if choch_bull and not choch_bull[1]
        // Long entry (reversal of bearish Asia breakout)
        asia_range = asia_high - asia_low
        entry = close
        stop = entry - (asia_range * stop_loss_rr)
        target = entry + (asia_range * take_profit_rr)
        
        strategy.entry("Long", strategy.long)
        strategy.exit("Long Exit", "Long", stop=stop, limit=target)
        
        if show_labels
            label.new(bar_index, high, "LONG\nCHoCH", color=color.green, textcolor=color.white, style=label.style_label_down)
    
    if choch_bear and not choch_bear[1]
        // Short entry (reversal of bullish Asia breakout)
        asia_range = asia_high - asia_low
        entry = close
        stop = entry + (asia_range * stop_loss_rr)
        target = entry - (asia_range * take_profit_rr)
        
        strategy.entry("Short", strategy.short)
        strategy.exit("Short Exit", "Short", stop=stop, limit=target)
        
        if show_labels
            label.new(bar_index, low, "SHORT\nCHoCH", color=color.red, textcolor=color.white, style=label.style_label_up)
    
    // Reset CHoCH signals
    if choch_bull[1]
        choch_bull := false
    if choch_bear[1]
        choch_bear := false
    
    // ===== Information Table =====
    var table info_table = table.new(position.top_right, 2, 5, bgcolor=color.new(color.black, 80))
    
    if barstate.islast
        table.cell(info_table, 0, 0, "Status", text_color=color.white, text_size=size.small)
        table.cell(info_table, 1, 0, trade_taken_today ? "Trade Taken" : "Waiting", text_color=trade_taken_today ? color.green : color.yellow, text_size=size.small)
        
        table.cell(info_table, 0, 1, "Asia Range", text_color=color.white, text_size=size.small)
        table.cell(info_table, 1, 1, str.tostring(asia_high - asia_low, "0.00"), text_color=color.white, text_size=size.small)
        
        table.cell(info_table, 0, 2, "Breakout", text_color=color.white, text_size=size.small)
        table.cell(info_table, 1, 2, asia_breakout_up ? "Bullish" : asia_breakout_down ? "Bearish" : "None", 
             text_color=asia_breakout_up ? color.green : asia_breakout_down ? color.red : color.gray, text_size=size.small)
        
        table.cell(info_table, 0, 3, "Looking For", text_color=color.white, text_size=size.small)
        table.cell(info_table, 1, 3, asia_breakout_up ? "Bear CHoCH" : asia_breakout_down ? "Bull CHoCH" : "N/A", 
             text_color=asia_breakout_up ? color.red : asia_breakout_down ? color.green : color.gray, text_size=size.small)
    
    // ===== Alerts =====
    alertcondition(asia_breakout_up, "Asia Bullish Breakout", "Asia range broken to upside - Looking for bearish CHoCH")
    alertcondition(asia_breakout_down, "Asia Bearish Breakout", "Asia range broken to downside - Looking for bullish CHoCH")
    alertcondition(choch_bull, "Bullish CHoCH Entry", "Long entry signal - Bullish CHoCH after bearish breakout")
    alertcondition(choch_bear, "Bearish CHoCH Entry", "Short entry signal - Bearish CHoCH after bullish breakout")
    
    // ===== Visual Guides =====
    // Draw lines for current position
    if strategy.position_size != 0
        line.new(bar_index[10], strategy.position_avg_price, bar_index, strategy.position_avg_price, 
             color=color.yellow, width=1, style=line.style_dashed)
    

    Key Features of This Final Strategy:

    1. Precise Trading Logic:

    • One trade per day maximum
    • Waits for Asia session (20:00-00:00) to complete and establish range
    • Detects breakout of Asia range during London session (02:00+)
    • Only trades the first CHoCH (Change of Character) in opposite direction
    • Ignores BOS (Break of Structure) - only CHoCH triggers trade

    2. CHoCH Detection:

    • After bullish Asia breakout: Looks for close below previous swing low
    • After bearish Asia breakout: Looks for close above previous swing high
    • Uses configurable lookback period for swing detection
    • Requires minimum distance to avoid noise

    3. Entry Rules:

    • Long Entry: Asia breaks DOWN → First BULLISH CHoCH (close above swing high)
    • Short Entry: Asia breaks UP → First BEARISH CHoCH (close below swing low)

    4. Risk Management:

    • Stop Loss: Based on Asia range × multiplier
    • Take Profit: Based on Asia range × R:R ratio
    • Position sizing: Percentage of equity

    5. Trade Timing:

    • London Session Start: Trading begins at 02:00
    • Trade Active Window: 02:00-16:00 (configurable)
    • One Trade Limit: Only one trade per day, regardless of opportunities

    6. Visual Features:

    • Blue background for Asia session
    • Red background for London session
    • Clear markings of Asia high/low
    • Breakout indicators (triangles)
    • CHoCH entry labels
    • Information table showing current status

    7. Alerts:

    • Asia breakout alerts
    • CHoCH entry alerts for both directions

    How It Works:

    1. Asia Session (20:00-00:00):

      • Establishes the range (high and low)
    2. London Session (02:00+):

      • Monitors for breakout of Asia range
      • If Asia breaks UP → looks for BEARISH CHoCH
      • If Asia breaks DOWN → looks for BULLISH CHoCH
    3. CHoCH Detection:

      • Uses swing highs/lows from recent bars
      • Only triggers when price closes beyond these levels
      • First occurrence during the day triggers the trade
    4. Trade Execution:

      • Enters on first confirmed CHoCH
      • Sets stop loss and take profit based on Asia range
      • Maximum one trade per day

    This strategy strictly follows your requirements: one trade per day, entering only on the first CHoCH after London starts, always in the opposite direction of the Asia breakout, and ignoring BOS signals completely.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.