Topic: Exporting a strategy as an Expert Advisor

Quick start:

There are three simple steps to do to make the Expert Advisor running on your MetaTrader.

  1. Set the export destination in Control Panel -> Expert Advisor page.
  2. Export the strategy by using the Export button on the toolbar.
  3. Refresh the EA list in your MT terminal and run the Expert.

Details:

  1. Export destination: Forex Strategy Builder saves the generated Expert Advisor to preset destinations. You can set them in the Control Panel -> Expert Advisor page. You have to do that only once. There are two other options on that page: overriding an existing expert and saving the new expert with a suffix. See more help on User Guide here: Expert Advisor.


  2. Exporting a strategy: There are two options – exporting an EA and Save As an EA. When you are using the first command, FSB exports an EA with the name of the strategy to the destinations specified in the Control Panel. It may override the previous expert, if you have the “override: option on. The “Save As EA” command allows you to choose the exporting destination and the EA name. It is useful when you want to save the export for uploading on a VPS or when you want to make an archive copy.

http://forexsb.com/wiki/_media/fsbpro_guide/export_expert_advisor.png


  3. Once the Expert is exported, you have to Refresh the MT expert’s list.

http://forexsb.com/wiki/_media/fsbpro_guide/refresh_mt_experts.png

See more information on this guide: Export Expert Advisor

Re: Exporting a strategy as an Expert Advisor

After messing up initially lol, I have made a few of these..... and if the directions are followed it is a simple procedure.

Thanks very much. 

I am pretty sure this will allow a person to run far more strategies on one MT4

My 'secret' goal is to push EA Studio until I can net 3000 pips per day....

Re: Exporting a strategy as an Expert Advisor

Please report any issues you may encounter.

The best part is that I can update the MQL code even without updating the program.

(I'm going to publish an update to both in several hours smile since I managed to fix some minor issues)

Happy trading!

Re: Exporting a strategy as an Expert Advisor

I suppose exporting a strategy as an EA the minimum bars in the chart will be the bars on MT4?

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

mathimatikos wrote:

I suppose exporting a strategy as an EA the minimum bars in the chart will be the bars on MT4?

Each indicator has its own requirements when it comes to number of bars on the chart. By default the EAs exported from FSB, demand MT to load 1000 bars. This should work well with most indicators.

You can set that option like it is mentioned here Expert Advisor Options -> 3. Expert Options -> Maximum Data Bars

Re: Exporting a strategy as an Expert Advisor

I have used it a few times.... not noticing many  issues so far, works well!

My 'secret' goal is to push EA Studio until I can net 3000 pips per day....

Re: Exporting a strategy as an Expert Advisor

When somebody uses the FSB for trading, the connection ID is visible on the Chart at the left corner
under the trading pair name like this:
   USDDKK M30
( ID = 2015 )

Is there a way for me to add a comment on the same place when I use the same strategy exported
as an EA?
This would help me to recognize my strategy at once.
for exampe:
   USDDKK M30
( 2015 )

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

This would help me to recognize my strategy at once.

Excellent idea. I'll see if adding a comment to the strategy is practical.

Re: Exporting a strategy as an Expert Advisor

Let us suppose that somebody has exported a strategy as en EA.
After this does it required any additional action for MT4 like indicators istallation or something else?
In other words I ask if the exported EA is an autonomus unit under the MT4 and only needs the historical data from MT4?
In other words I ask as a user if it is required from me anything else except the EA installation?

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

After this does it required any additional action for MT4 like indicators installation or something else?

No additional actions required!!

The exported EA is a single file that contains all the necessary components. However, it uses several standard MT libraries that comes with MT by default. The EA includes all the necessary indicators.

Re: Exporting a strategy as an Expert Advisor

Thank you very much.
This makes it very simple for me as a user.

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

12 (edited by mathimatikos 2015-01-11 18:07:00)

Re: Exporting a strategy as an Expert Advisor

Is there a way to save all my generated strategies with one step?
In other words is there any option like "select all"?

Also is there any shortcut for the exporting options to eliminate
the mouce use like "ctrl+e" for example?

In the past I used a program that allowed me to choose the shortcuts
of its functions from a wide list. I could define a shortcut or not according
my needs and my skills. For example a lefthand could define different
shortcuts than a righthand etc...
So the shortcuts were not static but they could be edited by the user.
I found it helpful.

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

In other words is there any option like "select all"?

No, but I wrote a procedure for you:

public void ExportAllStratgeies()
{
    int number = OpenAllStrategiesInFSB();
    
    for (int i=0; i<number; i++)
    {
        SelectStrategy(i);
        ExportStrategy(i);
        CloseStrategy(i);
    }
    
    Console.WriteLine("Ready, {0} strategies exported", number+1);
}

Re: Exporting a strategy as an Expert Advisor

Thank you very much.
Your immediate respond is a great honor for me.

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

15 (edited by mathimatikos 2015-01-11 21:53:48)

Re: Exporting a strategy as an Expert Advisor

I noticed that strategies which contain the following indicators have problem when exported as EAs:
   Starc Bands:  each strategy that has it looks like it is compiled, loads but does not respond.
   Trix MA Oscillator: each strategy that has it cannot be compiled at all and cannot load.

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

Thank you for the reports. The bugs are fixed in FSB Pro v2.3.

17 (edited by mathimatikos 2015-01-12 12:07:14)

Re: Exporting a strategy as an Expert Advisor

Is there any trick to presend the intalled EAs on a list from an MT4 function?
For example in the past I checked my installed strategies from MT4
following the path Tools
                            Global Variables

And there I could check the ID Connections
( The ID connections had "clever" names so I could check the installed
strategies easily).

Is there a way to find out if an EA works properly or not?
In the past the FST was dissconnected or could not connect and thus
I was informed that something was wrong.
Also useful would be if I could have a list with Magic Numbers too.
(I suppose that Magic Numbers is your trick).

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

Popov wrote:

Thank you for the reports. The bugs are fixed in FSB Pro v2.3.


The problem stil persists.
Now all the strategies can be compiled but then they cannot load.
In other words for me as a user there was not any improvement about starc bands.
About the Trix MA Oscillator something has been fixed but the strategies cannot load.

Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

I cannot do anything more without a strategy.

Post a strategy and I'll debug it.

20 (edited by mathimatikos 2015-01-12 21:23:33)

Re: Exporting a strategy as an Expert Advisor

Popov wrote:

I cannot do anything more without a strategy.

Post a strategy and I'll debug it.

This is the simplest strategy that does not load about Starc Bands.
I tested again the Trix MA Os by the same simple strategy and now it loads.
I test each suspected indicator by the same way to make it clear if it has problem or not.

Post's attachments

Starc Bands Test EA.zip 40.94 kb, 10 downloads since 2015-01-12 

You don't have the permssions to download the attachments of this post.
Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

You are right, it seams I missed to include the fixed Starc Bands indicator in the latest update.

Thank you for the report!

I updated the MQL code to v7. Restart FSB Pro in order to receive the new files.

Report any issues you may encounter.

22 (edited by mathimatikos 2015-01-16 13:31:35)

Re: Exporting a strategy as an Expert Advisor

Dear Mr Popov
    I tested the Indicator Enter Once to exported strategies as EA and these are my results:

    The MT4 forgets prior trades after restarting when the trades are opened before restart
    and closed before restart AND TRADES AGAIN.
   
    The MT4 remembers prior trades after restarting when the trades open before restart,
     stay open during closing MT4 and remain open after restard.

    I tested these strategies to M5 Graphs on MT4 and the results are:

1) The Enter Once a Month does not trade at all.
2) The Enter Once a Day trades sometimes but forgets after a restart of the MT4 prior trades and trades again.
3) The Enter Once a Week trades but forgets after a restart of the MT4 prior trades and trades again.
4) The Enter Once a Bar trades but forgets after a restart of the MT4 prior trades and trades again.

I am sending you a zip with the strategies and the exported EAs for inspecting.

Kind Regards
  Mathimatikos.

Post's attachments

Test Strategies Enter Once.zip 158.41 kb, 8 downloads since 2015-01-16 

You don't have the permssions to download the attachments of this post.
Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

"Enter Once" indicator uses a local variable to store the time of the last entry. The expert zeroes it on a restart. The same is valid when trading with the bridge.

24 (edited by mathimatikos 2015-02-09 19:29:26)

Re: Exporting a strategy as an Expert Advisor

Dear Mr Popov
  The Indicator "Previous Bar Opening"
does not work when it is exported as EA.
I have tested all available options via EA and via the Bridge simultaneously.
The Strategies worked perfect via the Bridge but no exported EA opened even a single position.
I am sending you as attachment  the strategies which I used for the test.

Post's attachments

Previous Bar Opening.zip 157.37 kb, 11 downloads since 2015-02-09 

You don't have the permssions to download the attachments of this post.
Νοῦς ὁρᾶ καί νοῦς ἀκούει.

Re: Exporting a strategy as an Expert Advisor

I am sending you as attachment  the strategies which I used for the test.

Thank you. I'm busy for the next two days, but I'll tray to fix it as fast as possible.