Exp_ColorSchaffJCCXTrendCycle_MMRec_Duplex - MetaTrader 5 Expert



Two identical trading systems (for long and short trading) based on the ColorSchaffJCCXT trend cycle indicator signals can be configured in different ways in a single EA, capable of changing the volume of upcoming trades based on the results of previous trades in this trading system. For this purpose, all input parameters can be divided into two main groups:
//+------------------------------------------------------------------------+ //|Input parameters of long trading EA | //+--------------------------------------------------------+ Magic Number Input Unit L_Magic= Chapter 777 ; //L Magic Number //+------------------------------------------------------------------------+ //|Input parameters of short trading EA| //+------------------------------------------------------------------------+ Input unit S_magic= Chapter 555 ; //S magic number
These two trading systems use different magic numbers and are absolutely independent of each other. Real financial markets are rarely symmetrical. Trading in rising and falling markets often requires absolutely different parameters of the same trading system. To configure the EA correctly, you should first test only one trading system and disable the second trading system using the relevant switches.
Enter Boolean L_PosOpen= true ; //L allows entry into long positions Enter Boolean value L_PosClose= true ; //L allows long positions to be closed
After that, do the same with the second system.
Added Expert Advisor input block to manage the number of open positions:
Input unit L_TotalMMTriger= 5 ; //L The quantity of the last buy transaction to calculate stop loss Input unit L_LossMMTriger= 3 ; //L loss buying transaction quantity to reduce MM Enter double L_SmallMM= 0.01 ; //L share of the margin in the transaction to prevent losses Enter double L_MM= 0.1 ; //L is the share of margin in a transaction during normal trading Enter the margin mode L_MMMode=LOT; //L hand setting mode
Input unit S_TotalMMTriger= 5 ; //S the quantity of the last sell transaction to calculate the stop loss Input unit S_LossMMTriger= 3 ; //S number of losing sell transactions to reduce MM Enter double S_SmallMM= 0.01 ; //S is the share of margin in the transaction when a loss occurs Enter double S_MM= 0.1 ; //S is the share of margin in a transaction during normal trading Enter margin mode S_MMMode=LOT; //S batch setting mode
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 EA to run, the files of the compiled JCCX.ex5 and ColorSchaffJCCXTrendCycle.ex5 indicators should be located
The input parameters of the default Expert Advisor have been used during testing, as shown below. Stop Loss and Take Profit were not used during testing.

Figure 1. Example of a trade with symmetrical setup on the chart
2017 GBP/USD H8 test results:

Figure 2. Test result graph

Figure 3. Example of a trade with an asymmetric setup on the chart
Attachment download
📎 Exp_ColorSchaffJCCXTrendCycle_MMRec_Duplex.mq5 (23.57 KB)
📎 SmoothAlgorithms.mqh (130.2 KB)
📎 TradeAlgorithms.mqh (237.01 KB)
📎 ColorSchaffJCCXTrendCycle.mq5 (23.35 KB)
📎 JCCX.mq5 (15.34 KB)
Source: MQL5 #22219
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •