OPEN-SOURCE SCRIPT
Atualizado CRMI v6 BETA

CRMI v6 BETA (Refined Version) with all the upgrades applied:
✅ Impulse strength filter
✅ Reduced trade frequency
✅ Hybrid tightened
✅ Anti-chop applied to FAST + HYBRID
✅ Distance-from-equilibrium filter
✅ Cleaner execution behavior
A. Higher Timeframe Bias Engine (CRITICAL for LONG)
Use HTF (1H / 4H) to define:
Trend direction
Strength
Structure (HH/HL or LH/LL)
Outputs:
htf_bias = BULL / BEAR / NEUTRAL
htf_strength = 0 → 1
👉 LONG mode MUST depend heavily on this.
B. Liquidity + Sweep Detection (Keep from v6 Alpha)
Identify:
Equal highs/lows
Previous session highs/lows
Stop clusters
Outputs:
liquidity_swept = true/false
sweep_direction = up/down
C. Momentum / Displacement Engine
Detect real moves vs noise
Use:
Candle expansion
Volume spike
ATR expansion
Outputs:
impulse_detected = true/false
impulse_strength = 0 → 1
D. Anti-Chop Filter (NEW — VERY IMPORTANT)
This fixes FAST + HYBRID issues.
Detect:
Low ATR
EMA compression
No structure breaks
Outputs:
market_state = TRENDING / CHOPPY
👉 If CHOPPY → restrict entries heavily
⚙️ 2. MODE EXECUTION LAYER (REWRITE THIS)
Now modes become behavior profiles, not separate logic.
⚡ FAST MODE = “Trade the Move”
Needs:
impulse_detected = true
liquidity sweep optional
Ignores HTF bias partially
Behavior:
Quick entries
Tight SL
Fast TP
Short hold
Fix from your observation:
👉 Add minimum hold bars (3–8 candles) to stop micro-scalping spam
🧠 LONG MODE = “Trade the Thesis” (MOST IMPORTANT)
Only enter if:
HTF bias aligned
Liquidity sweep confirms direction
Market NOT choppy
Behavior:
Wider SL
Hold longer
Trail based on structure, NOT price ticks
NEW:
👉 Add Thesis Lock
Once in trade → ignore small pullbacks
Exit ONLY if:
HTF bias flips
Structure breaks
🔁 HYBRID MODE = “Sniper + Runner”
Fix inconsistency by splitting position:
Entry = same as FAST (good timing)
Then:
50% = FAST TP
50% = LONG hold
👉 This alone will stabilize HYBRID massively
🧩 3. SMART RE-ENTRY MEMORY (NEW EDGE)
This is what most retail systems DON’T have.
Track:
last_trade_direction
last_trade_result (win/loss)
last_entry_zone
Logic:
If stopped out BUT bias still valid → allow re-entry
If 2 losses in chop → pause trading
🛡️ 4. TRADE FILTER STACK (FINAL LAYER)
Only allow trades if:
NOT CHOPPY
AND (impulse_detected OR liquidity_swept)
AND HTF alignment (for LONG / HYBRID runner)
🎯 5. EXPECTED RESULTS AFTER BETA
FAST → fewer but cleaner trades
LONG → higher win rate + bigger RR
HYBRID → becomes your best mode overall
✅ Impulse strength filter
✅ Reduced trade frequency
✅ Hybrid tightened
✅ Anti-chop applied to FAST + HYBRID
✅ Distance-from-equilibrium filter
✅ Cleaner execution behavior
A. Higher Timeframe Bias Engine (CRITICAL for LONG)
Use HTF (1H / 4H) to define:
Trend direction
Strength
Structure (HH/HL or LH/LL)
Outputs:
htf_bias = BULL / BEAR / NEUTRAL
htf_strength = 0 → 1
👉 LONG mode MUST depend heavily on this.
B. Liquidity + Sweep Detection (Keep from v6 Alpha)
Identify:
Equal highs/lows
Previous session highs/lows
Stop clusters
Outputs:
liquidity_swept = true/false
sweep_direction = up/down
C. Momentum / Displacement Engine
Detect real moves vs noise
Use:
Candle expansion
Volume spike
ATR expansion
Outputs:
impulse_detected = true/false
impulse_strength = 0 → 1
D. Anti-Chop Filter (NEW — VERY IMPORTANT)
This fixes FAST + HYBRID issues.
Detect:
Low ATR
EMA compression
No structure breaks
Outputs:
market_state = TRENDING / CHOPPY
👉 If CHOPPY → restrict entries heavily
⚙️ 2. MODE EXECUTION LAYER (REWRITE THIS)
Now modes become behavior profiles, not separate logic.
⚡ FAST MODE = “Trade the Move”
Needs:
impulse_detected = true
liquidity sweep optional
Ignores HTF bias partially
Behavior:
Quick entries
Tight SL
Fast TP
Short hold
Fix from your observation:
👉 Add minimum hold bars (3–8 candles) to stop micro-scalping spam
🧠 LONG MODE = “Trade the Thesis” (MOST IMPORTANT)
Only enter if:
HTF bias aligned
Liquidity sweep confirms direction
Market NOT choppy
Behavior:
Wider SL
Hold longer
Trail based on structure, NOT price ticks
NEW:
👉 Add Thesis Lock
Once in trade → ignore small pullbacks
Exit ONLY if:
HTF bias flips
Structure breaks
🔁 HYBRID MODE = “Sniper + Runner”
Fix inconsistency by splitting position:
Entry = same as FAST (good timing)
Then:
50% = FAST TP
50% = LONG hold
👉 This alone will stabilize HYBRID massively
🧩 3. SMART RE-ENTRY MEMORY (NEW EDGE)
This is what most retail systems DON’T have.
Track:
last_trade_direction
last_trade_result (win/loss)
last_entry_zone
Logic:
If stopped out BUT bias still valid → allow re-entry
If 2 losses in chop → pause trading
🛡️ 4. TRADE FILTER STACK (FINAL LAYER)
Only allow trades if:
NOT CHOPPY
AND (impulse_detected OR liquidity_swept)
AND HTF alignment (for LONG / HYBRID runner)
🎯 5. EXPECTED RESULTS AFTER BETA
FAST → fewer but cleaner trades
LONG → higher win rate + bigger RR
HYBRID → becomes your best mode overall
Notas de Lançamento
After this version:📉 Trade Frequency
Noticeably reduced ✅
Especially in HYBRID & FAST
🎯 Trade Quality
Stronger entries (impulse + displacement)
Less noise trades
🧠 Mode Behavior
LONG → still dominant
HYBRID → more stable now
FAST → no longer spamming
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.