Exp_XWAMI_MMRec - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources



Add input EA variable block for managing the trading volume of the opened position:
Input unit purchase total MMTriger= 5 ; // Last buy stop loss transaction quantity Input unit buying loss MMTriger= 3 ; // Reduce the number of loss buying transactions of MM Input unit total sell amount MMTriger= 5 ; // Last stop-loss sell transaction quantity Input unit selling loss MMTriger= 3 ; // The number of loss selling transactions is reduced by MM Enter double the small MM_= 0.01 ; // The share of financial resources that is the margin used in the transaction when a loss occurs Enter double MM= 0.1 ; // Under normal trading conditions, the share of financial resources used in the transaction is the margin Enter the margin mode MMMode=LOT; // Lot calculation method
In the case of such inputs, when choosing from the last 5 trades (3 of which were losses in a single direction), the EA opens the next trade in the same direction with a volume of 0.01 lots. If the last 5 losing trades are less than 3, the position will be 0.1.
In order for the generated EA to run correctly, the compiled XWAMI.ex5 indicator file should be located in the <terminal data directory>\MQL5\indicator folder.
The default Expert Advisor input parameters with stop loss were used during the test as shown below.

Figure 1. Example of trade on chart
Euro-USD test results for the first half of 2017:
Figure 2. Test result graph
Attachment download
📎 Exp_XWAMI_MMRec.mq5 (20.55 KB)
📎 SmoothAlgorithms.mqh (130.2 KB)
📎 TradeAlgorithms.mqh (236.36 KB)
📎 XWAMI.mq5 (18.07 KB)
Source: MQL5 #21627
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •