Author: josef strauss
MQL5 Code Creator: barabashkakvn
The AMA Trader EA utilizes the Adaptive Moving Average (AMA) and the Relative Strength Index (RSI) to generate trading signals. Let’s break down how a typical "Open Buy" signal is created:

**Step 1:** The RSI must be below the 30 level (as set in the RSI Level Down parameter of the EA). **Step 2:** The price must break above the AMA indicator. The Step Length (the number of bars between Step 1 and Step 2) is crucial for optimizing the interplay between these two indicators.
Martingale Strategy
When a new trading order comes in, the EA calculates profit for both BUY and SELL positions separately. Here’s how it works:
- Open Buy
- If the profit on BUY positions is less than 0.0, the EA will open two BUY positions.
- Otherwise, it opens just one BUY position.
- Open Sell
- If the profit on SELL positions is less than 0.0, it opens two SELL positions.
- Otherwise, it opens one SELL position.
Fund Management
For managing funds, I've implemented a straightforward system: Profit Limit for Closing All Positions - once the total profit from the EA on a specific symbol reaches a certain point, all positions will be closed. Essentially, this helps to secure your profits.
Keep an eye on your trading account balance while the EA is running. If your account balance surpasses your saved balance by the Withdrawal amount, withdraw that sum and close all positions.
Example with EURUSD on M5:

Related Posts
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation
- Mastering the Moving Average EA for MetaTrader 5: A Trader's Guide
- RRS Impulse: Your Go-To Scalping EA for MetaTrader 4