forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Portfolio Expert → Lining up Strategy ID with MQL file / Magic Number

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 5

Topic: Lining up Strategy ID with MQL file / Magic Number

Hello

I like to confirm my strategies with a backtest in MT4 and want to then remove any that don't perform from my Portfolio EA.  If I find a strategy in MT4 based on a magic number that I want to remove, how do I easily identify that strategy in the json file within EA Studio?

Re: Lining up Strategy ID with MQL file / Magic Number

1. You can load your Portfolio Expert in EA Studio and recalculate it with the newer data.
Then remove the strategies you don't like and export the Portfolio again.

2. You can remove the strategies from the code.
The strategies are set in the "SetSignals" function and look like that:

   /*STRATEGY CODE {"properties":{"entryLots":0.1,"tradeDirectionMode":0,"oppositeEntrySignal":0, ... */
   signalList[i++] = GetExitSignal_039();
   signalList[i++] = GetEntrySignal_039();

   /*STRATEGY CODE {"properties":{"entryLots":0.1,"tradeDirectionMode":0,"oppositeEntrySignal":0, ... */
   signalList[i++] = GetExitSignal_040();
   signalList[i++] = GetEntrySignal_040();

   /*STRATEGY CODE {"properties":{"entryLots":0.1,"tradeDirectionMode":0,"oppositeEntrySignal":0, .. */
   signalList[i++] = GetExitSignal_041();
   signalList[i++] = GetEntrySignal_041();

Important: The index in the code is equal to the magic number index - 1.
If you want to delete the strategy with a magic number 100000040, delete the /*STRATEGY CODE line and the functions with index 39:

   /*STRATEGY CODE {"properties":{"entryLots":0.1,"tradeDirectionMode":0,"oppositeEntrySignal":0, ... */
   signalList[i++] = GetExitSignal_039();
   signalList[i++] = GetEntrySignal_039();

EA Studio imports a strategy by its "/* STRATEGY CODE". If you delete this line from the MQL file, the strategy will not be imported.

I'm thinking of a simple editor that will do it easier.

Re: Lining up Strategy ID with MQL file / Magic Number

Thanks, however how I'm not sure that this helps me.  If I backtest a Portfolio EA, I don't know which of the EAs are performing well and which are not performing as expected.  So I have been individually testing each EA, and only keeping the ones that backtest well.  However I'm not sure how I can then go back into Expert Advisor Studio and easily identify which strategies I need to delete in order to finalise and export my Portfolio EA.

Re: Lining up Strategy ID with MQL file / Magic Number

Nevermind, I think I found a solution.  I can import the strategies back one-by-one and recreate my Portfolio from there.

Re: Lining up Strategy ID with MQL file / Magic Number

I'm testing a new parameter in Express Generator - "start-trade".
It allows us to set the program to trade from a specified date or a number of days.
For example, we can filter the strategies by their performance for the last two weeks by setting "--start-trade -7".

This helps a lot.
I'll also add a similar option in EA Studio. However, I have to figure out small details first.

Posts: 5

Pages 1

You must login or register to post a reply

Forex Software → Portfolio Expert → Lining up Strategy ID with MQL file / Magic Number

Similar topics in this forum