Coding help - page 486

 
xtractalpha:
Thanks for your fast response!

I've deleted the lines, but the EA is still opening trades with the wrong lotsize.

It's really strange why the EA is ignoring my Martingale code. Because the EA is only opening trades with lotsize 0.10 or 0.20.... (see the picture).

Screenshot by Lightshot

I think my lotsizecalc function has to be the problem. I want the function to multiply my lotsize by the martingale amount when I lose a trade.

My martingaleamount is 1.5 and my lotsize is 0.10 . This means when I lose 5 trades in a row the lotsizes will be : 0.1 , 0.15 , 0.22 , 0.34 , 0.51 .

double LotsizeCalc() { if(lastOrderProfit()<0 && tradeNumber <=MaximumTrades) { tradeNumber++; malot=OrderLots()*MartingaleAmount; } else { malot = LotSize; tradeNumber=1; } return(malot); }

Could anyone check this code?

Thanks in advance,

Thierry

Change also line 121 to be : tradeNumber=0;

This is what I got as results in that case :

As you can see, when those changes are made, it seems to be OK

Will check some more, but not today

Files:
res.gif  35 kb
 

Hi guy, The attached expert compiles, but has 14 warnings, could you work your magic once more?

Take care

Files:
 

helptoimprovethis indicator

Can someone fix this indicator to work on the latest version of the MetaTrader ...thanks

 
Jeeves:
Hi guy, The attached expert compiles, but has 14 warnings, could you work your magic once more? Take care

Jeeves

Here you go : manualordermanager_v7_nmc.mq4

 
privasi:
helptoimprovethis indicator Can someone fix this indicator to work on the latest version of the MetaTrader ...thanks

privasi

New mt4 compatible version of macd was posted here : https://www.mql5.com/en/forum/183798/page121

 
privasi:
helptoimprovethis indicator Can someone fix this indicator to work on the latest version of the MetaTrader ...thanks

Just some help from my side too

Multi-purpose trade manager has only compiler warnings. It should work

 
mladen:
Change also line 121 to be : tradeNumber=0;

This is what I got as results in that case :

As you can see, when those changes are made, it seems to be OK

Will check some more, but not today

THANKS for your response....It's unbelievable that awesome people like you are on this forum!

Anyways.... I've edited the line, like you suggested. For some reason my EA won't multiply the lotsize for a second time. (look at this: Screenshot by Lightshot )

If I use 0.10 as start lotsize and 2 as multiplier. The EA won't multiply the lotsize for the second time. But on yours it's working correctly, what could it be... I've tried it with Citibanks MT4 platform and with FXCM MT4, but both don't work.

Does anyone know what could be the problem?

Thanks,

Thierry

test_martingale.mq4

Files:
 
mladen:
Jeeves Here you go : manualordermanager_v7_nmc.mq4

Many thank....another one I owe you!

 
xtractalpha:
THANKS for your response....It's unbelievable that awesome people like you are on this forum!

Anyways.... I've edited the line, like you suggested. For some reason my EA won't multiply the lotsize for a second time.

If I use 0.10 as start lotsize and 2 as multiplier. The EA won't multiply the lotsize for the second time. But on yours it's working correctly, what could it be... I've tried it with Citibanks MT4 platform and with FXCM MT4, but both don't work.

Does anyone know what could be the problem?

Thanks,

Thierry

test_martingale.mq4

you have to select and return the lots from the history select function ( lastOrderProfit() ) too, same way like you do with "lastProfit".

ProFXManager

 
xtractalpha:
THANKS for your response....It's unbelievable that awesome people like you are on this forum!

Anyways.... I've edited the line, like you suggested. For some reason my EA won't multiply the lotsize for a second time. (look at this: Screenshot by Lightshot )

If I use 0.10 as start lotsize and 2 as multiplier. The EA won't multiply the lotsize for the second time. But on yours it's working correctly, what could it be... I've tried it with Citibanks MT4 platform and with FXCM MT4, but both don't work.

Does anyone know what could be the problem?

Thanks,

Thierry

test_martingale.mq4

You will have to make the way how you determine the last order lots differently

_________________

The problem is the following : when you call that LotsizeCalc() function and the new order is opened , then there s no problem. But if for some reason the order fails to be opened, your "tradeNumber" remains increased even though the order was not opened.

Better to simply count the number of currently opened orders of certain type and use that numbers instead of "tradeNumber" (that way, even in cases when you restart the EA, the EA will work correctly - if you use some variable value, it will work wrong if you restart the EA)