
🔍 Fun Time EA – Smart Trend-Following Automation for MetaTrader 4
"Trade Smarter, Not Harder – Let ATR-Guided Trends Work for You!"
📘 1. Overview of the Expert Advisor
The Fun Time EA is a trend-following automated trading system designed for MetaTrader 4 (MT4). It uses price action (open/close comparison) to detect trends and executes trades with dynamic stop-loss (SL) and take-profit (TP) based on the Average True Range (ATR).
🔑 Key Features:
✔ Trend Detection – Trades based on bullish/bearish candle closes.
✔ ATR-Based Risk Management – Adjusts SL/TP dynamically using ATR multipliers.
✔ Trailing Stop Function – Locks in profits as the market moves favorably.
✔ Flexible Lot Sizing – Supports both fixed and risk-based auto-lot calculation.
✔ Trade Commenting – Labels trades with "ER_BUY" or "ER_SELL" for easy tracking.
⚙️ 2. How the EA Works
📈 Trade Entry Logic:
Long (Buy) → Triggered when the current candle opens lower & closes higher (bullish candle).
Short (Sell) → Triggered when the current candle opens higher & closes lower (bearish candle).
🎯 Exit Logic (TP/SL Calculation):
Take Profit (TP) = Entry Price ± (ATR × TakeFactor)
Stop Loss (SL) = Entry Price ± (ATR × StopFactor)
Trailing Stop (Optional) → Activates after price moves favorably by Tstart pips, then adjusts in Tstep increments.
📊 Indicators Used:
ATR (14-period) – Determines market volatility for SL/TP placement.
🖥️ 3. How to Run the EA
📌 Installation Steps:
Download the EA (.mq4 file).
Copy it into MT4 MQL4 Experts.
Restart MT4, then drag & drop the EA onto an H1 chart.
Enable "AutoTrading" (Ctrl + T) and set parameters.
⚡ Recommended Settings:
Timeframe: H1 (1-hour chart) (mandatory, as enforced in code)
Currency Pairs: Works best on major pairs (EURUSD, GBPUSD, etc.) with low spreads.
Broker Type: Suitable for ECN/Raw Spread accounts (avoids slippage issues).
Testing: Always forward-test on a demo account before going live.
🛠️ 4. Input Parameters & Settings
ParameterDescriptionDefault ValueOptimal Range
MagicNumberUnique trade identifier.1001Any unique number
AutoLotIf true, calculates lot size based on risk.truetrue/false
FixedLotFixed lot size (if AutoLot=false).0.10.01-100
RiskRisk percentage per trade (if AutoLot=true).2%1-5%
TakeFactorMultiplier for TP (ATR-based).4.21.0-5.0
StopFactorMultiplier for SL (ATR-based).4.91.0-5.0
UseTstopEnables trailing stop.truetrue/false
TstartPips needed to activate trailing.4810-50
TstepPips increment for trailing adjustment.3610-50
oscb/oscsTrade comments for Buy/Sell orders."ER_BUY"/"ER_SELL"Customizable
⚖️ Risk Management Tips:
Higher TakeFactor = Wider TP (allows more room for volatility).
Lower StopFactor = Tighter SL (but may increase stop-outs).
Trailing Stop (Tstart & Tstep) → Should be smaller than TP distance to lock in profits.
📌 5. Additional Notes & Warnings
⚠ Important Considerations:
Works only on H1 timeframe (code enforces this).
Avoid using on exotic pairs (high spreads may affect performance).
Backtest first – Optimize TakeFactor & StopFactor for best results.
MT4 Only – Not compatible with MT5.
💡 Pro Tip:
If the market is choppy, increase ATR multipliers (TakeFactor & StopFactor) to avoid premature exits.
🧑💻 6. Developer & Source
Developer: R.KH 1001
Official Website: https://www.robomql.com
🚀 Final Thoughts:
The Fun Time EA is a solid trend-following system that leverages ATR for dynamic risk management. While simple, it can perform well in trending markets—always test before live deployment!
Happy Trading! 📊💹