Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Exp_BykovTrend_ColorX2MA_MMRec - MetaTrader 5 Expert

author EAcpu | 2 reads | 0 comments |

Exp_BykovTrend_ColorX2MA_MMRec - expert for MetaTrader 5

Exp_BykovTrend_ColorX2MA_MMRec - expert for MetaTrader 5

Two independent trading systems using indicators BykovTrend_V2 and Colored X2MA within one EA, with the option to change the size of future trades based on the results of previous trades. When the bar closes, the trading system forms a signal to open a position, and if the trend changes, it is shown by changing the color of either of these two indicators.

In order to manage the volume of trades to be opened, the EA input block was added. For example, in a system using the BykovTrend indicator:

 Input unit A_BuyLossMMTriger= 2 ; //Reduce the number of MM buying positions
Input unit A_SellLossMMTriger= 2 ; //Some losing sell positions are reduced by MM
Enter double A_small MM= 0.01 ; //Margin share in a transaction when there is a loss
Enter double A_MM= 0.1 ; //A share of the margin in a normal transaction

With such input, if the last two trades were in the same trading direction, the EA will open the next trade in the same direction with a lot size as small as 0.01. If at least one of the last two trades was not a loss, the position will be 0.1.

The inputs to the trading system using ColorX2MA are exactly the same:

 Input unit B_BuyLossMMTriger= 2 ; //B loss buying position reduces the number of MM
Input unit B_SellLossMMTriger= 2 ; //B loss selling position reduces the MM quantity
Enter double B_SmallMM= 0.01 ; //B share in the transaction, when losing money
Enter double B_MM= 0.01 ; //B share in the transaction, when there is a loss

In order for the generated EA to run correctly, the compiled indicator files BykovTrend_V2.ex5 and ColorX2MA.ex5 must be in the <terminal data directory>\MQL5\indicator folder.

In the test shown below, the EA's default inputs are used with StopLoss.

Exp_BykovTrend_ColorX2MA_MMRec - expert for MetaTrader 5

Figure 1. Example trade in chart

2016 GBPJPY H2 test results:

Exp_BykovTrend_ColorX2MA_MMRec - expert for MetaTrader 5

Figure 2. Test result graph


Attachment download

📎 Exp_BykovTrend_ColorX2MA_MMRec.mq5 (32.02 KB)

📎 SmoothAlgorithms.mqh (130.2 KB)

📎 TradeAlgorithms.mqh (229.96 KB)

📎 BykovTrend_V2.mq5 (12.29 KB)

📎 ColorX2MA.mq5 (17.51 ​​KB)

Source: MQL5 #21359

Verification code Refresh