OPEN-SOURCE SCRIPT
Telah dikemas kini Cluster Breakout Strategy v6 (Robust)

The core idea: find moments when a stock/commodity/index is "coiling up" — trading in a tight, quiet range — and jump in the moment it breaks out of that range, then ride the move as far as it'll go.
Step by step:
Spot the squeeze. The script watches recent price action and asks: "is the high-low range right now unusually tight compared to this instrument's normal volatility (ATR)?" If yes, and that tightness has been getting progressively tighter (not just randomly quiet), it draws two red lines — one above, one below — marking that squeeze zone.
Wait for a real breakout, not a fake one. Price has to close clearly above the top red line (for a buy) or below the bottom one (for a sell) — not just barely poke through. It also needs the breakout candle to close strong (near its high for a buy, near its low for a sell), and, where volume data exists, a burst of above-average volume. These checks exist to filter out weak breakouts that immediately reverse.
Enter with a clear risk. The moment a real breakout happens, it buys or sells and puts a label on the chart. The initial stop-loss is set at the other side of the squeeze zone — so your risk is defined by the structure itself, not an arbitrary number.
Protect profit as the trade moves. Once the trade is up by 1x its risk, the stop automatically moves to breakeven (you can't lose money on the trade anymore). Once it's up 2x its risk, the stop starts trailing behind price — so if the move keeps going, you keep more of the gain; if it reverses, you still walk away with a solid win instead of giving it all back.
Cut the dead ones. If a trade just sits there going nowhere for too long without reaching even 1x risk, it closes automatically — no point tying up capital in something that isn't working.
Stay disciplined during the day. It only trades during your chosen market hours, caps how many trades it'll take in a single day, and pauses for a few bars after any exit so it doesn't immediately re-enter into the same chop that just stopped it out. Any open trade is closed automatically before the session ends.
In one sentence: it buys or sells when price breaks cleanly out of a quiet consolidation, risks a defined amount based on that consolidation's size, locks in breakeven early, then trails the stop to let genuine trends run further — while avoiding overtrading and fake breakouts as much as the rules allow
Step by step:
Spot the squeeze. The script watches recent price action and asks: "is the high-low range right now unusually tight compared to this instrument's normal volatility (ATR)?" If yes, and that tightness has been getting progressively tighter (not just randomly quiet), it draws two red lines — one above, one below — marking that squeeze zone.
Wait for a real breakout, not a fake one. Price has to close clearly above the top red line (for a buy) or below the bottom one (for a sell) — not just barely poke through. It also needs the breakout candle to close strong (near its high for a buy, near its low for a sell), and, where volume data exists, a burst of above-average volume. These checks exist to filter out weak breakouts that immediately reverse.
Enter with a clear risk. The moment a real breakout happens, it buys or sells and puts a label on the chart. The initial stop-loss is set at the other side of the squeeze zone — so your risk is defined by the structure itself, not an arbitrary number.
Protect profit as the trade moves. Once the trade is up by 1x its risk, the stop automatically moves to breakeven (you can't lose money on the trade anymore). Once it's up 2x its risk, the stop starts trailing behind price — so if the move keeps going, you keep more of the gain; if it reverses, you still walk away with a solid win instead of giving it all back.
Cut the dead ones. If a trade just sits there going nowhere for too long without reaching even 1x risk, it closes automatically — no point tying up capital in something that isn't working.
Stay disciplined during the day. It only trades during your chosen market hours, caps how many trades it'll take in a single day, and pauses for a few bars after any exit so it doesn't immediately re-enter into the same chop that just stopped it out. Any open trade is closed automatically before the session ends.
In one sentence: it buys or sells when price breaks cleanly out of a quiet consolidation, risks a defined amount based on that consolidation's size, locks in breakeven early, then trails the stop to let genuine trends run further — while avoiding overtrading and fake breakouts as much as the rules allow
Nota Keluaran
// =====================================================================// CLUSTER BREAKOUT STRATEGY v8 — Partial Close + Breakeven SL
// =====================================================================
// EXIT LOGIC (plain English)
// --------------------------------------------------------------------
// PHASE 1 — First +1% target:
// Close 50% of the position at +1% (locks in profit on half).
// Simultaneously move the stop-loss to breakeven (entry price) for
// the remaining 50% — so the remaining half can no longer lose money
// ON PAPER (see honest caveat below).
//
// PHASE 2 — Remaining 50%:
// The remaining half trails with a new stop set at 50% below the
// first target level (i.e., entry + 0.5%) — so it exits with at
// least +0.5% profit if knocked out, rather than going back to zero.
// It also has a second target at +2% (2x the first target), and the
// hard max-hold bar cap still applies.
//
// INITIAL STOP LOSS:
// 0.5% below entry (long) / 0.5% above entry (short).
// This fires on the FULL position if hit before the first target.
Nota Keluaran
// =====================================================================// CLUSTER BREAKOUT STRATEGY v8 — Partial Close + Breakeven SL
// =====================================================================
// EXIT LOGIC (plain English)
// --------------------------------------------------------------------
// PHASE 1 — First +1% target:
// Close 50% of the position at +1% (locks in profit on half).
// Simultaneously move the stop-loss to breakeven (entry price) for
// the remaining 50% — so the remaining half can no longer lose money
// ON PAPER (see honest caveat below).
//
// PHASE 2 — Remaining 50%:
// The remaining half trails with a new stop set at 50% below the
// first target level (i.e., entry + 0.5%) — so it exits with at
// least +0.5% profit if knocked out, rather than going back to zero.
// It also has a second target at +2% (2x the first target), and the
// hard max-hold bar cap still applies.
//
// INITIAL STOP LOSS:
// 0.5% below entry (long) / 0.5% above entry (short).
// This fires on the FULL position if hit before the first target.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.