INVITE-ONLY SCRIPT

ML Trading Bot with Advanced Filtering

Overview
The Enhanced ML Trading Bot is a sophisticated trading strategy designed to leverage multiple technical filters—ranging from GMAs (Geometric Moving Averages) and ATR-based volatility checks, to volume thresholds, choppiness index, and even real-world event scoring—to pinpoint optimal entry and exit points. By combining advanced technical signals with external event awareness, this script aims to identify high-probability trades while filtering out low-liquidity and choppy market conditions.

Key Features
1. Dual GMAs (Geometric Moving Averages)
Long & Short Calculation
Employs two separate GMAs (long vs. short) derived from the log of price data, revealing market trends with enhanced smoothness.
Directional Bias
Confirms uptrends by ensuring the “long” GMA is above the “short” GMA, and downtrends by the reverse, helping traders stay aligned with prevailing market momentum.
2. Hugging Filter for Entry Confirmation
Precision Entry Check
Uses a “hugging threshold” to assess how closely recent prices have “hugged” the GMA or an entry price, indicating potential breakouts or reversals.
Adaptive Window
Dynamically adjusts around the entry price with a user-defined percentage window, filtering out half-hearted price tests.
3. Volatility & Risk Management
ATR Multipliers
Incorporates an Average True Range–based “ATR Multiplier” to ensure entries happen in normal or beneficial volatility conditions (avoiding noise and extreme swings).
Stop-Loss & Take-Profit
Auto-sets protective exit parameters based on the entry price, refined by ATR or hugging conditions.
4. Volume & Choppiness Index (CI) Filters
Volume Threshold
Checks that daily or recent volume meets a minimum requirement, reducing trades in low-liquidity conditions.
Choppiness Index
Gauges whether the market is ranging or trending. Avoids whipsaw trades by restricting entries if the market is extremely choppy or too trendless.
5. Advanced Time-Based Filtering
Session Hours
Allows traders to specify exact UTC start/end hours for trading, mitigating overnight or low-volume sessions.
News-Driven Event Scoring
Dynamically incorporates upcoming BTC halving dates, Fed meetings, and election cycles—along with a user-defined sentiment input—adding a real-world fundamental dimension to a purely technical system.
6. Overtrading Prevention
Minimum Bar Gap
Ensures a set number of bars between consecutive trades, preventing high-frequency whipsaws and preserving capital.
How the Strategy Works
Geometric Moving Averages
The script calculates two GMAs (long and short) from logged prices, helping identify trend direction and potential reversals.

Hugging & ATR-Based Validation

The hugging filter checks how closely recent price bars have stayed within a specified band around the entry price.
The ATR multiplier then confirms that current volatility conditions are suitable for a reliable trade.
Volume and CI Screening

Volume Threshold ensures there is sufficient liquidity to avoid slippage.
Choppiness Index confirms the market is either trending or shows enough directional bias.
Time & Event Constraints

Trades are only triggered within defined session hours for optimal market participation.
Event Scoring can skew the strategy to be bullish or bearish depending on upcoming major events (BTC halving, Fed meetings, etc.).
Entry/Exit Logic

Long Trades: Triggered when the long GMA > short GMA, price is below the long GMA, and hugging/ATR checks pass, etc.
Short Trades: Triggered when short GMA > long GMA, price is above the short GMA, and hugging/ATR checks pass, etc.
Stop-Loss & Take-Profit: Automatically set around the entry price, aiming for positive risk-reward scenarios.
Setup and Configuration
Add the Strategy
Apply the Enhanced ML Trading Bot to your chart from the TradingView Indicators/Strategies panel.

Select Symbol & Timeframe

Works well on liquid crypto pairs (e.g., ETH/USDT).
Its logic can apply to various timeframes; many traders prefer 1-minute for frequent signals.
Adjust Inputs
Fine-tune parameters such as GMA lengths, ATR multipliers, volume thresholds, session hours, and event sentiment to match your personal trading style and risk tolerance.

Backtesting Recommendations
Extended Backtest Window
To gather enough trades for meaningful statistics, backtest at least 3 months of data—particularly if you’re on lower timeframes like 1-minute.
Statistical Reliability
Aim for 100+ closed trades in your backtest to better gauge win rate, drawdowns, and net profit.
By combining geometric moving averages, hugging filters, volume/choppiness checks, and real-world event weighting, this strategy seeks to capitalize on short-term price swings while maintaining disciplined risk management.
Chart patternsconceptVolume

Skrypt tylko na zaproszenie

Dostęp do tego skryptu mają tylko użytkownicy upoważnieni przez autora i zazwyczaj wiąże się z opłatą. Możesz dodać go do ulubionych, ale będziesz mógł z niego korzystać dopiero po uzyskaniu zgody jego autora. Skontaktuj się z Jonlabriola po więcej informacji lub postępuj zgodnie z instrukcjami autora poniżej.

TradingView nie sugeruje płacenia za skrypt i korzystania z niego, jeśli nie ufasz w 100% jego autorowi i nie rozumiesz, jak działa skrypt. W wielu przypadkach możesz znaleźć dobrą alternatywę open-source za darmo w naszych Skryptach Społeczności.

Instrukcje autora

Must be following me on X

Chcesz użyć tego skryptu na wykresie?

Ostrzeżenie: przeczytaj to zanim poprosisz o dostęp.

Również na:

Wyłączenie odpowiedzialności