mohsen bahrami:
Hi.
I want to Close a Position by PositionClose(Symbol(),4).
i Define as Below:
#include <Trade\Trade.mqh>
CTrade CT;
CT.PositionClose(Symbol(),4);
although compile has no error, unfortunaltely PositionClose does'nt close open positions.
You might consider doing error checking for any and all trade transactions using CTrade methods.
What do CT.ResultRetcode() and CT.ResultComment() say?
mohsen bahrami:
Hi.
I want to Close a Position by PositionClose(Symbol(),4).
i Define as Below:
#include <Trade\Trade.mqh>
CTrade CT;
CT.PositionClose(Symbol(),4);
although compile has no error, unfortunaltely PositionClose does'nt close open positions.
You must have hedging account. Use RequestDeal() to get the ticket number of previous position, after opening the order. Then use that ticket number in your positionclose. Do not positionclose with symbol only.
ajola:
You must have hedging account. Use RequestDeal() to get the ticket number of previous position, after opening the order. Then use that ticket number in your positionclose. Do not positionclose with symbol only.
You must have hedging account. Use RequestDeal() to get the ticket number of previous position, after opening the order. Then use that ticket number in your positionclose. Do not positionclose with symbol only.
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
Hi.
I want to Close a Position by PositionClose(Symbol(),4).
although compile has no error, unfortunaltely PositionClose does'nt close open positions.