You are not checking if a trade is already being partially closed.
You have used 'riskFreeDone' but you have not inizialized it. Also it's a single variable, if you have multiple trades it will not work.
Usually on MT4, a common way to check if a trade is already partially closed, is to check if in the comment there is the # symbol. (Do the partial close if StringFind return -1)
MT4 already change comment to partially closed trades adding #from with the old ticket number. But be aware that this can be different on some brokers and also not supposed to be 100% consistent. Anyway, personally, using this approach I never had problem.
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
Module code:
Result log:
Please help me