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

Exp_XAng_Zad_C_Tm_MMRec - MetaTrader 5 Expert - MT4/MT5 Resources

author EAcpu | 3 reads | 0 comments |

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

The trading system uses the XAng_Zad_C trend following indicator, which allows you to set fixed trading intervals and change the number of upcoming trades based on the results of previous trades.

When the indicator cloud changes color, a trading decision is made.

Trading times can be specified in the input parameters to trade at specified intervals:

 Input boolean time trading = true ; //Allow trading within the specified range
Enter hour start H=ENUM_HOUR_0; //Transaction start (hour)
Enter the minute StartM=ENUM_MINUT_0; //Transaction starts (minutes)
Enter the end of hour H=ENUM_HOUR_23; //End of transaction (hour)
Enter minutes EndM=ENUM_MINUT_59; //End of transaction (minutes)

Provide two hour and minute variables for each trade start time and trade end time.

The default settings enable the Expert Advisor to trade for the entire trading session starting from 0:00, while all positions are closed at 23:59.

If the start time in the EA settings is later than the specified trade end time, the EA will close the position at the specified time the next day.

Add input EA variable block for managing the trading volume of the opened position:

 Enter the unit purchase total MMTriger= 5 ; //The quantity of the last buy transaction to calculate the stop loss
Input unit buying loss MMTriger= 3 ; //Loss buying transaction quantity to reduce MM
Input unit selling total MMTriger= 5 ; //The quantity of the last selling transaction is used to calculate the stop loss
Input unit selling loss MMTriger= 3 ; //The number of loss selling transactions to reduce MM
Enter double the small MM_= 0.01 ; //The share of margin in the transaction to prevent losses
Enter double MM= 0.1 ; //The share of margin in a transaction during normal trading
Enter the margin mode MMMode=LOT; //Lot calculation 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.

This Expert Advisor requires the compiled indicator file XAng_Zad.ex5 in order to run. it should be located under \MQL5\Indicators.

The EA default input parameters are used in the following tests. Stop Loss and Take Profit were not used in the test.

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

Figure 1. Example of trade on chart. Trading is disabled only within the time interval set in the input.

2017 GBPJPY H4 test results:

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

Figure 2. Test result graph

Exp_XAng_Zad_C_Tm_MMRec - expert for MetaTrader 5

Figure 3. Example of trade on chart. Trading is only enabled within the time interval set in the input.


Attachment download

📎Exp_XAng_Zad_C_Tm_MMRec.mq5 (23.16 KB)

📎 SmoothAlgorithms.mqh (130.2 KB)

📎 TradeAlgorithms.mqh (236.36 KB)

📎 XAng_Zad_C.mq5 (17.1 KB)

Source: MQL5 #21654

Verification code Refresh