Hey fellow traders! Today, I want to dive into a powerful Expert Advisor (EA) that combines two independent trading systems: SilverTrend_V2 and ColorJFatl_Digit. This EA is designed to adjust the size of future trades based on the outcomes of previous ones, allowing for smarter trading decisions.
The signals for opening trades are generated as a bar closes, especially when there's a trend change indicated by a shift in the color of either of these indicators.
Managing Trade Volumes
To help manage position sizes, we’ve included adjustable settings in the EA. For instance, when using the SilverTrend indicator:
input uint A_BuyLossMMTriger=2; // Number of losing Buy positions to reduce MM input uint A_SellLossMMTriger=2;// Number of losing Sell positions to reduce MM input double A_SmallMM=0.01 // Share of the deposit in a deal when losing input double A_MM=0.1 // Share of the deposit in a deal for normal trading
With these settings, if the last two trades were in the same direction, the EA will open the next trade in that direction with a lot size as low as 0.01. If at least one of those trades is profitable, the position volume will increase to 0.1.
Identical Settings for ColorJFatl_Digit
The inputs for the trading system utilizing ColorJFatl_Digit are set up similarly:
input uint B_BuyLossMMTriger=2 // Number of losing Buy positions to reduce MM input uint B_SellLossMMTriger=2;// Number of losing Sell positions to reduce MM input double B_SmallMM=0.01 // Share of the deposit in a deal when losing input double B_MM=0.01 // Share of the deposit in a deal when losing
For the EA to function properly, make sure that the compiled files SilverTrend.ex5 and ColorJFatl_Digit.ex5 are located in your <terminal_data_directory>\MQL5\Indicators folder.
Testing Insights
In the tests shown below, we used the EA's default inputs along with stop-losses.

Fig 1. Exemplary trades in the chart
Here are the testing results for GBPUSD on H6 for the year 2016:

Fig. 2. Testing results chart
Related Posts
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies
- Mastering the Moving Average EA for MetaTrader 5: A Trader's Guide
- Creating a Stochastic-Based EA for Hammer and Hanging Man Patterns in MetaTrader 5
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation