Go Back   Forex-TSD > Programming > MetaTrader Programming
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-31-2007, 01:55 PM
Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 39
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 12-31-2007, 06:35 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,117
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 01-01-2008, 02:00 PM
Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 39
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

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 01:52 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.