There must be an update of LastClosePrice If the partial close is succesful.
Also i assume you are handling single orders ,the ticket changes when you partially close an order.
Also i assume you are handling single orders ,the ticket changes when you partially close an order.
Lorentzos Roussos:
There must be an update of LastClosePrice If the partial close is succesful.
Also i assume you are handling single orders ,the ticket changes when you partially close an order.
There must be an update of LastClosePrice If the partial close is succesful.
Also i assume you are handling single orders ,the ticket changes when you partially close an order.
All open orders are managed from 1 chart. I tried this but unuseful:
double LastClosePrice(){ double LastClose; if(OrderSelect(0,SELECT_BY_POS,MODE_HISTORY)==true){ if(OrderSymbol()==Symbol()){ LastClose=OrderClosePrice(); if(OrderClosePrice()==0){ LastClose=OrderOpenPrice(); } } } return(LastClose); }
NormalizeDouble(OrderLots()*(PartialClose/100),2)
This amount must be between minLot and OrderLots -minlot.if(OrderSelect(0,SELECT_BY_POS,MODE_HISTORY)==true){
If the order is in history, it's closed (or deleted.)
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
Hello coders, I'm trying to implement a partialclose function to my trade manager, but I don't actually know how to make it work as expected.
With this code I get several partial closes at specified ClosePrice, what I need is to partial close at distance from the OpenPrice for first step (this does) and the following steps from the last close.
If someone can help with this, thank you in advance.