Top Expert Advisors

1. FapTurbo

Read Review
Download Now
  • Scalper EA
  • 92% Win Ratio
  • Extra Low Drawdown

                                                   

2. SharkEA

Read Review
Download Now

  • 80% win ration from 1999 to 2007
  • 2% Drawdown
  • Handles volatile Markets

                                                   

3. Forex Automoney

Read Review
Download Now

  • Advanced Correlation Formula
  • 7.5% Monthly Gains
  • Advanced Money Management

                                                   

4. LMT Formula 

Read Review
Download Now

  • Trading Strategy (not a robot)
  • 10-15 minutes for a winning trade
  • Free bonus nightly webinars

                                                   

5. Forex Shogun

Forex Shogun Review
Download Now

  • GBP\JPY Robot
  • SL:TP ratio of 1 to 2
  • Anti-Loss Feature

 

                                                   

6. Tsubot

Tsubot Review
Download Now

  • Automated Stock Trading
  • Trade Bonds, Forex, Stocks

 

 

 

Powered by web hosting of pa

Lesson 05 - Creating an Expert Advisor

In this article we are going to create our own Expert Advisor from scratch.

There are two initial steps involved:

Step1:

If you haven’t opened up your MetaEditor yet then now is the time. MetaEditor can be opened from your Start Menu or from within the Metatrader Client Terminal itself.

Once inside the MetaEditor application click File->New.

This will cause a new program wizard to appear, choose “Expert Advisor program”.

Now press the Next button.

Step2:

Now you should have the general properties wizard.

This wizard lets you set the properties of your Expert Advisor and control the external

variables you will use from within your expert advisor.

In this step you can set the following properties:

1- Name – The name of your expert advisor, in this sample we will use My_Own_EA.

2- Author – The name of the author of the program, you can type your name.

3- Link – A link to your web site if you have one.

4- External variables list:

This is the list of the variables you allow the trader who uses the expert advisor to control them from the Expert properties window.

If you want to add a new variable you need to click the Add button, clicking it will add a new variable to the external variables list. 

You should notice that every record has three fields:

Name: this is the identifier of the variable.

Type: this is the data type of the variable.

Initial value: this is the initial value the variable has.

This field is not mandatory and you can leave without giving it a value.

In the sample we are presenting there are three variables:

Variable Type Initial Value
TakeProfit double 220
Lots double 0.2
TrailingStop double 45

Now you need to press the Finish button to close the wizard. The MetaEditor automatically creates and saves the file My_Own_EA.mq4 in the MetaTrader 4\experts path.

Note: you have to put the expert advisors in MetaTrader 4\experts path and the indicators in MetaTrader 4\experts\indicators path, otherwise they will not work.

This is the code we have got from the wizard:

//+------------------------------------------------------------------+

//| My_Own_EA.mq4 |

//| Expert Advisor Metatrader |

//| http://www.ExpertAdvisorMetatrader.com |

//+------------------------------------------------------------------+

#property copyright "Expert Advisor Metatrader"

#property link "http://www.ExpertAdvisorMetatrader.com"

//---- input parameters

extern double TakeProfit=220.0;

extern double Lots=0.2;

extern double TrailingStop=45.0;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

As you see above, the code generated by the wizard is a template for you to add your code without bothering you by typing the main functions from scratch.

The Start Function is the function that is called each time there is new information (every tick).

This is where you need to implement your strategy. 

 

Tell a Friend