Hello, I need to close an open order (not a pending order, an order that is running). I have its Ticket number
Thanks
mql5 and I need to know also if an order has been closed automatically due to stop loss how to know it that is to say how to check in history if an order has been closed due to stop loss reaching
You can't close an order with MT5.
- 2011.02.01
- MetaQuotes Software Corp.
- www.mql5.com
Just open an opposite order so it will cancel out.
I have also tried for the second time Mql5 and i am also having rather large problems converting between Mql4 and Mql5, for example with things like:
volume[i]=iVolume(SymbolName(i,1),PERIOD_CURRENT,NULL);//---get volume spread[i]=MarketInfo(SymbolName(i,1),MODE_SPREAD); //---get spread
I cannot seem to find a way to convert these examples into a single line code replacement.
And i have reached my final conclusion, which is that Mql5 sucks and it also does this very hard and i am never going to touch it again.
I just cannot create the "Flow" that i can create in Mql4 and i think they did a horrible job at changing all the code, i tried real hard, and several times too, but this has got to end.
If you ask me, adding multiple symbol support for strategy tester in MT4 would be a serious step foreward since i am only converting code from MQL4 to MQL5 to test my MT4 robots !!!!
So i have some good robots in MT4 but i am un-able to test them due to the limited functionality in MT4, and so i try to convert it to MQL5 ONLY to test it and then move back to MT4 with the calculated variables found in MT5 !!
I know it makes no sense at all but it is only bacuse i am tring to find a way to test my multi symbol robots !!
Just open an opposite order so it will cancel out.
I have also tried for the second time Mql5 and i am also having rather large problems converting between Mql4 and Mql5, for example with things like:
I cannot seem to find a way to convert these examples into a single line code replacement.
And i have reached my final conclusion, which is that Mql5 sucks and it also does this very hard and i am never going to touch it again.
I just cannot create the "Flow" that i can create in Mql4 and i think they did a horrible job at changing all the code, i tried real hard, and several times too, but this has got to end.
If you ask me, adding multiple symbol support for strategy tester in MT4 would be a serious step foreward since i am only converting code from MQL4 to MQL5 to test my MT4 robots !!!!
So i have some good robots in MT4 but i am un-able to test them due to the limited functionality in MT4, and so i try to convert it to MQL5 ONLY to test it and then move back to MT4 with the calculated variables found in MT5 !!
I know it makes no sense at all but it is only bacuse i am tring to find a way to test my multi symbol robots !!
SymbolInfoInteger(symbol,SYMBOL_SPREAD);
This is not a valid mql4 statement, I suppose NULL should be 0 ?
volume[i]=iVolume(SymbolName(i,1),PERIOD_CURRENT,NULL);
Anyway, I understand your point of view, but you are wrong, mql5 is more powerful and efficient, it's easy to prove. Of course, you are right that mql5 is more complex and difficult to learn, that's probably the price for efficiency and speed.
Don't expect new big features in MT4/mql4, I don't think this will happen, from what I can read on the Russian forum by the Metaquotes CEO.
- 2010.05.17
- Sergey Pavlov
- www.mql5.com
Yes NULL should be 0 and sometimes you see that even do something is upgraded, many times you can still use the old language if they build it up on the same foundation.
Unfortunatly with MQL4 and MQL5 this is not so, however i do see some of the old stuff that is still being used, but i also see a lot of stuff that is used in a completly different way as well as much more complicated way's of doing the same simple things.
I'm not sure what you think i am wrong about but i do know that very often so, simple systems work best.
If you are talking about efficiency do you mean resource usage? and speed? execution times? or calculation speed?
...
I'm not sure what you think i am wrong about but i do know that very often so, simple systems work best.
If you are talking about efficiency do you mean resource usage? and speed? execution times? or calculation speed?
I am not so sure, execution times also depend on the network connection, and i noticed there are more steps involved in MQL5 calculating the same results this logically means it should take longer since it is directly related to computing capacity, i agree on the resources part too do.
Maybe this all isn't that important, to me what really matters is how does the code preform
So, I have not understood correctly.
To close a BUY position you have to send a SELL order with the same volume as your position.
To check if it's close by stoploss you can check the history of deals.
To change a stoploss you have to send an order TRADE_ACTION_SLTP.
Please read the documentation, the forum and articles. If you need help on coding please post your attempt.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I need to close an open order (not a pending order, an order that is running). I have its Ticket number
Thanks