Trabajo finalizado
Tarea técnica
Important: I don't want close price, I want exact current price for ema and price in the code. Otherwise the strategy do many losing trades for nothing...
Attached the image showing indicators how they look like (2 EMA: 5 and 26, and 2 Smoothed EMA on RSI: 5 and 50. So you can see visually what i'm talking about)
The goal is to develop two efficient Expert Advisors (EAs) for MetaTrader 5 (MT5) to automate trading in cryptocurrencies and stocks. The requirements are as follows:
1. EMA-based EA
• Strategy:
o Utilizes a single Exponential Moving Average (EMA).
o Executes Buy orders when the price crosses above the EMA.
o Executes Short orders when the price crosses below the EMA.
• Trailing Stop:
o The EMA acts as a dynamic trailing stop, adjusting with price movement.
• Capital Management:
o Ability to adjust the percentage of capital allocated for each trade.
o The EA should automatically calculate position sizes based on the set percentage.
2. Smoothed EMA of RSI-based EA
• Strategy:
o Uses a Smoothed EMA applied to the Relative Strength Index (RSI).
o Executes Buy orders when the smoothed RSI crosses above a specified threshold.
o Executes Short orders when it crosses below a specified threshold.
• Capital Management:
o Similar to the first EA, allowing for flexible capital allocation.
o The EA should dynamically adjust trade sizes based on the specified percentage of available capital.
Additional Features for Both EAs
• User Inputs:
o Customizable EMA and RSI periods.
o Adjustable capital allocation percentage.
• Compatibility:
o Optimized for fast trading on MT5, suitable for both crypto and stock markets.