Previous Part 3,click here

The next function we have to make is a get signal function. because this ea using RSI indicator, so the code as follows:

And now, we make a send orders function to send order smoothly to the broker server.
Look at the following code:

if the function is successful, it will get the ticket number, if it fails, will the resulting number -1. Now we make the trailing stop function. See my code:

Then we make the move to breakevent function. This function use to move the stoploss to breakevent point. see this code:

we further utilize this function () referenced by MQL4.
The code that we used to put in the code for this function is to make EA adapt and work well on the broker with 4 digits or 5 digits pricing.
Besides this, the usual code placed here is the code to adapt a stoploss and Takeprofit EA with stoploss and Takeprofit minimum allowed by broker.
See this Code:

Then we continue with arranging a bit of code in the start () function. see what I have the chain:

Then we finish making this by completing deinit ea () function with this code:

then do backtesting in order to know whether this ea could work properly or not.
See results the backtest:

Happy trying.....
0 comments:
Post a Comment