Here you can download a Metatrader 4 Expert Advisor Template which you can use to start to build your automated system. The template has a lot of tools, all of them works fine (I use it on live), you only have to add the rules for open an close position. I've written this Expert Advisor, some piece of the code are mine, others has been modified from open source EAs I've found on the net.
The template includes a ma croos example for open and close position, it just an example, please don´t use it with real money!!!
Download CyberEA-Template
Download CyberEA-Template
CyberEA-Template Overview
CyberEA-Template is an Expert Avsisor for Metatrader, this is, an automated trading program. Please note that I've not said system, the system must be added to the Template. As an example the cyberEA has a MA cross simple rules.
CyberEA include a lot of tools, all of them works fine: I can say that because I use the exact same code for my live trading without errors, obviously with differents rules for open and close position.
Head and global variables
Head: copyriht, owner link, etc.
Global variables: In this piece of the code we set all variables that we are going to use in several function of CyberEA. I prefer not inlcude here variables that are only used in one function, in this case the variable will be generated at he specific loop.
Start() Function
This function is the only one that is executed every tick that CyberEA recieve from the broker.
Every time this function is executed all the parameters in this loop are calculated and based on the result others function can be called.
Money Management: LotRisk()
In this loop CyberEA will calculate the lot size for the orders.
Check for Orders: BuscarOdernes()
CyberEA use this one for find orders from the Expert Advisors and return a certain value for a variable that will be use later in other functions and loops.
Check for Signal: BuscarSenal()
This is the core of the EA. Here is where you must write the indicators an rules for open and close position.
Check for Open: BuscarAbrir()
When this loop is executed the EA will take action based on the result of BuscarSenal(): The EA will send orders to the broker.
Check for Close: BuscarCierre()
Like BuscarAbrir() this loop will take action based on the result of BuscarSenal(), in this case for close position, not for open.
TrailStop():
I think all of you know what means trailstop ;))
BreakEven():
Loop used for modifiying orders and move stoploss to a certain levels.
Read carefully details of each function and start to code your BuscarSenal() loop with your indicators and rules.
Monday, May 12, 2008
Subscribe to:
Post Comments (Atom)
0 coments:
Post a Comment