New EA based on the !xMeter - page 44

 
basza:
Thanks fate.

I'll do a fresh install during the weekend then let it run for a week unused. We'll see where we go from there.

Thanks

Basza

Well like I said before, this is what I do:

1. attach it to the chart,

2. check the Experts for Zero Divide message,

3. right click on the chart and select refresh,

4. click on the smiley face, with or without doing anything, then click ok to basically reload the EA...

5. You will see the data packets on steroids and start to download, you know the green/red histogram on the lower right corner with data count like 4566/18 kb? that will start to move.

6. wait a few seconds, check the Experts tab for Zero Divide message... if you get Zero Divide again, just repeat step 3 and 4 until there are no more zero divide messages... you don't need to wait for a few days or open every single chart or go download history.

I have done this on over 50 demo accounts, although my broker only has 28 pairs, I had a few instances that I have to repeat the procedure twice at the beginning, but once it is done, you never have to do it again... If your broker has more pairs, then you may get zero divide messages and have to repeat the steps a few more times... However, you an also take out currencies that you don't trade.

Sometimes the Zero divide will hit you right away, sometimes a few minutes later. So set it up, check in a couple of minutes, and once you don't get it for more than 15 minutes, you should be fine.

neo1001

 

Sounds like a good solution, I'll try it with the next account I setup.

Edit:

Btw do you need to tweak the settings over time?

I guess correlation between currency symbols does not really change ?

 
neo1001:
On the ManageBuy and ManageSell section, the condition was:

if ((1 - (AccountFreeMarginCheck(symb, OP_SELL, lt) / (AccountBalance() + AccountCredit())) * 100 > MaxUsedMargin) //Do not open new cycle of trades if current trades are using more than allowed margin.

return(false);

They should have been:

if ((1 - ((AccountFreeMargin() - AccountFreeMarginCheck(symb, OP_SELL, lt) + AccountMargin())/ (AccountBalance() + AccountCredit())) * 100 < MaxUsedMargin) //Do not open new cycle of trades if current trades are using more than allowed margin.

return(false);

As I believe the original version only checks what's the free margin left after you OPEN a new position instead of considering already opened positions, thus adding the AccountFreeMargin - AccountFreeMarginCheck will get the margin required for the new order, and add to the existing margin (+ AccountMargin) we get the total margin to compare with MaxUsedMargin.

Thank you neo,

first: you have extra "(", which is the wronge "(" ?

Second: Pay attention that there are two code lines to be changed.

Third, to solve the zero divide just do:

if(aRange != 0)

aRatio = (aAsk - aLow) / aRange / point; //--- Calculate pair's ratio and inverse ratio

and:

if(bRange != 0)

bRatio = (bAsk - bLow) / bRange / point; //--- Calculate pair's ratio and inverse ratio

 
neo1001:
Well like I said before, this is what I do:

1. attach it to the chart,

2. check the Experts for Zero Divide message,

3. right click on the chart and select refresh,

4. click on the smiley face, with or without doing anything, then click ok to basically reload the EA...

5. You will see the data packets on steroids and start to download, you know the green/red histogram on the lower right corner with data count like 4566/18 kb? that will start to move.

6. wait a few seconds, check the Experts tab for Zero Divide message... if you get Zero Divide again, just repeat step 3 and 4 until there are no more zero divide messages... you don't need to wait for a few days or open every single chart or go download history.

I have done this on over 50 demo accounts, although my broker only has 28 pairs, I had a few instances that I have to repeat the procedure twice at the beginning, but once it is done, you never have to do it again... If your broker has more pairs, then you may get zero divide messages and have to repeat the steps a few more times... However, you an also take out currencies that you don't trade.

Sometimes the Zero divide will hit you right away, sometimes a few minutes later. So set it up, check in a couple of minutes, and once you don't get it for more than 15 minutes, you should be fine.

neo1001

Nice instructions

 
fate:
Sounds like a good solution, I'll try it with the next account I setup.

Edit:

Btw do you need to tweak the settings over time?

I guess correlation between currency symbols does not really change ?

Correlation calculation is automatic and runs at least every minute so You don't have to change anything because of correlation. The other settings might be changed but so far they seem to be OK.

 
crossy:
Thank you neo,

first: you have extra "(", which is the wronge "(" ?

Second: Pay attention that there are two code lines to be changed.

Third, to solve the zero divide just do:

if(aRange != 0)

aRatio = (aAsk - aLow) / aRange / point; //--- Calculate pair's ratio and inverse ratio

and:

if(bRange != 0)

bRatio = (bAsk - bLow) / bRange / point; //--- Calculate pair's ratio and inverse ratio

I see You insist to that extra condition maybe someone willing to sacrifice some time setting up a few demo accounts can prove if that extra 2 lines solve the zero divide error. But if it does it might cause bad trades due to insufficient history data I guess... I'd rather see the EA stop working instead of entering trades with insufficient input...

And to the margin calcuation: remember that the margin limit setting is intended to provide enough space for recovery positions and not to suspend all trades! If you change it the whole behaviour of xMeter might drastically change.

 
venox250:
I see You insist to that extra condition maybe someone willing to sacrifice some time setting up a few demo accounts can prove if that extra 2 lines solve the zero divide error. But if it does it might cause bad trades due to insufficient history data I guess... I'd rather see the EA stop working instead of entering trades with insufficient input... And to the margin calcuation: remember that the margin limit setting is intended to provide enough space for recovery positions and not to suspend all trades! If you change it the whole behaviour of xMeter might drastically change.

Hi Venox,

I think that we have to solve the zero divide, and your remarks are well right, so just let us fix it.

 

Venox250:

This is what I've noticed after running this EA for a few weeks now. The majority of positive trades are because of the Grid average. I think straight winning trades account for only 30% or so, but the reasons why Grid average works so well also has to do with the overall trend of the market, and the meter gets credit for being able to determine the trend using the 84 hours lookback.

But every now and then, when the trend changes, like the EURUSD last week and GBPUSD this week, then we get caught in a grid average nightmare with progressive lot sizes... of course if the market comes back, we will get out breaking even, but the issue is actually deeper than just have enough margin to handle the drawdown, but also missing out on the potentially profitable trades...

To take a step further, the correlationfilter now is detrimental in grid averaging mode, as EA ignores any potential trades that could act as a hetero-hedge...

And there is always that inevitable fear of being margined out on a crazy market condition, such as what we saw with GBPJPY in 2009 on a 1000 pips drop in under 1 hour...

So I guess I wanted to see if you or anyone else could offer some solution to this. Also just on the subject, I've noticed that trades are usually entered at the top or bottom of the range expecting breakout... I guess that's when the meter shows enough difference to fire the trigger... but I think it is a bit lagging and could use some improvements...

Thanks,

neo1001

 
neo1001:
Venox250:

This is what I've noticed after running this EA for a few weeks now. The majority of positive trades are because of the Grid average. I think straight winning trades account for only 30% or so, but the reasons why Grid average works so well also has to do with the overall trend of the market, and the meter gets credit for being able to determine the trend using the 84 hours lookback.

But every now and then, when the trend changes, like the EURUSD last week and GBPUSD this week, then we get caught in a grid average nightmare with progressive lot sizes... of course if the market comes back, we will get out breaking even, but the issue is actually deeper than just have enough margin to handle the drawdown, but also missing out on the potentially profitable trades...

To take a step further, the correlationfilter now is detrimental in grid averaging mode, as EA ignores any potential trades that could act as a hetero-hedge...

And there is always that inevitable fear of being margined out on a crazy market condition, such as what we saw with GBPJPY in 2009 on a 1000 pips drop in under 1 hour...

So I guess I wanted to see if you or anyone else could offer some solution to this. Also just on the subject, I've noticed that trades are usually entered at the top or bottom of the range expecting breakout... I guess that's when the meter shows enough difference to fire the trigger... but I think it is a bit lagging and could use some improvements...

Thanks,

neo1001

You are right: xMeter has about 30% success rate (hit TP without recovery), and TP or trailing stop hit is around 60%.

Correlation filter does allow hedging. It disallows entering the same trades on different pairs (for example: having an NZDJPY buy won't allow opening AUDJPY buy but will allow AUDJPY sell if swap mode filter allows this direction which is exactly hedging).

 

30% winning rate isn't very good, is it?

Reason: