ExpertAdvisorBuilder Forum Index ExpertAdvisorBuilder
ExpertAdvisorBuilder Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Guide

 
Post new topic   Reply to topic    ExpertAdvisorBuilder Forum Index -> ExpertAdvisorBuilder Forum
View previous topic :: View next topic  
Author Message
S.B.T.
Site Admin


Joined: 30 Dec 2005
Posts: 73
Location: Japan

PostPosted: Tue May 05, 2009 4:22 am    Post subject: Guide Reply with quote

Expert Advisor Builder(EAB) allows you to create your Expert Advisor(EA) easily.
EA is a kind of the script for MetaTrader 4(MT4). You may use it for the testing of your strategy.

I really recommend you to use the EA for only the purpose of testing. Because I know EA is only a program, I never guarantee any results.

SEE ALSO: Tutorial

0.Table Of Contents

1.Introduction
2.Template section(for expert users)
3.Variable section(for expert users)
4.Buy strategy section
4.Sell strategy section
4.Close(Buy) strategy section
4.Close(Sell) strategy section
5.Common parameters of logical values
6.How to build your logic
7.How to build your Strategy
8.Order Options section
9.Export your EA
10.Save / Load your setting of EAB
APPENDIX.How to build typicaly strategy


1.Introduction

EAB has 7 tabs and their sections.

Template section(for expert users)
This section is the one to use your own script as the template of EA which will be finally exported by EAB.

Variables section(for expert users)
This section is the one to set up the variables which may be used in Variables / Buy strategy / Sell strategy / Close(Buy) strategy / Close(Sell) strategy.

Buy strategy section
This section is the one to build your strategy to buy.

Sell strategy section
This section is the one to build your strategy to sell.

Close(Buy) strategy section
This section is the one to build your strategy to close the position which has been bought by 'Buy strategy'.

Close(Sell) strategy section
This section is the one to build your strategy to close the position which has been sold by 'Sell strategy'.

Order options section
This section is the one to set some settings for your EA.



2.Template section(for expert users)
You may use your own script as the template of EA which will be finally exported by EAB.
When you fill the form with your original script which should include the template tags of EAB, the template tags will be replaced with the values / expressions of EAB.

About the template tags, see the list under this section on EAB, please.


3.Variable section(for expert users)
You may set up the variables which may be used in Variables / Buy strategy / Sell strategy / Close(Buy) strategy / Close(Sell) strategy.
They are very useful for Variables / Buy strategy / Sell strategy / Close(Buy) strategy / Close(Sell) strategy, if you'd like to repeatedly use the same setting.
You may repeatedly use the variables as the parameter of logical value(indicator etc.) in each section.

You need select 'Number / Varible' from their own drop-down-list, then you can set the variable by clicking 'Var #1' etc. button.
Or you may also just type 'Var1' etc. manually.

'Varible' section almost is the same as the following strategy section, though this section only has a logical value.


4.Buy strategy section
4.Sell strategy section
4.Close(Buy) strategy section
4.Close(Sell) strategy section

you can build your strategies. These section have some settings like the following.



(1) Add / Del button
This is the button to add / remove a logic.
The addition / removal is LILO(Last In Last Out).

(2) Logic ID
This is ID of the logic.
In most cases, you needn't care this ID.
However, if you'd like to use variable which may have been set in 'Variable' section, you need remember the ID like 'Var #1' etc. to use it.

(3) Logical operator for each logic
This is the logical operator which combines each logic.

'AND': When all logics are satisfied, the strategy will be executed by EA.
'OR' : When a logic is satisfied even if other logics aren't satisfied, the strategy will be executed by EA.

(4) Left value (logical value)
This is the left value which is connected with (6) by (5).
You can select the logical value(indicator etc.) to build your logic from the drop-down-list.

(5) Logical operator for each logical value
This is the logical operator which connects each logical value(indicator etc.).

(6) Right value (logical value)
This is the right value which is connected with (4) by (5).
You can select the logical value(indicator etc.) to build your logic from the drop-down-list.

(7) Collapse / Expansion button
This is the toggled button to collapse / expand the logic section.

(8) Left value's name
This is the left value's name which has been selected by (4).

(9) Left value's parameter(s)
This is the left value's parameter(s) which has(have) been selected by (4).
You may input some parameter(s) for the indicator etc.

(10) Right value's name
This is the left value's name which has been selected by (6).

(11) Right value's parameter(s)
This is the left value's parameter(s) which has(have) been selected by (6).
You may input some parameter(s) for the indicator etc.




5.Common parameters of logical values

Most of the left / right values have some common parameters.

'Symbol' : This is the symbol for the logical value(indicator etc.) which you'd like to use.
'Current' means a flexible value. The logical value of the chart's symbol to which you'll attach the EA will be used.

'Timeframe': This is the time-frame for the logical value(indicator etc.) which you'd like to use.
'Current' means a flexible value. The logical value of the chart's time-frame to which you'll attach the EA will be used.

'Shift' : This is the ordinal number of the bar for the logical value(indicator etc.) which you'd like to use.
'0' means a current bar's value will be used. '1' means the value 1 bar ago will be used. 'n' means the value n bar(s) ago will be used.

Other parameters are the same as each parameters which the logical value(indicator etc.) has.



6.How to build your logic

To build your logic, you can select a left / right value and logical operator.
Logical operator is the operator which compares the left value with the right value.
When the expression is satisfied, the logic will be executed.

'=': This means 'When the left value is equal to the right value'.
'<>': This means 'When the left value isn't equal to the right value'.
'<': This means 'When the left value is less than the right value'.
'>': This means 'When the left value is greater than the right value'.
'<=': This means 'When the left value is equal to / less than the right value'.
'>=': This means 'When the left value is equal to / greater than the right value'.



This logic means the following strategy.

* Execute the strategy(Buy)
* When 14 Moving Average(MA) is greater than 28MA.

This never means golden-cross. This just means 'Buy, whenever 14MA is greater than 28MA'.

To build golden-cross strategy, you have to build your strategy which has some logics.


7.How to build your Strategy

You can combine some logics.



'Shift: 1' means 'The logical value 1 bar ago', and 'Shift: 0' means 'The current logical value'.
This logics means the following strategy.

* Execute the strategy(Buy)
* When 14MA 1 bar ago was less than 28MA 1 bar ago.
* And when current 14MA is greater than current 28MA.

This just means golden-cross.

You can combine some logical values and some logics to build your strategy.


8.Order Options section
You can set some settings for your EA.

'SignalMode' :This is the way EA executes a order.
'Lots' :This is the amount of the lot per order.
'Slippage' :This is the pip(s) of the slippage which you can accept, when EA executes new order.
'StopLoss' :This is the pip(s) of the stop-order which is ordered by EA with new order.
'TakeProfit' :This is the pip(s) of the limit-order which is ordered by EA with new order.
'TrailingStop':This is the pip(s) of the trailing-stop-order which is kept renewing by EA while EA has a position.

SignalMode
This is the way EA executes a order.

'Each Tick' :This means EA may execute a order per tick.
EA will execute a order whenever the logics of your strategy is satisfied.
However, EA never execute some orders in the same bar. EA may executes only a pair of orders(open and close) per bar.

'Complete Bar':This means EA may execute a order per bar.
EA will execute a order when the logics of your strategy is satisfied, and when new bar is just opened.
So EA can wait until the signal is exactly fixed. EA may executes only a order(open or close) per bar.

Actually, 'Complete Bar' is almost the same as 'Each Tick'.
'Complete Bar' just increases the value of 'Shift' parameter in logical value to their value + 1.

So the following logics are almost the same.
However, they aren't completely the same.
'Each Tick' may execute only a pair of order(openand close) per bar, 'Complete bar' may execute only a order(open or close) per bar.


Code:

Logic #1 [AND] [A] [<] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+

SignalMode: Each Tick


Code:

Logic #1 [AND] [A] [<] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+

SignalMode: Complete Bar


The examples express the screen of strategy section.
'[...]' means the HTML form to which you should input / select the setting.
'A' / 'B' means the left / right value which you'd like to use in each logic.



9.Export your EA

You can export your strategy as EA.
All you have to do is click 'Comple!' button, then you'll get your .mq4 file.

To use your EA on MT4, you need move the file to 'experts' folder in your MT4 folder.
After you compile the file on MQL Editor, you can use your EA.



10.Save / Load your setting of EAB
You may save your setting of EAB.
When you click 'Save' button, you'll get your .eab files.

You may also load your setting file.
When you click 'Load' button after you choice the file from 'Brows...' button, you can build your strategy again.



APPENDIX.How to build typical strategy

There are typical strategies for trading, so you may think 'I wonder how to build them'.
In this section, you can know how to build them.
Actually, you've already known first strategy(golden-cross), because I've told you it in '7.How to build your Strategy' section.

The following examples express the screen of strategy section.
'[...]' means the HTML form to which you should input / select the setting.
'A' / 'B' means the left / right value which you'd like to use in each logic.
'N' means the decimal / integral value which you'd like to use.

When A crosses and goes above B(golden-cross)

Code:

Logic #1 [AND] [A] [<] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+

Logic #2 [AND] [A] [>] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+


When A crosses and goes below B(dead-cross)

Code:

Logic #1 [AND] [A] [>] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+

Logic #2 [AND] [A] [<] [B]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+



When the value of A becomes N or more

Code:

Logic #1 [AND] [A] [<] [Number/Variable]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Value: [N]                           |
+---------------------------------------+

Logic #2 [AND] [A] [=>] [Number/Variable]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Value: [N]                           |
+---------------------------------------+




When the value of A becomes N or less

Code:

Logic #1 [AND] [A] [>] [Number/Variable]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [1]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Value: [N]                           |
+---------------------------------------+

Logic #2 [AND] [A] [<=] [Number/Variable]
+---------------------------------------+
|A:                                     |
|  ...                                  |
|  Shift: [0]                           |
+---------------------------------------+
+---------------------------------------+
|B:                                     |
|  ...                                  |
|  Value: [N]                           |
+---------------------------------------+




I hope this guide helps you to build your strategy.

S.B.T.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    ExpertAdvisorBuilder Forum Index -> ExpertAdvisorBuilder Forum All times are GMT + 9 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group