Backtesting/Optimization - page 62

 

Here it is. It uses your preset file.

What exactly settings you do optimize???

 
stace:
Here it is. It uses your preset file. What exactly settings you do optimize???

I attached the Optimizable Variables for long trades only below

30% profit(6months!!!) while only risking 5% is not bad at all.

Files:
long_opti.set  6 kb
 
GeorgeL:
I attached the Optimizable Variables for long trades only below 30% profit(6months!!!) while only risking 5% is not bad at all.

For me is very small amount.

Thanks I will optimize also.

 
stace:
For me is very small amount. Thanks I will optimize also.

Optimize for your current broker it might be alot better.

What EA's do you use on your current account?

 
GeorgeL:
Optimize for your current broker it might be alot better. What EA's do you use on your current account?

I use usually martingale based ea's.

On my stats it is stochastic + adx + atr and the last one is martingale.

 
leeb:
One possibility would be to have one version running on IBFX and in properties of EA allow long only and another copy of EA running on another broker or IBFX and allow only short trades - a pain I know but these NFA new regulations are just that...

I agree with leeb. This EA controls open positions with it's existing code. I added what I think are correct comments to show where the settings are...

//------------------------------------------------------------------//

int HM_ALL = 2; // Maximum number of open trades

int Trade = 1; //

//------------------------------------------------------------------//

extern bool Trd_Up_X = true; // Allow trading UP

int HM_Up_X = 1; // How Many Buys to allow open

//------------------------------------------------------------------//

extern double tpx = 50;

extern double slx = 50;

extern int px = 10;

extern int x1 = 0;

extern int x2 = 0;

extern int x3 = 0;

extern int x4 = 0;

int tx = 0;

//------------------------------------------------------------------//

extern bool Trd_Dn_Y = true; // Allow trading DN

int HM_Dn_Y = 1; // How Many Sells to allow open

//------------------------------------------------------------------//

extern double tpy = 50;

extern double sly = 50;

extern int py = 10;

extern int y1 = 0;

extern int y2 = 0;

extern int y3 = 0;

extern int y4 = 0;

int ty = 0;

//------------------------------------------------------------------//

You can either change the maximum number of open trades to 1 or you can control which direction you wish to trade.

Since you will be optimizing often with this EA, you may as well choose the direction of trade at the same time.

If you still need to trade both directions, you may be looking for a broker with a platform that allows you to manage two seperate accounts on one platform. However, this will require two margin balances.

 

Fix Code to Accomodate 5 Digit Brokers

dreamfab:
First position this morning (GMT +1), and I have a question:

I tried to change the code to work with 5 digit brokers, but it's not working...

gdPointFactor = 1;

if (MarketInfo(Symbol(), MODE_DIGITS) == 2 || MarketInfo(Symbol(), MODE_DIGITS) == 4){

gdPointFactor = 10;

if (MarketInfo(Symbol(), MODE_DIGITS) == 5)

{

gdPointFactor = 100;

}

}

Is it correct?

Thank you

You have found the portion of code that has an error, but you have not found the correct solution. The original code that was supposed to handle both 4 and 5 digit accounts follows:

gdPointFactor = 1;

if (MarketInfo(Symbol(), MODE_DIGITS) == 2 || MarketInfo(Symbol(), MODE_DIGITS) == 4){

gdPointFactor = 10;

}

Here, we have (get decimal point factor) gdPointFactor set equal to 1. Using Find to search the code for this variable shows that it's a multiplier used whenever Point is used. For 4 digit accounts, the multiplier should be 1 so that nothing changes in the calculation. However, for 3 and 5 digit accounts, we want to multiply by 10 to get the additional decimal place. Therefore the correct fix is to change the 2 to 3 and change the 4 to 5.

By making it read ==3 and ==5, this EA will still work for you in two weeks when IBFX becomes a 5 digit account. Otherwise you will have to revisit all your manual "corrections" again.

I now notice a very strange difference between the EA and the filter utility. You can see that the initialization function passes the value of gdPointFactor to the filters utility. Also, notice that gdPointFactor was used by the author of the filters utility in all of it's calculations, whereas, the author of the EA did not add this factor to the EA calculations.

Fortunately, all of the Point calculations in this EA are very simple and adaptation to 5 digit account is simple. Using Edit>Replace, cycle through each instance of * Point and replace it with * Point * gdPointFactor.

Answers to other posts follow:

Some of the first responders declared that this EA does not work (even though they know it works for GeorgeL). They may have done what I did by placing the include utility files directly into the include folder like we have always done. However, the RAR file had these utilities in a system_v2 subfolder within the include folder. Probably the author wanted to keep this set together in one group so as to find them easily for editing. This is why the system_v2 (or whatever) subfolder was included in the path statement to these utilities in the EA code.

Whoever had trouble opening the RAR file may enjoy googling for jZip. jZip will unpack your ZIP files and RAR files and just about any other condensed files for free (unlike those others).

Another error some of us made was failure to save the .set file into the experts/presets subfolder. After you have selected this EA in you Stratagy Tester, go the variable settings and find the Load button. Click Load and browse to the presets subfolder and click on the .set file for this EA to load the settings that came with it.

If the EA begins to work but is not profitable for you, your broker may be in a different timezone than the one the EA is set for. If so, you'll have to pay attention to the scheduled time settings in order to have successful trades.

The fact that this EA was set to allow hedging may be the reason it is more successful than other EAs you may have tried. The EA already has settings that allow restriction of trade to one direction at a time or one direction only. With this EA, direction of trade, Stoploss and Takeprofit are all manual settings to be reset frequently as market conditions change. Rather than changing the nature of this EA, time may be better spent asking your broker for solutions availble for using this EA to manage two accounts.

Happy trading to All, and thanks GeorgeL for posting, and thanks to Shooter777 for a great sample to learn from.

 

greetings george

so the EA and 5-16-2009 eu.set on your first post can stiil be used on ibfx and will not go against their new anti-hedging policy ?

if not please post new version ?

 
happyfx:
greetings george

so the EA and 5-16-2009 eu.set on your first post can stiil be used on ibfx and will not go against their new anti-hedging policy ?

if not please post new version ?

You can still use the 16ths Optimization however thats for hedging.

I have made a Long only and Short only Optimization since I will be opening a second account for this EA.

 

Hello! Any way to make this EA work on 5 digits brokers?(adding a 0 to all settings doesn't work) Thank you.

Reason: