Partial TP
-
Hello Coders,
I tried to use the "close (psrtially)". There I have a problem.
For example: open position 0.33 lots - close 50% = 0.165 lots to close
In this case I am getting an error because 0.165 lots cant be traded.
How can I round the lot size?
Best regards,
Martin -
I think you are asking how Not to round the lot size, but I am afraid this is impossible, because there is something called Lot Step and means that there is a minimum step for the lot sizes. If the lot step is 0.01, then you can trade 0.16 or 0.17, but not 0.165.
-
Hello FXDreema,
I had an older version of an ea made by FXDreema. It worked fine.
For example: close (partially) = 50% - position 0.33 lots - close 0.17 lots and still open position 0.16 lots
After a new compiling it works in a differend way - it tries to close 0.165 lots and this is impossible because of the lot step.
Have you changed something..... maybe an update?
I will change it and dont use the close (partially) box.
Maybe you can take a look at this.
Best regards,
Martin -
I made this: https://fxdreema.com/shared/lkWMP1hAd
And this is the result for me:
What are you working at - MT4 or MT5? Can you give me similar simple example that can show me the problem on my MT?
-
Hello FXDreema,
thank you for your message. I am working with MT5 netting mode.

I took your example and have the same problem. It opens 0.33 lots ...... tries to close 0.165 lots...... after opening additional 0.33 lots it can close 0.33 lots.
Best regards,
Martin -
What is the volume step for this symbol?
-
Hi,
the step is 0.01 but the box calculates 0.001.
I have found a solution. I calculate the right lot size and close the order separatelly.
Best regards,
Martin -
Well, the EA is programmed to see the lot step and round the number if needed. I don't even remember someone with this problem before. I wonder why it happens to you
-
I`m facing the same issue as described here .
could you help me with this?
@fxDreema said "the EA is programmed to see the lot step". I'm working with several instruments as Forex Pais, Comoddities and index...
Some lot step are 0.10, another 0.50....
And I'm getting a lot of "Invalid volume" while partial close.
And the parcial close % depends of each instrument. Some are 50%, others 65%. Others 88%.
I mean...I need to find a way to get this partial close working.Could you please help me?
Thank you so much!
-
Hi,
I solved the problem with an own calculation of the lot size to close.
Use Cusom mql code: mathround
Best regards,
Martin -
@martin-1 Great, Martin!
Please, could you share an example using mathround code?
Thank you so much!