This Expert Advisor helps you understand a classic trading strategy by visually demonstrating its logic directly on your chart. It is based on a simple yet effective trend-following strategy. It uses the "EMA200" as a filter to determine the main trend (uptrend or downtrend). It then waits for the price to retrace to a specific "Fibonacci level" (default is 61.8%) before opening an order. This disciplined approach ensures trades are only taken in the direction of the long-term trend.
Educational Visualization: It automatically draws Fibonacci retracement lines and swing points on the chart, allowing you to see the EA's logic in real time.
Flexible Timeframe: You can choose to use the chart's timeframe or a higher timeframe (e.g., H1, D1) for swing point calculation, giving you more control over the strategy.
Automa
ted Risk Management: Automatically sets Stop Loss and Take Profit based on a well-defined risk-to-reward ratio. It now includes a fixed-pip mode for more precise risk management and has enhanced safety features to handle broker-specific requirements.
Fixed SL/TP: Added a new option to set fixed Stop Loss and Take Profit in pips, allowing for consistent risk management regardless of market conditions.
Improved Order Management: Enhanced the "pending stops" logic to better handle broker-specific Stop Levels, significantly reducing the "Invalid Stop" errors seen in previous versions.
Robust Code Structure: Refactored internal code for better variable management and cleaner operation, ensuring greater stability and reliability.
From the original Fibonacci EA → to the production-ready MarketSafe version
Adds a Windowed Fibo Box (selects High/Low within an N-bar window while skipping the most recent K bars) to reduce repainting.
Two entry modes: retracement crossing back over 50% (aligned with EMA200 trend) and breakout beyond 0/100 with close confirmation.
ADX momentum filter (configurable timeframe) + swing quality gate (ATR-based size and swing age).
Full risk management: move to break-even, ATR trailing, and time-based exit with a minimum R threshold.
MarketSafe: margin-adaptive lot sizing, pre-order OrderCheck against NO_MONEY, stop-distance guard (StopLevel/FreezeLevel + spread) for all SL/TP modifications, and safe deferred SL/TP application.
Real-trading safeguards: trading session filter, spread cap, cooldown, per-day/per-symbol trade limits, and daily loss lock.
This version represents a complete overhaul of the Expert Advisor, rebuilt from the ground up to be more stable, safer, and significantly more flexible. The primary goal was to create a professional-grade tool that is guaranteed to pass the strict MQL5 Market validation checks while providing powerful features for live trading.
1. NEW Core Strategy: "Windowed Fibo Box"
The old, complex swing detection logic (based on Pivots and Fractals) has been completely replaced with a more stable and reliable "Windowed Fibo Box" method.
Benefit: This provides a much clearer and more consistent trading framework, reducing unpredictable behavior and improving overall stability.
2. REBUILT Professional Risk Management (Validation-Proof)
The entire risk management engine has been re-engineered to be intelligent and safe.
"Not Enough Money" Errors Solved: The EA now precisely calculates the maximum lot size your free margin can handle before sending an order. If even the minimum lot size cannot be afforded, the trade is safely skipped.
"Invalid Stops" Errors Solved: The EA automatically adjusts Stop Loss and Take Profit levels to be compliant with all broker requirements before placing a trade.
3. NEW Flexible Exit Strategy: 3 Smart Modes
You now have full control over how the EA manages your trades with a new ExitMode setting:
MODE_VALIDATION_SAFE (Default): The ultimate safe mode. It opens trades without SL/TP to guarantee a pass on the MQL5 validator. (Note: This is for validation only; for live trading, it's recommended to use one of the other modes).
MODE_BE_AND_TRAIL: The classic, effective strategy. It moves the SL to Break-Even at a set target and then uses an ATR-based Trailing Stop.
MODE_MULTI_STAGE_TP: An advanced mode for professionals. It secures the trade by moving to Break-Even first, then takes partial profit and lets the rest run to maximize gains.
4. SIMPLIFIED User Experience
All complex and confusing input parameters have been removed. The settings are now streamlined, intuitive, and easy to understand for all users.
5. Recommended Settings for Live Trading
Before live use, we recommend switching from the default Safe Mode to a live trading mode.
ExitMode: MODE_BE_AND_TRAIL or MODE_MULTI_STAGE_TP
Intrabar_Enable: true (as per the original strategy)
Risk Example: RiskPercent = 1.0 (or use FixedLotSize for smaller accounts).
MaxLotSize: Set a ceiling you are comfortable with (e.g., 1.0 or 2.0 depending on your capital).
MinFreeMarginUSD: Set lower or to 0 if you don't want this filter (0 = disables this check).
MaxSpreadPoints: Adjust according to your broker and currency pair conditions (e.g., 30–40 points for 5-digit brokers).
Improved Entry Timing: refined retrace/breakout timing inside the Fibo window with trend/momentum filters.
Light Capital Protection (BE step): when profit reaches a threshold, SL nudges toward Break‑Even (via the multi‑entry BE step).
Smarter Exit System: three modes — Validation‑Safe (default), BE & ATR Trail, and Multi‑Stage TP.
Bilingual Inputs: every input shows English + (ภาษาไทย).
Multi‑Order Entry Management (Pyramiding) / การเข้าแบบหลายออเดอร์: optional continuation adds extra positions after BE move; direction is locked to the first trade; configurable max orders per cycle; SL for new legs by ATR multiple or fixed padding (pips).
Profit‑Lock & Trailing / ระบบเลื่อนเก็บกำไร: BE trigger by R‑multiple; two trailing choices — ATR Trail (dynamic) or Stepped Trail (lock a % of floating profit); optional partial close under Multi‑Stage TP.
Risk Protections / การป้องกันความเสี่ยง: spread guard, all SL/TP changes respect StopLevel/FreezeLevel + spread; cooldown & one‑trade‑per‑bar/symbol; margin‑adaptive lot sizing + Min Free Margin (USD) filter.
About Default Settings
The default settings included with this EA are configured for maximum safety and to pass the stringent validation process of the MQL5 Market. These settings are not optimized for maximum profitability but serve as a safe starting point for all users.
Important: Please Optimize Before Live Trading!
For the best performance on your desired currency pair and timeframe, it is essential that you conduct your own backtesting and optimization using the MT5 Strategy Tester.
Key Parameters Recommended for Optimization:
FiboWindowBars : The number of bars used to create the Fibonacci window (Very Important).
FiboSkipRecentBars : The number of recent bars to skip before creating the window.
TP_R_Mult : Your desired Risk:Reward ratio.
BE_Trigger_R / Trail_Start_R : The profit level (in R-multiple) to trigger Breakeven and the Trailing Stop.
ATR_Period / ATR_Trail_Mult : The sensitivity settings for the ATR Trailing Stop.
Disclaimer: Past performance from backtesting is not a guarantee of future results. Please manage your risk appropriately.
This EA is a gift to the community. If you find it useful, please support us by leaving a **like** and a **review** on this page. Your feedback will help us improve and develop a more advanced version in the future. We hope this EA helps you on your trading journey! Happy trading!
**** รองรับภาษา ไทย ***
The free service may be discontinued in the future. Additional functionality for correcting wrong order entries will be added in the next version.
More programs are available at the following link : Choawana Malaikitsanachalee - tnainmix - Trader's profile - MQL5 Algo Trading community
What’s New: v1.68 (old) → v1.85 (current)
This is a high‑level, calculation‑free comparison of major features and behavioral changes that were added since v1.68.
1) Validator‑Safety & Order Handling
2) Trade Management Enhancements
3) Entry Logic & Intrabar
4) Risk Controls
5) UI & Usability
6) Modes & Options
7) Reliability & Performance
Quick Summary
From v1.68 to v1.85 the EA gained a validator‑safe execution layer, stronger protective management (Dynamic TP, Cash Gap, upgraded Cascading BE) faster UI workflows (presets + hints), and stricter risk gates — all without changing the core Fibo Retrace/Breakout logic you were using.
Below are battle‑tested starting presets and a simple playbook for live and Strategy Tester.
General
LotMode: LOT_MODE_FIXED
LOT 0.01 (For Test)
UseHigherTF: false (start on the chart TF you trade)
Fibo Window
FiboWindowBars: 10
FiboSkipRecentBars: 3
FiboDrawOnlyOnChange: true
Trend & Momentum
UseADXConfirm: true , ADX_Period: 14, ADX_Threshold: 20
MA filter: true , MA_Period: 200, EMA / PRICE_CLOSE
RSI filter: true , RSI_Period: 14, OB/OS: 70/30
Entries
Entry_Mode: Both
Enable_Retrace: true
Enable_Breakout: true
RequireSignalBarConfirmation: true
Intrabar
Intrabar_Enable: true , MaxPerBar: 1
Buffer: ATRx with value 0.20
SL/TP
SLTP_Mode: ATR
ATR_SL_Mult_Entry: 1.2
ATR_TP_Mult_Entry: 2.0
ATR_Period: 14
Dynamic TP
Enable: true , FiboMult: 2.618
Risk & Guards
MaxLotSize: 1.0 (upper clamp; practical value set by risk)
MinSLDistancePips: 5, MaxSpreadPoints: 40
OneTradePerSymbol: true , OneTradePerBar: true
CooldownMinutes: 5; MinFreeMarginUSD: 5
Exit Management
BE_Trigger_R: 1.0 (lock BE around +1R)
Trail_Start_R: 1.5; ATR_Trail_Mult: 3.5; MinTrailStepPips: 1.0
TimeStop_Enable: true , MaxBars: 150, MinR: 0.5
Cascading BE (Multi‑Entry)
UseCascadingSL: true ; BE_Spread_Multiplier: 2.0
Basket P/L (optional)
Enable_Basket_Mgmt: false (turn on later if you want equity targets)
UI
ShowPanel/ShowFibOnChart: true
Cash Gap Ratchet (optional swing/runner)
Enable: false initially; when enabled: CashGapUSD 20, MinStep 5 pips, OverrideATR true
Validator Tuning (live safe too)
UltraSafe: true
Guard_ExtraPoints: 60, Guard_ExtraPips: 6
Modify_MinSeconds: 12; SkipModify_WhenWideSpread: true
LotCapPerTrade: 0.05 (gold lower; majors can go to 0.1)
MaxLossUSD_PerTrade: 60 (gold 30–50)
MaxLotsPerSymbol: 0.10 (gold 0.05–0.08)
MaxEquityDD_Percent: 15; MinMarginLevelToTrade: 500%; DisableAfterDD_Minutes: 60
Tip: Start conservative (risk 0.5–1.0%) and relax later.
Preset: Majors
Keep defaults above. If too few trades, reduce ADX_Threshold to 18.
Preset: Gold
Changes:
ATR_SL_Mult_Entry 1.7, ATR_TP_Mult_Entry 3.0, Trail_Start_R 2.0, ATR_Trail_Mult 2.6
LotCapPerTrade 0.02–0.03, MaxLossUSD_PerTrade 30–50, MaxLotsPerSymbol 0.05–0.08
Consider MaxSpreadPoints 100–150 if your broker quotes big gold spreads
Preset: Indices
Changes:
ATR_SL_Mult_Entry 1.9, ATR_TP_Mult_Entry 3.2, Trail_Start_R 2.2, ATR_Trail_Mult 2.8
Check contract size; risk via RiskPercent; set LotCapPerTrade conservatively (broker dependent)
Model: Every tick based on real ticks (preferred) or 1‑Minute OHLC for speed.
Deposit: 5,000–10,000 (or your typical live size); leverage same as live.
Symbols/TFs:
EURUSD H1, XAUUSD H1 as baselines. Try M30/H4 later.
Spread: Current/real ticks; OR set a fixed spread equal to p95 of your broker’s live spread.
Data window: At least 2–3 years; include recent volatile periods.
Inputs:
Use Global Defaults for majors; switch to Gold or Indices preset per instrument.
RiskPercent 0.5–1.0%; UltraSafe true .
QoL: Keep panel off in tester for speed (optional), it doesn’t alter logic.
Evaluation:
Check: Sharpe > 0.8, Max DD < 20–25%, Profit Factor > 1.3, Expectancy > 0.
Verify robustness: vary RiskPercent ±50%, ATR multipliers ±0.2 and re‑run.
Walk‑forward: Split data 70/30 (train/forward) by date; keep settings fixed across both.
Turn on only after you confirm winners extend far beyond initial TP.
Start CashGapUSD = 1× to 1.5× avg winner (in $), MinStep 5 pips, OverrideATR true .
Modify failed due to close to market: increase Guard_ExtraPoints to 80–100 or raise MinSLDistancePips.
Stop‑out in tester: lower LotCapPerTrade / MaxLossUSD_PerTrade; reduce RiskPercent; ensure margin level threshold is met.
Too few trades: lower ADX_Threshold, disable RSI filter temporarily, or reduce Intrabar buffer to 0.15.
Over‑trading: enable Time Filter (e.g., 09:00–22:00) and keep OneTradePerBar true .
Attach on EURUSD H1 with Majors preset; set RiskPercent 0.8%.
Run a 2‑year backtest; review stats.
Switch to XAUUSD H1 with Gold preset; apply gold risk caps; test again.
Pick your live pair and keep UltraSafe ON the first week.
Good luck & trade safe! ?
If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: support@fx-market.pro.
Refund requests received more than 30 days after purchase will be rejected.