Wednesday, June 26, 2013

How to Create an EA Part 4

Posted by Blogger Name. Category: , , ,



Previous Part 3,click here

How to Create an EA

The next function we have to make is a get signal function. because this ea using RSI indicator, so the code as follows:
How to Create an EA
And now, we make a send orders function to send order smoothly to the broker server.
Look at the following code:
How to Create an EA
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:

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

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:
How to Create an EA
Then we continue with arranging a bit of code in the start () function. see what I have the chain:

How to Create an EA

Then we finish making this by completing deinit ea () function with this code:
How to Create an EA
then do backtesting in order to know whether this ea could work properly or not.
See results the backtest:

How to Create an EA


Happy trying.....








0 comments:

Post a Comment

◄ Posting Baru Posting Lama ►
 

Footer1

FOOTER 2

Footer 3