バージョン 1.33
2025.05.23
Primary Fixes/Checks Related to "No Trading Operations":
Correct Lot Sizing Mode & Inputs (CRITICAL for Auto Lots):
Issue: If LotSizeType was set to Fixed (value 1), the EA would use FixedLotSize and ignore risk inputs. If set to Auto (value 0) but RiskPerTradePercent or StopLossPips were effectively zero or invalid, lot calculation would default to minimum or fail.
Fix/Check:
To use risk-based auto lot sizing: Ensure input LotSizeType is 0 (Auto).
Ensure input RiskPerTradePercent is a positive value (e.g., 1.0 for 1%).
Ensure input StopLossPips is a positive, realistic value for the symbol being traded (e.g., 1000 for XAUUSD might mean a $10 stop per lot depending on point value; for DE40, 100 might be 100 index points).
The code (v1.075) now correctly uses the RiskPerTradePercent input when in Auto mode.
Daily Trading Logic (Ensuring Trades Can Occur Each Day):
Issue: The g_lastEntryAttemptTime (and g_lastExitAttemptTime) variable, if not reset daily, would prevent the EA from attempting a trade on subsequent days once it had made an attempt on the first day.
Fix (v1.073+): These variables (g_lastEntryAttemptTime, g_lastExitAttemptTime) were made global and are now correctly reset to 0 within the ResetDailyStats() function. ResetDailyStats() is called when CheckAndPerformDailyReset() detects a new trading day. This ensures the conditions for entry/exit are re-evaluated fresh each day.
Broker Server Time vs. Trading Window (OpenTradeTimeStr, CloseTradeTimeStr):
Issue: The EA operates on broker server time. If the 09:05 - 22:55 window (broker time) falls outside the active market hours for the specific instrument (e.g., EURUSD, XAUUSD), no trades will occur.
Fix/Check (User Action Required): The user must adjust the OpenTradeTimeStr and CloseTradeTimeStr inputs to align with a liquid and active trading session for the chosen symbol, relative to their broker's server time. For example, for EURUSD, this might be during the London or New York session overlaps.
Secondary Fixes/Checks & Refinements (Implemented in recent versions):
Dashboard Visuals & Object Naming:
Issue: Overlapping text, incorrect object names leading to display errors.
Fix (v1.073, v1.074, v1.075): Dashboard layout was significantly reworked to use separate labels for static text and dynamic values, with precise X/Y positioning to prevent overlap. Object names were made unique using a panelNamePrefix.
Symbol Handling (g_effectiveTradeSymbol):
Issue: Ensuring the EA trades the correct symbol, whether specified in inputs or taken from the current chart.
Fix (v1.05+): g_effectiveTradeSymbol is used consistently after being determined in OnInit().
MarketInfo Validation (OnInit):
Issue: Potential for MarketInfo() calls to return zero or invalid data for MODE_POINT, MODE_TICKSIZE, MODE_TICKVALUE, which would break lot sizing or SL/TP calculations.
Fix (v1.05+): Added checks in OnInit() to ensure these values are valid and g_value_of_one_point is correctly calculated, failing initialization if critical data is missing.
Error Handling and Debug Prints:
Issue: Lack of detailed information when issues occur.
Fix (Progressive): Added more Print statements, especially in CalculateLotSize(), to help diagnose issues.
To ensure the EA trades as expected, the user MUST:
Set LotSizeType correctly (0 for Auto, 1 for Fixed).
If Auto lots: Provide valid RiskPerTradePercent and StopLossPips.
If Fixed lots: Provide a valid FixedLotSize.
Crucially, set OpenTradeTimeStr and CloseTradeTimeStr to match an active session for the chosen symbol based on THEIR BROKER'S SERVER TIME.
Ensure the TradeSymbol input is correct or blank (to use chart symbol).
Use "Every tick" model in the Strategy Tester.
The code itself (as of v1.075) should now handle the daily reset and the mechanics of lot calculation correctly, assuming the user provides appropriate inputs.
25.9s