mohsen bahrami:
hi.
i want to close an specific position in hedged account without opening another opposite position. who can i do it?
thanks.
On the hedge account it becomes so:
//+------------------------------------------------------------------+ //| Test_script.mql5 | //| Copyright © 2016, Vladimir Karputov | //| http://wmua.ru/slesar/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2016, Vladimir Karputov" #property link "http://wmua.ru/slesar/" #property version "1.00" #property script_show_inputs #include <Trade\Trade.mqh> //--- input input ulong find_ticket=0; // ticket of position //--- variable CTrade my_trade; //+------------------------------------------------------------------+ //| OnStart | //+------------------------------------------------------------------+ void OnStart() { my_trade.PositionClose(find_ticket); } //+------------------------------------------------------------------+
Was:
Became:
Files:
test_script.mq5
1 kb
Karputov Vladimir:
On the hedge account it becomes so:
Was:
Became:
thanks. but in mql5, PositionClose in "hedged account" does'nt work.
Files:
mm.png
45 kb
Everything works fine. And netting accounts and hedge accounts.
Karputov Vladimir:
Everything works fine. And netting accounts and hedge accounts.
Everything works fine. And netting accounts and hedge accounts.
you are right.
thanks alot
Karputov Vladimir:
Everything works fine. And netting accounts and hedge accounts.
Everything works fine. And netting accounts and hedge accounts.
I checked it again as attached pics. after running the script. not happening.
//+------------------------------------------------------------------+ //| Test_script.mql5 | //| Copyright © 2016, Vladimir Karputov | //| http://wmua.ru/slesar/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2016, Vladimir Karputov" #property link "http://wmua.ru/slesar/" #property version "1.00" #property script_show_inputs #include <Trade\Trade.mqh> //--- input input ulong find_ticket=0; // ticket of position //--- variable CTrade my_trade; //+------------------------------------------------------------------+ //| OnStart | //+------------------------------------------------------------------+ void OnStart() { Print("------------"); if(my_trade.PositionClose(find_ticket)) Print("closed"); else Print("not closed"); } //+------------------------------------------------------------------+
mohsen bahrami:
I checked it again as attached pics. after running the script. not happening.
- Before running the script: Show screenshot window "Trade" and window "History".
- Then show that you have entered in the input parameter of the script.
- Show terminal screenshot - I want to see the type of your account (hedge or netting).
- Turn on the terminal "Automated Trading" button.
Button "AutoTraiding"!
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 an specific position in hedged account without opening another opposite position. who can i do it?
thanks.