PROTECTED SOURCE SCRIPT
Backtest [OptAlgo]

This backtest script is designed to convert ideas or indicators into backtest results. The script creates buy/sell signals by comparing price sources against fixed values or other imported plots using many comparison methods. It has many features including multiple exit systems: TP/SL, custom plot-based stops and more. It supports full trading automation through webhook alerts with live signal processing.
🔢 Signal Creation System
→ Values Group: Compare price sources against fixed numerical values
→ Plots Group: Compare two different price sources/indicators against each other
→ Flexible Comparisons: 15+ comparison methods (equal, crossover, rising...)
→ Signal Types: Long, Short, Close All, Block signals, and combination signals
→ Merge Rules: Minimum condition requirements for signal activation
🔀 Advanced Signal Logic
→ Counter Signals: Choose between reversing positions or closing them
→ Signal Inversion: Flip all buy/sell signals with one toggle
→ External Signal Import: Import coded signals (1=Long, -1=Short, 0=Close)
→ Day Blocker: Enable/disable trading on specific weekdays
→ Session Control: Limit trading to specific market sessions
⚙️ Strategy Settings
→ Position Sides: All Ways, Long Only, or Short Only modes
→ Signal Control: Individual enable/disable for long and short signals
→ Counter Signal Mode: Reverse Open Position vs Close Open Position
→ Signal Reversal: Global signal inversion capability
🔰 Risk Management (Limiter Settings)
→ Leverage Control: Leverage with liquidation warnings
→ Drawdown Limit: Auto-halt strategy at specified drawdown percentage
→ Tradable Ratio: Use portion of available balance (0.01-1.0)
→ Contract Limit: Cap maximum contract size regardless of balance
🎯 TP/SL System
→ Fixed TP/SL: Set percentage-based take profit and stop loss
→ Custom Plot Stops: Use any indicator/plot as dynamic stop loss
→ ATR-Based Exits: Volatility-adjusted TP/SL using Average True Range
→ Realistic Protection: Prevents unrealistic TP/SL prices in live trading
→ Stop Modes: Instant (Sudden) vs Candle Close execution
→ ATR Stop Loss: Override fixed SL with volatility-based calculations
→ ATR Take Profit: Dynamic TP based on market volatility
→ Trailing Options: Safe, Normal, or Aggressive trailing methods
→ Calculation Modes: Normal, Volume-weighted, or Limited (with max %) options
→ Volume Integration: ATR levels adjust based on volume influx
🤖 Automation & Alerts
→ Webhook Integration: Send JSON alerts for automated execution
→ Live Signals: Real-time signal processing (every tick vs bar close)
→ Strategy Key: Unique identifier for automated systems
→ Early Entry: Send alerts X seconds before candle close
→ Fast Execution: Prevent signal lag in automated trading
🐞 Development Tools
→ Alert Plotting: Visualize signals directly on chart (disable for live alerts)
→ Professional Mode: Remove UI controls for faster calculation
→ Debug: Metrics are plotted in data window.
📊 Key Advantages
→ Multi-Condition Logic: Combine multiple indicators with flexible rules
→ Risk-First Design: Built-in drawdown and leverage protection
→ Automation Ready: Full webhook and alert system integration
⚠️ Important Warnings
→ High leverage combined with high SL may adjust to liquidation price
→ Use consistent leverage across all strategies on same trading isolated margin pair
→ Live signals require "Calculate on every tick" enabled in settings
→ Disable alert plotting when creating actual alerts to prevent latency
🔢 Signal Creation System
→ Values Group: Compare price sources against fixed numerical values
→ Plots Group: Compare two different price sources/indicators against each other
→ Flexible Comparisons: 15+ comparison methods (equal, crossover, rising...)
→ Signal Types: Long, Short, Close All, Block signals, and combination signals
→ Merge Rules: Minimum condition requirements for signal activation
🔀 Advanced Signal Logic
→ Counter Signals: Choose between reversing positions or closing them
→ Signal Inversion: Flip all buy/sell signals with one toggle
→ External Signal Import: Import coded signals (1=Long, -1=Short, 0=Close)
→ Day Blocker: Enable/disable trading on specific weekdays
→ Session Control: Limit trading to specific market sessions
⚙️ Strategy Settings
→ Position Sides: All Ways, Long Only, or Short Only modes
→ Signal Control: Individual enable/disable for long and short signals
→ Counter Signal Mode: Reverse Open Position vs Close Open Position
→ Signal Reversal: Global signal inversion capability
🔰 Risk Management (Limiter Settings)
→ Leverage Control: Leverage with liquidation warnings
→ Drawdown Limit: Auto-halt strategy at specified drawdown percentage
→ Tradable Ratio: Use portion of available balance (0.01-1.0)
→ Contract Limit: Cap maximum contract size regardless of balance
🎯 TP/SL System
→ Fixed TP/SL: Set percentage-based take profit and stop loss
→ Custom Plot Stops: Use any indicator/plot as dynamic stop loss
→ ATR-Based Exits: Volatility-adjusted TP/SL using Average True Range
→ Realistic Protection: Prevents unrealistic TP/SL prices in live trading
→ Stop Modes: Instant (Sudden) vs Candle Close execution
→ ATR Stop Loss: Override fixed SL with volatility-based calculations
→ ATR Take Profit: Dynamic TP based on market volatility
→ Trailing Options: Safe, Normal, or Aggressive trailing methods
→ Calculation Modes: Normal, Volume-weighted, or Limited (with max %) options
→ Volume Integration: ATR levels adjust based on volume influx
🤖 Automation & Alerts
→ Webhook Integration: Send JSON alerts for automated execution
→ Live Signals: Real-time signal processing (every tick vs bar close)
→ Strategy Key: Unique identifier for automated systems
→ Early Entry: Send alerts X seconds before candle close
→ Fast Execution: Prevent signal lag in automated trading
🐞 Development Tools
→ Alert Plotting: Visualize signals directly on chart (disable for live alerts)
→ Professional Mode: Remove UI controls for faster calculation
→ Debug: Metrics are plotted in data window.
📊 Key Advantages
→ Multi-Condition Logic: Combine multiple indicators with flexible rules
→ Risk-First Design: Built-in drawdown and leverage protection
→ Automation Ready: Full webhook and alert system integration
⚠️ Important Warnings
→ High leverage combined with high SL may adjust to liquidation price
→ Use consistent leverage across all strategies on same trading isolated margin pair
→ Live signals require "Calculate on every tick" enabled in settings
→ Disable alert plotting when creating actual alerts to prevent latency
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.