OPEN-SOURCE SCRIPT
Aggiornato AdvancedMA Toolkit – Trading System + Auto-RR & Stats (private)

AdvancedMA Toolkit – Complete Trading System with Auto-RR & Virtual Stats
Full-featured trading toolkit built on the AdvancedMAToolkit Library – full concept in the
Deep Dive Idea.
Real-time virtual trading table · dual signal system (Main + Table-driven) · adaptive risk-reward optimization · multi-layer confirmation filters.
This is a true parameter laboratory: you can shape scalping, swing, long-term, conservative or aggressive strategies – including hedging, OCO, pyramiding in drawdown, or simply study raw signals to find the sweet spot.
The objective? Create a stable strategy by balancing trade frequency, personal investing style, money management and position duration.
At its core: 14-MA rotator + fully flexible crossing function with dynamic period, linear regression clamping, momentum filter, 3-layer MA stack and pattern recognition (Inside Bar/Engulfing).
This creates a solid foundation that filters false signals and cuts risky top/bottom movements outside of the equation.
The statistics table simulates virtual trades and can suggest or auto-apply optimal RR in addition to manual settings – chase high Win Rate + low Drawdown (conservative) or high frequency (aggressive).
As a result, a second layer of “T UP / T DN” signals is emitted purely from the stats engine for highest-conviction setups.
It's key to treat it as both a powerful and an orientation tool: results still depend on market regime, strategy and personal risk tolerance.
█ DUAL SIGNAL SYSTEM
Take a look at both signal types in action, different visual styles for chart elements and table
█ KEY FEATURES
█ OPTIONS CLOSE-UP TIP

Right-click chart → Settings gear icon → Canvas → “Right Bars” → Set for clean table view
█ RETEST SYSTEM CLOSE-UP

Zones trigger on touch (intensified color) – signal only when min retests + % area + trigger mode are satisfied
█ QUICK SETUP PRESETS
LOW AGGRESSIVENESS – more signals (scalping / active trading)
MEDIUM AGGRESSIVENESS – balanced (default)
HIGH AGGRESSIVENESS – fewer, higher-quality signals (swing / conservative)
█ PRO TIPS
█ EXAMPLE – DAX 1 min

45-second scroll-through on DAX 1 min (High Aggressiveness preset)
█ VISUAL FEATURES
█ PERFORMANCE NOTES
Optimized for real-time and historical data. Higher periods (500–5000) shine on higher timeframes.
Combine filters wisely: Momentum + Fast MA for early moves; add Slow MA Filter for strong trend confirmation.
Retest system reduces noise but introduces slight lag – perfect balance is the key.
█ FUTURE ROADMAP – ENHANCEMENTS IDEAS
█ RISK DISCLAIMER
Educational & research tool only. Always backtest thoroughly across markets. Understand settings' logic before use. No guarantees; trading involves risk. Past performance ≠ future results.
█ UPDATE LOG
* v1.0 – Full public release (library v1 + indicator + deep-dive idea):
Core System with Retest Zones and Full Filter Stack · Integrated Statistics Table with Auto-RR Engine · Dual signal system.
This source code is subject to the terms of the Mozilla Public License 2.0
Full-featured trading toolkit built on the AdvancedMAToolkit Library – full concept in the
Deep Dive Idea.
Real-time virtual trading table · dual signal system (Main + Table-driven) · adaptive risk-reward optimization · multi-layer confirmation filters.
This is a true parameter laboratory: you can shape scalping, swing, long-term, conservative or aggressive strategies – including hedging, OCO, pyramiding in drawdown, or simply study raw signals to find the sweet spot.
The objective? Create a stable strategy by balancing trade frequency, personal investing style, money management and position duration.
At its core: 14-MA rotator + fully flexible crossing function with dynamic period, linear regression clamping, momentum filter, 3-layer MA stack and pattern recognition (Inside Bar/Engulfing).
This creates a solid foundation that filters false signals and cuts risky top/bottom movements outside of the equation.
The statistics table simulates virtual trades and can suggest or auto-apply optimal RR in addition to manual settings – chase high Win Rate + low Drawdown (conservative) or high frequency (aggressive).
As a result, a second layer of “T UP / T DN” signals is emitted purely from the stats engine for highest-conviction setups.
It's key to treat it as both a powerful and an orientation tool: results still depend on market regime, strategy and personal risk tolerance.
█ DUAL SIGNAL SYSTEM
- Main Signals (“UP/DN”) → classic crossover + retest + full filter stack
- Table Signals (“T UP / T DN”) → driven purely by the statistics engine. Highest-conviction.

Take a look at both signal types in action, different visual styles for chart elements and table
█ KEY FEATURES
- Building Blocks – Chainable source with dynamic period and object-style function for custom systems
- 14-MA Rotator – Usable standalone or inside library function emitting signals from crosses with Dynamic Period & Linear Regression clamping
- Advanced Retest Zones – Gradient fills · Pending highlight · Configurable triggers · Min Retests (for higher-quality signals)
- Full Filter Stack – Momentum (Moderate/Aggressive) · MA filters (Fast/Medium/Slow) · Patterns (Inside Bar/Engulfing) – For noise filtering and early structural change detection
- Auto-RR Engine – RR-Base (Pure Ratio Focus) Vs Multi-Objective (Balances All Metrics) – Learns from Price Action
- Virtual Trading Modes – OCO (One-Cancels-Other) · Hedging · Pyramid in Drawdown (averaging)
- Dual Signal System – Classic Main arrows + Table-driven “T UP / T DN” signals
- No-Repaint – Confirmation on bar close: Basic repetition limiter to prevents redraws
- Anti-Spam – Minimum bars between signals to prevent clustering
█ OPTIONS CLOSE-UP TIP
Right-click chart → Settings gear icon → Canvas → “Right Bars” → Set for clean table view
█ RETEST SYSTEM CLOSE-UP
Zones trigger on touch (intensified color) – signal only when min retests + % area + trigger mode are satisfied
█ QUICK SETUP PRESETS
LOW AGGRESSIVENESS – more signals (scalping / active trading)
- Filter Aggressiveness → Low (Lenient OR logic – any filter can trigger)
- Momentum → OFF
- Patterns → OFF
- Min Bars Between Signals → 1
- Retest Zone → 1.0 % · Minimum Retests → 1
- Opening Mode → "All"
MEDIUM AGGRESSIVENESS – balanced (default)
- Filter Aggressiveness → Medium (Moderate AND logic – multiple confirmations needed)
- Momentum → ON
- Patterns → OFF
- Min Bars Between Signals → 2
- Retest Zone → 2.0 % · Minimum Retests → 2
- Opening Mode → "First Only" (no averaging yet)
HIGH AGGRESSIVENESS – fewer, higher-quality signals (swing / conservative)
- Filter Aggressiveness → High (Strict AND logic – all filters required)
- Momentum → ON
- Patterns → ON
- Min Bars Between Signals → 3
- Retest Zone → 3.5 % · Minimum Retests → 3
- Opening Mode → "Pyramiding Only in Drawdown" (averaging)
EXPERIMENTAL PRESETS
- Conservative Long-Term (SuperTrend 5000 + minimal filtering)
SUPERT, Close, 5000, 20 | Dynamic: On (2-750, Step 1) | Lin Reg: 3, Increase | Min Trend Bars: 3 | Use Reg: True | Cross: False | Retest: True (1.7%, Min 1) | Momentum: True (Aggressive: False, Bars: 3, Pct: 0.5) | Fast MA: True (ZLEMA, Price, 5) | Medium/Slow/Patterns: OFF | Opening: "Only in Drawdown" | OCO: False | LTP: 1.6% | LSL: 5% | STP: 1.6% | SSL: 5% | RR: Weighted (Decay 0.6) | Opt: Multi | Exit: Conservative- Aggressive Intraday (SuperTrend 310 + full 3×ZLEMA + patterns)
SUPERT, Close, 310, 20 | Dynamic: On (2-750, Step 1) | Lin Reg: 3, Increase | Min Trend Bars: 3 | Use Reg: True | Cross: False | Retest: True (3.5%, Min 1) | Momentum: True (Aggressive: True, Simple Base MA, Pct: 0.5) | Fast: True (ZLEMA, Price, 5) | Medium: True (ZLEMA, MA, 20) | Slow: True (ZLEMA, MA, 60) | Patterns: True | Min Bars: 36 | Limit: 4999 | Opening: "Only in Drawdown" | OCO: False | LTP/STP: 2% | LSL/SSL: 5% | RR: Weighted (Decay 0.6) | Opt: Multi | Exit: Conservative | NoRepaint: True
█ PRO TIPS
- SuperTrend + 3× ZLEMA stack (Fast 5 / Medium 20 / Slow 60) = killer low-lag combo on crypto, DAX, indices
- Prioritize Profit Factor > 1.5 and Drawdown < 15 % over raw Win Rate
- “Only in Drawdown” + Pyramid = powerful averaging, but keep an eye on max Drawdown
- Momentum ON = better reversal catching · Patterns ON = perfect in consolidation phases
- Disable Main arrows and use only “T UP / T DN” = pure statistical trading, zero discretion
- For even stronger edge, combine with volume profile or order-flow analysis
█ EXAMPLE – DAX 1 min

45-second scroll-through on DAX 1 min (High Aggressiveness preset)
█ VISUAL FEATURES
- Colored MA: Green/Red based on trend.
- Retest Zones: Gradient fills with pending highlights.
- Dual Signals: Main UP/DN + “T UP / T DN” labels with no-repaint option.
- TPSL Lines: Dynamic Virtual levels from strategy simulation trades.
- Performance Table: Real-time Statistics in Compact/Extended modes; Consecutive Wins/Losses for consistency.
█ PERFORMANCE NOTES
Optimized for real-time and historical data. Higher periods (500–5000) shine on higher timeframes.
Combine filters wisely: Momentum + Fast MA for early moves; add Slow MA Filter for strong trend confirmation.
Retest system reduces noise but introduces slight lag – perfect balance is the key.
█ FUTURE ROADMAP – ENHANCEMENTS IDEAS
- Custom metric weights (e.g. prioritize Return % while stabilizing others)
- Reversal detection using previous zone breaks
- Signal expiration (time/price validity)
- Dynamic position sizing from stats (Money Management)
- Multi-timeframe filter layer
█ RISK DISCLAIMER
Educational & research tool only. Always backtest thoroughly across markets. Understand settings' logic before use. No guarantees; trading involves risk. Past performance ≠ future results.
█ UPDATE LOG
* v1.0 – Full public release (library v1 + indicator + deep-dive idea):
Core System with Retest Zones and Full Filter Stack · Integrated Statistics Table with Auto-RR Engine · Dual signal system.
This source code is subject to the terms of the Mozilla Public License 2.0
Note di rilascio
v2Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.