OPEN-SOURCE SCRIPT
Updated Favorable Algo [Favorable Investors]

A serious HTF Supply/Demand ARM-and-TRIGGER engine with a closed-loop AI Adaptive Auto-Tuner that self-optimizes settings from live performance. No hype. No repainting tricks. No black box. Just real institutional-style logic, exposed and tunable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง WHAT IT ACTUALLY DOES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. Maps real HTF Supply & Demand zones (Daily / 4H / 1H / current TF) using Order-Block detection โ the last opposing candle before the impulse, wick + body included.
2. When price taps a zone, the engine ARMS that side (long or short) and watches LTF for a valid trigger:
โข Reversal/rejection candle
โข 5-pillar confluence stack
โข Oscillator extreme turn
โข HTF SuperTrend alignment
3. First valid trigger fires a ๐ข BUY or ๐ด SELL signal with full TP1 / TP2 / TP3 + SL.
4. ARMED state auto-expires intelligently:
โข Window timeout
โข Break-of-Structure through far face of zone
โข Run-away (price moved away too far, you missed the entry)
โข Regime flip (opposite zone tapped)
โข Opposite side fires
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ค AI ADAPTIVE AUTO-TUNER (NEW)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Closed-loop, every N bars (default 100), reads:
โข Rolling Win Rate (last 50 trades)
โข Profit Factor
โข Sharpe Ratio
โข ATR ratio (volatility regime)
โข Discrete regime score (-2 to +2)
Then mutates EFFECTIVE TP / SL / Confluence / ARM Window / Proximity โ never touching your raw inputs.
Decision logic:
โ๏ธ FROZEN โ WR โฅ freeze threshold + Sharpe โฅ 1.0 โ no changes (don't break what works)
๐ก๏ธ DEFENSIVE โ Sharpe < 0 or WR < 50% โ tighten everything
โ ๏ธ MILD TIGHT โ WR < 60% or PF < 1.5 โ +1 conf, smaller TP1
๐ OPPORTUNIST โ WR โฅ 75% + idle market โ loosen for more signals
๐ TP3 RUN โ strong regime + WR โฅ 70% โ push TP3 farther
๐ VOL SCALE โ high vol โ wider TP/SL, low vol โ tighter
Anti-oscillation built in: bounded clamps, hard min-interval, single-step deltas, frozen-when-winning logic.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ FOUR WIN-RATE PROFILES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข ๐ฏ Sniper โ 5/5 confluence, tight TP, exit-at-TP1 (~85-90% WR target)
โข โ๏ธ Balanced โ 4/5 confluence, medium TP (~70-80% WR target)
โข ๐ฅ Aggressive โ 3/5 confluence, larger TP, more signals
โข โ๏ธ Custom โ full manual control
PLUS a ๐ Manual Override Layer that lets you dial TP / SL / Conf / Proximity from inside ANY profile without leaving Sniper or Balanced or Aggressive.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐งช WALK-FORWARD AI
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Tracks Sniper / Balanced / Aggressive in parallel as virtual profiles and surfaces the best one by Sharpe / Win Rate / Profit Factor โ so you can see in real time which profile this asset actually prefers.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ DASHBOARD (real signal, no clutter)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข Live ARM/TRIGGER status + countdown
โข In-trade P&L, TP1/2/3 progress, trailing SL
โข Rolling WR ยท PF ยท Sharpe ยท streak
โข Walk-Forward profile leaderboard
โข ๐ค Tuner status: ACTIVE / FROZEN / WAITING + next-update countdown
โข Live effective TP/SL/Conf values being used right now
โข ADX, RSI, regime, HTF zones counter
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ ALERTS (full coverage)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข ARMED LONG / SHORT
โข ARM EXPIRE (timeout/BOS/runaway/flip)
โข BUY / SELL fire
โข TP1 / TP2 / TP3 hit
โข Trade Exit
โข Price At HTF Demand / Supply
โข AI Regime Changed
โข ๐ค Tuner Adjusted Parameters
โข โ๏ธ Tuner Frozen
All alert messages are webhook-ready for automation (BloFin, MT5 bridges, Discord webhooks, etc).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐จ PREMIUM VISUALS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข 4 themes โ Neon Teal / Midnight Fire / Arctic Aurora / Ruby
โข HTF zones extend right (50-bar projection, configurable)
โข Armed zones glow + ๐ฏ ARMED label
โข Bar coloring during trades
โข Optional EMA ribbon
โข Clean trade markers + W/L tags
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ ๏ธ WHO IT'S FOR
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Active discretionary and semi-quant traders who want institutional-style HTF S/D logic in code, with the option to either trust the AI tuner or fully manual-tune. Built by a real retail trader running this live in crypto + futures + equities.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๏ธ HONEST DISCLAIMER
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This is an indicator, not financial advice. Past performance never guarantees future results. The AI tuner reduces parameter-tuning friction, it does not eliminate market risk. Always size positions for the worst-case, not the dashboard.
Built by Derek Medina ยท Favorable Investors
Release Notes
๐งฌ FAVORABLE ALGO V21.7 โ PATCH NOTESโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
What's new since V21.6:
๐ก We hardened the TP1 floor. It will never fall below 0.40% again โ no matter the asset, mode, or volatility regime. That bug where PYPL was hitting 0.25% TP1 and AMZN was hitting 0.21%? Dead. Squashed at the source.
๐งช The EMAs are no longer one-size-fits-all. The algo now reads each asset's DNA class and swaps in a different EMA preset on the fly. Trender stocks get faster EMAs to catch impulse moves. Choppers and sleepers get slower EMAs to filter out the noise. Same indicator โ completely different reaction speed depending on what you throw at it.
๐ The confluence floor is now self-correcting. If an asset is bleeding PF and win rate, the algo automatically tightens its entry filter. If an asset is printing money, it loosens up to take more setups. You don't tune it โ it tunes itself, per ticker, per closed trade.
๐ก Take-profit targets now flex with volatility. When ATR is dead, TP shrinks so we're not begging price to come to us. When ATR expands, TP stretches to capture the move. Always above the 0.40% floor โ but it finally breathes with the regime.
๐ SLEEPER auto-suppress is live. If an asset's DNA flags it as a sleeper AND its profit factor is under 1.0 with enough trades to confirm โ the algo refuses to take new entries on it. This is the AMZN-style death spiral killer. It just stops trading the asset until DNA reclassifies or PF recovers.
๐ฏ Realized risk/reward feedback. The algo tracks your actual average win vs average loss. If your wins are tiny compared to your losses, it widens TP1 to give them room. If your wins are massive, it expands TP3 to let them run further. It's adapting to YOUR realized performance โ not theoretical targets.
๐ฌ Asset Memory is the big one. When an asset hits PF โฅ 2.0 and WR โฅ 70%, the algo SNAPSHOTS its current calibration โ TP levels, SL multiplier, confluence floor, ARM window โ all of it. If performance later degrades, it REVERTS to that known-good snapshot. Per asset. So once it figures out what works on MU, it locks that in. If the regime breaks, it falls back instead of bleeding.
๐ Dashboard got 6 new rows so you can see every adaptive layer at a glance โ adaptive EMA preset, CF auto-tune status, vol-regime bucket, sleeper lock state, realized RR ratio, and asset memory snapshots.
๐ 5 new alerts so you know exactly when each adaptive layer fires.
๐ง The core idea: V21.6 adapted on one timescale. V21.7 adapts on FOUR. Every bar (vol regime). Every closed trade (CF auto-tune, memory, realized RR). Every DNA reclassification (EMA preset). Every hostile regime detection (sleeper lock). Same algo โ but it now behaves like a different indicator depending on which ticker you load it on. Caps drawdown on hostile assets, compounds on favorable ones, automatically.
โ Everything from V21.6 is fully preserved. Zone polarity, re-arm, reaction relax, wrong-side veto โ all intact. Only upgrades. Nothing removed. Per the rule.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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 TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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 TradingView. Read more in the Terms of Use.