danidani82: If I use OrderClose(OrderTicket(), OrderLots(), 0.0, 3.0)
- You need to RTFM
OrderClose(OrderTicket(), OrderLots(), 0.0, 3.0) OrderClose( OrderClose(int ticket, double lots, double price, int slippage, color Color=CLR_NONE)
Bad price, function will always fail. - What are Function return values ? How do I use them ? - MQL4 forum
- I doubt it. POST your code.
Play videoPlease edit your post.
For large amounts of code, attach it.
danidani82:
By the Pepperstone's MT4 I see unusual behavior related to primitive function of MT4 that I summarize by an example
Eg. lot size = 2.3
- OrderLots(): it returns only the integer part of real lot size. -> In this case OrderLots() returns 2
- If I use OrderClose(OrderTicket(), OrderLots(), 0.0, 3.0) so it lets my opened a part of trade related of current ticket left me still 2.3-2.0 = 0.3 lots opened.
- then, if I call the OrderClose() combined to the new Ticket (opportunely selected by OrderSelect(...)), it returns 0.0 even if this Ticket present 0.3 lots.
Someone suggests me any proposal solution?
Thank you in advance
Regards,
Daniele
I don't see how this code would close any part of a trade as price will not be 0.0
More likely that you are assigning the value of OrderLots to an integer variable and using that
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
Eg. lot size = 2.3
- If I use OrderClose(OrderTicket(), OrderLots(), 0.0, 3.0) so it lets my opened a part of trade related of current ticket left me still 2.3-2.0 = 0.3 lots opened.
- then, if I call the OrderClose() combined to the new Ticket (opportunely selected by OrderSelect(...)), it returns 0.0 even if this Ticket present 0.3 lots.
Someone suggests me any proposal solution?
Thank you in advance
Regards,
Daniele