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
Last question, is Normalizing the price doubles actually that crucial... I don't understand the purpose of it...?
Yes it can be an issue with doubles, OrderTakeProfit() OrderStopLoss() OrderLots() especially if you do calculations on them. It affected one of my EA's when I was doing something similar to your part closing of orders. Take a look at this thread https://www.mql5.com/en/forum/141034
I have tried rattling my brain but I cannot get the logic down to do it via the OrderTicket() on the "OP_BUY" as soon as it is triggered, and to the OrderTicket() number on the remaining position after half is closed?
Once the OP_BUY has been halved at OrderClose() the remaining position has a different ticket number... Can someone please enlighten me how I compare the two so that I can tell the OrderClose() to stop after is has done it once?
I have it all mint and set - Just don't understand the logic in comparing what I've written above.
I intend on making a thread to help others after I have completed this - would only be fair!
I already told you how to do that, get the OrderOpenTime() of the ticket you are about to part close.. After you part closed it do OrderSelect() again whichever ticket has that same OrderOpenTime() is the remaining part of the part closed order.
Ah yea - Sorry, must have missed that the first time!
I've just sat and had a thought about that, and I am finding it hard to understand the logic in it? Could you give me a pointer?
At the moment I have this within the "int Start()" section:
Obviously I need to remove the "OrderOpenPrice() > OrderStopLoss()) part, but what am I replacing it with so that the "CloseHalfOrder();" will NOT be called continously? I can't get the logic down (little slow today!) Am I comparing with the trade closed in history?...
Ah yea - Sorry, must have missed that the first time!
I've just sat and had a thought about that, and I am finding it hard to understand the logic in it? Could you give me a pointer?
At the moment I have this within the "int Start()" section:
Obviously I need to remove the "OrderOpenPrice() > OrderStopLoss()) part, but what am I replacing it with so that the "CloseHalfOrder();" will NOT be called continously? I can't get the logic down (little slow today!) Am I comparing with the trade closed in history?...
At the point I have marked in your code what Order do you have selected ?
is it the correct Order ? if it is the correct Order is that by chance or design ?
I can't think of how to use OrderOpenTime() to my advantage and stop CloseHalfOrder being called every time...
I thought that too - It says I need OrderSelect() before using OrderType, but it works? I only ever have one order open at any given time...