Exp_Open_Oscillator_Cloud_MMRec - MetaTrader 5 Expert


Add input EA variable block for managing the trading volume of the opened position:
Input unit buying loss MMTriger= 2 ; // Reduce the number of loss buying transactions of MM Input unit selling loss MMTriger= 2 ; // 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, if the last two trades in one direction were losing, the EA will open the next trade in the same direction with a trading volume of 0.01 lots. If at least one of the last two trades was not a loss, the position is 0.1.
In order for the generated EA to run correctly, the compiled Open_Oscillator_Cloud.ex5 indicator file should be located in the <terminal data directory>\MQL5\indicators 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
2017 AUDUSD H2 test results:

Figure 2. Test result graph
Attachment download
📎 Exp_Open_Oscillator_Cloud_MMRec.mq5 (16.11 KB)
📎 SmoothAlgorithms.mqh (130.2 KB)
📎 TradeAlgorithms.mqh (229.96 KB)
📎 Open_Oscillator_Cloud.mq5 (17.79 KB)
Source: MQL5 #21610
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •