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?
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
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