MQL5-Google-Onedrive/docs/upgrade_suggestions.md
google-labs-jules[bot] a7a1290460 fix(automation): repair market research scripts and generate reports
Updated market_research.py and upgrade_repo.py to use 'gemini-flash-latest' as the default model, fixing 429/404 errors with the previous 'gemini-2.0-flash' default. Ran the scripts to generate fresh 'docs/market_research_report.md' and 'docs/upgrade_suggestions.md' using the provided API keys.
2026-01-26 06:08:58 +00:00

4.7 KiB

Upgrade Suggestions

Generated: 2026-01-26 06:04:02

Gemini Suggestions

The market research emphasizes two critical needs: dynamic risk management based on diverging volatility (GC/BTC vs. FX majors) and adjusting the entry mechanism from simple breakout chasing (Donchian) to specific entry types (pullbacks for FX, aggressive momentum confirmation for Gold/BTC).

Here are 3 specific code upgrades or parameter adjustments:


1. [SMC_TrendBreakout_MTF_EA.mq5]: Implement Volatility-Adjusted Risk Scaling - [Risk Management Suggestion 1]

Suggestion: Add a mechanism to dynamically adjust the RiskPercent input based on the volatility profile of the traded instrument, ensuring smaller position sizes for highly volatile assets like GC=F and BTC-USD.

Parameter Adjustment/Code Upgrade:

input group "Risk / Orders - Volatility Scaling"
input bool   EnableVolRiskScale    = true; // Enable scaling of RiskPercent based on ATR
input double ATR_Baseline_Period   = 100.0; // Long-term ATR period for calculating baseline
input double Volatility_Risk_Ratio = 0.5;  // Multiplier applied to RiskPercent if current ATR > (1.5 * Baseline ATR)

Reasoning: The analysis clearly states: "The bot must utilize smaller position sizes for GC=F and BTC-USD (High Volatility assets) compared to EURUSD and GBPUSD (Low Volatility assets)." By enabling a Volatility-Adjusted Risk Scale, the EA can internally calculate a recent, short-term ATR (e.g., 14-period) and compare it against a long-term ATR average (e.g., 100-period). If the short-term volatility is significantly higher (e.g., 150% of the baseline), the effective risk percentage used for position sizing (e.g., RiskPercent * Volatility_Risk_Ratio) is automatically reduced, accommodating the wider stops required by high-volatility assets without over-exposing the account.


2. [SMC_TrendBreakout_MTF_EA.mq5]: Add Dedicated ATR-Based Trailing Stop Mode - [Profit Taking Suggestion 1]

Suggestion: Introduce a mandatory, dedicated Trailing Stop (TS) mechanism, specifically using an ATR-based calculation, which activates immediately upon the trade reaching a breakeven or 1:1 R/R level.

Parameter Adjustment/Code Upgrade:

input group "Trade Management / Trailing Stop"
input bool   UseTrailingStop       = true; // Enable trailing stop functionality
input ENUM_SL_MODE TrailingSLMode  = SL_ATR; // Use ATR for trailing (recommended by report)
input double ATR_TS_Mult           = 1.5;  // ATR multiplier for trailing distance (1.0 to 1.5 recommended for aggressive trailing)
input double TrailingStartRR       = 1.0;  // Start trailing once 1:1 Risk/Reward is reached

Reasoning: The report stresses that given the strong momentum environment, a "robust trailing stop mechanism (e.g., ATR-based trailing stop) [is mandatory] immediately upon achieving a risk-to-reward ratio of 1:1 or better, to lock in profits quickly." The existing SLMode and TPMode inputs do not cover the continuous management required for trailing. Adding a dedicated ATR-based trailing stop ensures the bot locks in profits aggressively as momentum unfolds, fulfilling the key risk management requirement for trending markets.


3. [SMC_TrendBreakout_MTF_EA.mq5]: Implement Pullback Entry Filter (RSI-Based) - [Trade Setup A]

Suggestion: Introduce an optional filter to the entry logic (UseDonchianBreakout) that uses the Relative Strength Index (RSI) to mandate a pullback, preventing entries when the price is excessively stretched (overbought/oversold) relative to the trend.

Parameter Adjustment/Code Upgrade:

input group "Trend Breakout Filters"
// ... (Donchian Lookback=20) ...
input bool   UseRSIEntryFilter     = true; // Prevent entries if price is over-extended
input int    RSI_Pullback_Period   = 5;    // Use a short RSI period (e.g., 5 or 8) to spot over-extension
input int    RSI_Long_Max_Limit    = 65;   // Do not Buy if RSI is above this value (wait for dip)
input int    RSI_Short_Min_Limit   = 35;   // Do not Sell if RSI is below this value (wait for rally)

Reasoning: The analysis explicitly recommends "Trend Continuation via Pullback Entry (Buying Dips)" for low-volatility FX majors (EURUSD, GBPUSD), arguing that chasing the current high is inefficient. The current DonchianBreakout logic is fundamentally a momentum chaser. By adding an RSI filter, the bot will pause breakout entries when the price is extended (RSI > 65 for long trades), effectively forcing it to wait for the required shallow retracement or consolidation mentioned in the report before entering the trade. The existing code already caches an RSI handle (gRsiHandle), making this a logical and efficient upgrade.