Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-31-2007, 01:55 PM
ingvar_e ingvar_e is offline
Junior Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 19
ingvar_e is on a distinguished road
Structure and architecture of an EA

Hi all,
I am a veteran programmer, have learned many languages during my 35+ years in the computer industry. I have also programmed systems for trading, like OmniTrader, Bioprofit, Dakota and others. Forex is new to me. I have acquired some Forex trading methods (not programs) that I would like to program into MetaTrader in order to test how good they are. They are a bit complicated so there is a fair amount of code to write and that means that code has to be broken down to subroutines and functions.
If possible nor the main routine nor any of the functions/subroutines should be longer than one page and the action it performs should be well defined.
I have written some simple EA and a fairly complicated Indicator so I have go the basic hang of MT4.

Here is a question on Indicators. I have written one that that returns either +1, 0, -1 if a specific setup has occured. It is shown as a graph in a separate window. How should I change it so I can call it from an EA?Should it be defined as an Indicator at all or should I define it as library routine. If I define it as a library routine it seems like I have to pass it an array of Open, Low, High and Close since the system array of these are not readily available in a library routine. I have to have the last 100 bars available in order to calculate the setup signal.

Are there specific considerations to take to ensure that backtesting works OK?

Ingvar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-31-2007, 06:35 PM
omelette omelette is offline
Senior Member
 
Join Date: Jan 2006
Posts: 985
omelette is on a distinguished road
Quote:
Originally Posted by ingvar_e View Post
Hi all,
I am a veteran programmer, have learned many languages during my 35+ years in the computer industry. I have also programmed systems for trading, like OmniTrader, Bioprofit, Dakota and others. Forex is new to me. I have acquired some Forex trading methods (not programs) that I would like to program into MetaTrader in order to test how good they are. They are a bit complicated so there is a fair amount of code to write and that means that code has to be broken down to subroutines and functions.
If possible nor the main routine nor any of the functions/subroutines should be longer than one page and the action it performs should be well defined.
I have written some simple EA and a fairly complicated Indicator so I have go the basic hang of MT4.

Here is a question on Indicators. I have written one that that returns either +1, 0, -1 if a specific setup has occured. It is shown as a graph in a separate window. How should I change it so I can call it from an EA?Should it be defined as an Indicator at all or should I define it as library routine. If I define it as a library routine it seems like I have to pass it an array of Open, Low, High and Close since the system array of these are not readily available in a library routine. I have to have the last 100 bars available in order to calculate the setup signal.

Are there specific considerations to take to ensure that backtesting works OK?

Ingvar
Hi. You can of use stand-alone indicators from EA's with the use of the iCustom() function.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-01-2008, 02:00 PM
ingvar_e ingvar_e is offline
Junior Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 19
ingvar_e is on a distinguished road
Thanks omelette, that was uesful information.

Ingvar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/11514-structure-architecture-ea.html
Posted By For Type Date
forex » Blog Archive » Structure and architecture of an EA This thread Pingback 12-31-2007 08:02 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
The structure of forex brokers Nicholishen General Discussion 2 11-26-2006 08:27 AM


All times are GMT. The time now is 09:32 PM.