Partial close orders
micobez:
I am working for same code, Haven't you solved it.. I have one code that closes everything. Irrespective of trade symbols.
Code is meant to close 50% of trades at 50% profit level, however it closes everything instead. Is it possible to filter out closing by volume amount.
Aka, if(volume=0.02) then close partial
if(_Symbol==symbol) { ulong Ticket = PositionGetInteger(POSITION_TICKET); double sl = PositionGetDouble(POSITION_SL); double tp = PositionGetDouble(POSITION_TP); double price = PositionGetDouble(POSITION_PRICE_OPEN); double volume = Position //buy if(tp>sl){ if( trade.ResultVolume()==0.02){
What is “trade” and how does it know what position you have currently selected?
Code is meant to close 50% of trades at 50% profit level, however it closes everything instead. Is it possible to filter out closing by volume amount.
Aka, if(volume=0.02) then close partial