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

僅限邀請腳本

僅限作者授權的用戶訪問此腳本,並且通常需要付費。您可以將其增加到收藏腳本中,但是只有在向作者請求並獲得許可之後,才能使用它。 請聯繫Jonlabriola以了解更多信息,或按照下面作者的說明進行操作。

TradingView 不建議購買並使用此腳本,除非您 100% 信任其作者並了解腳本的工作原理。在許多情況下,您可以在我們的社群腳本中免費找到良好的開源替代方案。

作者的說明

Must be following me on X

想在圖表上使用此腳本?

警告:請閱讀,然後再請求訪問權限。

更多:

免責聲明