Aitrade Cfx Ema
- Experts
-
Phorllet Lorn
Welcome to AiTraDE EAs | Smart Trading Solutions for Modern Traders
AiTraDE EAs focuses on developing MetaTrader 5 Expert Advisors (EAs), automated trading systems, and custom technical indicators, with a special focus on XAUUSD (Gold). - Versione: 1.40
- Attivazioni: 5
Aitrade Cfx Ema is an automated Expert Advisor for MetaTrader 5 based on Exponential Moving Average (EMA) alignment. It allows traders to configure two, three, or four EMAs, manage six independent positions, and adjust trading parameters directly from a compact on-chart dashboard.
The EA combines automated entry and exit logic with customizable take-profit levels, optional initial stop loss, trading sessions, and daily risk limits.
Key Features
-
Flexible EMA strategy: Select 2, 3, or 4 EMA lines for trading.
-
Interactive dashboard: Adjust EMA periods, trading timeframe, take profits, and stop loss settings directly on the chart.
-
Six independent positions: Each position has its own editable take-profit target.
-
Optional initial stop loss: Enable or disable a fixed SL for new positions.
-
Trading controls: Start or stop new entries from the dashboard while existing positions remain managed.
-
Daily limits: Set optional daily profit and drawdown limits.
-
EMA visualization: Display configurable EMA curves without installing a separate indicator.
-
Entry confirmation: Choose OnTick Once or Closed Candle mode.
-
Session filters: Configure trading days and market sessions.
-
Trading statistics: View daily Buy/Sell counts, daily profit, and cumulative EA profit.
How the Strategy Works
The Expert Advisor evaluates EMA alignment using the selected number of moving averages.
Two-EMA mode
BUY: EMA 1 is above EMA 2.
SELL: EMA 1 is below EMA 2.
Three-EMA mode
BUY: EMA 1 is above EMA 2, and EMA 2 is above EMA 3.
SELL: EMA 1 is below EMA 2, and EMA 2 is below EMA 3.
Four-EMA mode
BUY: EMA 1 > EMA 2 > EMA 3 > EMA 4.
SELL: EMA 1 < EMA 2 < EMA 3 < EMA 4.
The EA detects the first newly valid directional alignment and attempts one six-position entry batch, subject to trading conditions and filters.
If an opposite valid EMA alignment occurs, the EA attempts to close the remaining positions, regardless of their current profit or loss.
Default Trading Configuration
| Parameter | Default |
|---|---|
| EMA periods | 6 / 18 / 50 / 100 |
| Active trading EMAs | 4 |
| Trading timeframe | M5 |
| Entry mode | OnTick Once |
| Number of positions | 6 |
| Lot size per position | 0.50 |
| TP1 | 5.0 price units |
| TP2 | 10.0 price units |
| TP3 | 10.0 price units |
| TP4 | 15.0 price units |
| TP5 | 15.0 price units |
| TP6 | 20.0 price units |
| Initial Stop Loss | Disabled |
| Breakeven / Trailing | Not used |
Take-profit and stop-loss distances are measured in symbol price units, not account-currency profit.
The default configuration opens six positions totaling 3.00 lots. Adjust the lot size to match your account and risk tolerance.
Interactive Dashboard
The on-chart dashboard provides access to:
-
Trading timeframe selector: M1, M5, M15, M30, H1, and H4.
-
Status: Running, Stopped, Wait, Buy, or Sell.
-
Buy Today and Sell Today counters.
-
Profit Today and Total Profit statistics.
-
Editable daily profit and drawdown limits.
-
Start and Stop controls.
-
Expandable EMA Settings panel.
-
Expandable TP / SL Settings panel.
EMA Settings Panel
Select 2, 3, or 4 trading EMAs. Change the four EMA periods, control individual line visibility, adjust line width, and configure chart display.
EMA calculation changes are restricted while the EA manages open positions. This prevents changing the active trading strategy during an existing trade.
TP / SL Settings Panel
Configure six individual take-profit distances and an optional fixed initial SL.
Changes to TP and SL settings apply to new entries only. Existing position targets are preserved.
Main Input Parameters
EMA and Position Settings
-
InpTradingTF — Trading timeframe; M5 by default.
-
InpEMA1 to InpEMA4 — EMA periods; defaults 6, 18, 50, and 100.
-
InpTradingEMACount — Number of EMAs used for trading; 2, 3, or 4.
-
InpLots — Lot size per position; 0.50 by default.
Take Profit and Stop Loss
-
InpTP1 to InpTP6 — Six independent TP distances in price units.
-
InpUseInitialSL — Enable or disable the initial SL; disabled by default.
-
InpInitialSLDistance — Fixed initial SL distance when enabled; default 4.0.
Entry and Daily Limits
-
InpEntryMode — OnTick Once or Closed Candle confirmation.
-
InpProfitLimitPerDay — Daily realized profit limit for new entries; 0 disables.
-
InpDDLimitPerDay — Daily EA drawdown limit for new entries; 0 disables.
Trading Days and Sessions
-
InpMonday to InpFriday — Enable or disable individual trading days.
-
InpAsia, InpLondon, InpNewYork — Enable individual market sessions.
-
Session Start / End inputs — Configure each session using broker-server time.
Economic News Filter
-
InpSkipHighImpactNews — Filter new entries around high-impact USD news.
-
InpMinutesBeforeNews — Entry-block window before news; default 25 minutes.
The built-in MT5 economic calendar is unavailable in Strategy Tester. Historical backtests therefore do not apply the live calendar news filter.
Chart and Display
-
InpDrawingMode — Auto, Show, or Hide chart drawings.
-
InpShowEMACurves — Display EMA curves.
-
InpEMACurveWidth — EMA line thickness.
-
EMA Curve Color inputs — Customize the four line colors.
-
InpShowTradeLevels — Display active trade levels.
-
InpShowTPLevels — Display take-profit levels.
-
InpShowPriceBadges — Display level price labels.
-
InpDrawHistoricalSetups — Display historical EMA setup markers.
-
InpDrawExecutedTrades — Display recorded trade-entry and exit markers.
Additional display inputs control the center chart watermark.
Installation and Requirements
-
Install the Expert Advisor through the MetaTrader 5 Market.
-
Attach it to the desired chart.
-
Enable Algo Trading in MetaTrader 5.
-
Configure the timeframe, EMA periods, lot size, and TP/SL settings.
-
Use the dashboard Start button to enable new entries.
-
Test the configuration in Strategy Tester or on a demo account before live use.
Account requirement: MetaTrader 5 hedging account for six independent positions.
No separate custom indicator is required.
Risk Information
Trading carries financial risk. The EA does not guarantee profits or prevent losses.
The initial stop loss is disabled by default. When disabled, positions can experience substantial adverse price movement before an opposite alignment causes an exit. Daily profit and drawdown limits restrict new entries; they are not guaranteed limits on losses from existing positions.
Execution depends on market liquidity, spread, broker conditions, available margin, and accepted order levels.
Users should evaluate lot size and risk settings before live trading.
Support: Product questions and technical support are handled through the MQL5 product comments and messaging system.

