Exp_JFatlCandle_MMRec - MetaTrader 5 Expert - MT4/MT5 Resources


Add input EA variable block for managing the trading volume of the opened position:
Enter the unit purchase total MMTriger=3; // The quantity of the last buy transaction is used to calculate the stop loss Input unit: buying loss MMTrigger=2; // Reduce the number of MM's losing buying transactions Input unit Sell total MMTriger=3; // The last sell transaction quantity is used to calculate the stop loss Input unit selling lossMMTriger=2; //The number of losing selling transactions to reduce MM Enter double the small MM_= 0.01 ; // Margin share when a loss occurs in the transaction Enter double MM= 0.1 ; // Share of margin in a trade during normal trading Enter the margin mode MMMode=LOT; // Lot size determination 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 indicator files JFatl.ex5 and JFatlCandle.ex5 should exist in the <terminal data directory>\MQL5\indicator folder.
During testing the default Expert Advisor's input parameters without stop loss were used, as shown below.

Figure 1. Example of trade on chart
2017 USDJPY H12 test results:

Figure 2. Test result graph
Attachment download
📎Exp_JFatlCandle_MMRec.mq5 (14.73 KB)
📎 SmoothAlgorithms.mqh (130.2 KB)
📎 TradeAlgorithms.mqh (237.01 KB)
📎 JFatl.mq5 (15.48 KB)
📎 JFatlCandle.mq5 (15.28 KB)
Source: MQL5 #22300
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •