Angles Ema Probability And Win
- Experts
- Muhittin Cuneydioglu
- Version: 2.0
- Updated: 8 December 2023
- Activations: 5
MetaTrader 5 Algorithmic Trading Robot
Introduction
- Code Name: ema19.mq5
- Copyright: Copyright 2023, MetaQuotes Ltd.
- Link: MetaQuotes Ltd.
- Version: 1.00
Parameter List:
- FastEMAPeriod: Period of the Fast EMA.
- SlowEMAPeriod: Period of the Slow EMA.
- LotSize: Lot size for each trade.
- MaxAngleDifference: Maximum allowed angle difference (degrees).
- MaxEmaDifference: Maximum allowed EMA difference (degrees).
- HoursBetweenTrades: Hours between trades.
- buySignalEnabled: Enable buy signals.
- sellSignalEnabled: Enable sell signals.
- CheckInterval: Interval for TP and SL checks (minutes).
- TrailingStopDistance: Trailing stop distance (points).
- Timeframe: Timeframe for trading.
- MaxOpenPositions: Maximum number of open positions.
Strategy This MQL5 code implements an algorithmic trading robot using Fast and Slow Exponential Moving Averages (EMA).
Strategy Features
- EMA Periods: Trend analysis using Fast and Slow EMA periods.
- Lot Size: Fixed lot size per trade.
- Maximum Angle and EMA Differences: Maximum angle and EMA differences for determining entry conditions.
- Hourly Gap: Minimum gap between two trades.
- Buy and Sell Signals: Options to enable buy and sell signals.
- Take Profit and Stop Loss (TP/SL) Check Frequency: Frequency of checking TP and SL.
- Trailing Stop: Trailing stop distance used in trades.
Code Structure Initialization:
- Declaration of required libraries.
- Initialization of the Trade class.
External Input Parameters:
- Declaration of user-defined parameters.
Main Functions:
- OnTick(): The main function that runs on every tick.
- Check for trade permission.
- Calculate EMA and angle differences.
- Generate buy/sell signals and execute trades.
- Perform TP and SL checks at specified intervals.
- CheckTakeProfitAndStopLoss(): Function for TP and SL checks.
Time Functions:
- OnTimer(): Function to control trade permissions at specific intervals.
Progress Control
- Control for the minimum hour gap between trade permissions.
- TP and SL are periodically checked and updated.
- Trades are protected using Trailing Stop.
Results and Progress
- Detailed backtests can be conducted to analyze and improve the robot's performance.
- The code is open to user feedback and suggestions for further development.
- Strategy parameters can be optimized for increased reliability and profitability.
Acknowledgments We thank the MetaQuotes Ltd. team for providing the platform and resources. User feedback is welcome. Contact us here .