MT5 Martingal EA error, I need help.

 

I made this EA with a friend, a classic MArintagal EA buy, selll, buy, sell etc. But from unknown reason when I set FixLot and DoMartingale is not doubling, only in first few trades and after that... not. Some time keeps 2 trades open, when it should be only one opened once and after is closed, other one in opposite direction should be open.


We tried to solve this error for some time now. Can anyone help us with this?

 
I took a quick look into your code, especially the part where the position volume is calculated. For your first problem: in those situations where the lot size isn't doubling, did you check the return value of the functions MaxBullAllowed() / MaxBearAllowed() ? Is it maybe because of margin limitations that those functions forbid doubling?
 
Can you make this change in EA? If you think you can make it work the good way, please do the change in the code, please. What you think will make it work well.
 
ovidiubenone:
Can you make this change in EA? If you think you can make it work the good way, please do the change in the code, please. What you think will make it work well.

I can but I won't. We all can help each other to become better programmers, but this is a little different.

(1) I don't even know if it's your own code and not something you copied on the internet (I may be wrong, just a feeling... + 3 arguments for reasonable doubt come to my mind)

(2) This is what the freelance section is for.

Reason: