Exp_ColorX2MA_Digit_NN3_MMRec - MetaTrader 5 Expert


Added input EA variable block for managing the trading volume of opened positions. For example, for the first system:
Input unit A_BuyLossMMTriger= 2 ; //Buy transactions with large losses to reduce MM Input unit A_SellLossMMTriger= 2 ; //Some losing sell transactions to reduce MM Enter double A_small MM= 0.01 ; //The share of financial resources used as margin in the event of a loss on the transaction Enter double A_MM= 0.1 ; //Under normal trading conditions, the capital share of the margin used in the transaction
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.
Similar inputs can be used for the second trading system:
Input unit B_BuyLossMMTriger= 2 ; //The number of B loss buying transactions is reduced by MM Input unit B_SellLossMMTriger= 2 ; //The number of B loss selling transactions is reduced by MM Enter double B_SmallMM= 0.01 ; //B's share of financial resources used in margin trading in the event of a loss Enter double B_MM= 0.1 ; //B share of financial resources of the deposit used in the transaction
The C_ prefix is used for input to the third system.
The best option for setting up such an EA is to configure it individually on each trading system and apply appropriate switches to disable the other two systems in the form of the following parameters:
Input Boolean B_BuyPosOpen= True ; //B allows entry into long positions Enter a Boolean value B_SellPosOpen= true ; //B allows short positions to be opened
By setting them to false.
In order for the generated EA to run correctly, the compiled ColorX2MA_Digit.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
2016 GBPJPY H3, H6 and H12 test results.

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