PROTECTED SOURCE SCRIPT
MACD + 200 EMA + Chandelier + ML Optimizer

Neural MACD Trend Strategy [ML + Chandelier + ADX]
This script modernizes a classic high-probability trend strategy by integrating Machine Learning and dynamic risk management. It is built on the foundation of the 9, 21, and 200 EMAs with MACD execution, designed to automate the workflow of trend traders.
Key Features:
1. Core Logic: Trades are executed on MACD crosses, but only when aligned with the long-term trend (200 EMA). An optional setting enforces a simultaneous 9/21 EMA cross for high-momentum confirmation.
2. Machine Learning Optimizer: A K-Nearest Neighbors (KNN) algorithm runs in the background, analyzing RSI, CCI, and ROC. It compares the current setup to the last 1,000 bars of history; if the historical probability is negative, the ML blocks the trade to save capital.
3. Range Filter: Uses ADX to detect choppy markets. If the market is ranging (ADX < 20), the background turns gray and trading is paused.
4. Advanced Exits: Automatically calculates Stop Losses based on recent Swing Highs/Lows. Includes a Chandelier Exit (ATR Trailing Stop) to lock in profits dynamically. You can choose between fixed Reward-to-Risk targets (e.g., 1.5x) or disable targets to ride the trend until the trailing stop is hit.
This script modernizes a classic high-probability trend strategy by integrating Machine Learning and dynamic risk management. It is built on the foundation of the 9, 21, and 200 EMAs with MACD execution, designed to automate the workflow of trend traders.
Key Features:
1. Core Logic: Trades are executed on MACD crosses, but only when aligned with the long-term trend (200 EMA). An optional setting enforces a simultaneous 9/21 EMA cross for high-momentum confirmation.
2. Machine Learning Optimizer: A K-Nearest Neighbors (KNN) algorithm runs in the background, analyzing RSI, CCI, and ROC. It compares the current setup to the last 1,000 bars of history; if the historical probability is negative, the ML blocks the trade to save capital.
3. Range Filter: Uses ADX to detect choppy markets. If the market is ranging (ADX < 20), the background turns gray and trading is paused.
4. Advanced Exits: Automatically calculates Stop Losses based on recent Swing Highs/Lows. Includes a Chandelier Exit (ATR Trailing Stop) to lock in profits dynamically. You can choose between fixed Reward-to-Risk targets (e.g., 1.5x) or disable targets to ride the trend until the trailing stop is hit.
Скрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.