Seems you have a netting account ?
For some unknown reason this function only works with an hedging account. For a netting account just Buy or Sell the requested volume to close in opposite direction of your position.
I must have replied the wrong way as I do not see my comment...
Thanks so much for your response and advice. I never heard of this kind of hedging and netting before. I have not tried any Forex before.
But then I found out that AMP Futures does not allow US residents to trade Forex. SO I was trying to get my EA to work with Futures.
This may be why they have my account as netting.
I will certainly try your suggestion, thanks

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
I want to use PositionClosePartial to cut my position in half when it gets to a scalp profit.
But the PositionClosePartial call always returns false. It does not change the volume.
When I check the retCode it is 10009 which I believe means success. Something is not right.
I added a few debug statements to trade.mqh to see where it is returning "false"; It is the IsHedging check right at the start of the function. I don't know what that is.
The EA is not stopped. I don't know why it is doing this.
Has anyone seen this before?
I can post a small generic EA that shows it doing this. It would be interesting to know if it has the error for anyone else or is just me.