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 wanted to open a new demo account on MQL5 terminal. (I already have a netting demo account) When opening an account, the button "Use hedging in trading" is not activated.
Question: Can I have both hedge and netting forex accounts on the same terminal? Or should I reinstall the terminal?
There is a dependence on which trade server you log in to. Connect to MetaQuotes-Demo.
Help who knows, can't find the information on my own. The broker has hedging accounts. My robot is written for non-hedging accounts. How can I close a position on a hedging account using MQL5? There is no OrderClose() function in MQL5. The opposite position, as in a netting account, does not close the open position.
Maybe TRADE_ACTION_CLOSE_BY should be set in the trade request on a hedging account ?
or is there a more correct solution?
Help who knows, can't find the information on my own. The broker has hedging accounts. My robot is written for non-hedging accounts. How can I close a position on a hedging account using MQL5? There is no OrderClose() function in MQL5. The opposite position, as in a netting account, does not close the open position.
Use the universal code for position traversal - it works on both netting and hedge accounts. Example in the GalacticExplosion code - CloseAllPositions function
What about the commission?
If I have two open positions, one buy, one sell, and close the 'sell' by the 'buy' I have paid twice the commission. But I would have paid only once the commission if I just close the buy, isn't it?
But what if a broker isn't asking for a commission but has increased the spread? Don't I pay the spread twice as well?