int CurrentLotSize = CurrentLotSize();
Lot sizes are normally doubles
switch( CurrentLotSize)
You must use an integer value as the switch expression.
Yes, all the checked case values are integers, but it doesn't make any sense considering what you are trying to achieve.
I want my EA to to close orders partial. i.e when the EA has placed an order with 1.6lots, if the EA is in profit, and i have achieved 0.8lots profit then it should close 0.8 lots.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys, I wonder if someone can help here.
I want my EA to to close orders partial. i.e when the EA has placed an order with 1.6lots, if the EA is in profit, and i have achieved 0.8lots profit then it should close 0.8 lots.
Below is my code.
First part shows my partial close functions - I cant see anything wrong in here
Second part shows where i look for existing order for the same magic number and get the lot value which will can feed to my switch
Third is my switch... Not sure what is missing because i think i have everything but.....