While a stop limit order (a stop order for placing limit order) can be made manually in metaTrader, I see no function as such in CTrade. I wonder if there is a way we can automate it using mql5?
I am not asking for code, I just want to know if it is even possible. Thank you very much.
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuylimit
Thank you for your answer! I knew ctradebuylimit and ctradeselllimit, but they are not the kinds of orders I am looking for.
For ctradebuylimit, we buy at the price lower than current market price; for tradeselllimit, we sell at the price higher than current market price.
I wonder if we can actually place a buy limit order at a price higher than the current market price and a sell limit order at a price lower than the current market price.
Sorry for not making my question clearer (I have also updated my post for clarification).
Thank you for your answer! I knew ctradebuylimit and ctradeselllimit, but they are not the kinds of orders I am looking for.
For ctradebuylimit, we buy at the price lower than current market price; for tradeselllimit, we sell at the price higher than current market price.
I wonder if we can actually place a buy limit order at a price higher than the current market price and a sell limit order at a price lower than the current market price.
Sorry for not making my question clearer (I have also updated my post for clarification).
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuystop
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradesellstop
do you mean buy stop/sell stop? limit is as long as the price is greater/lesser than price +- stop level
- www.mql5.com
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuystop
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradesellstop
do you mean buy stop/sell stop? limit is as long as the price is greater/lesser than price +- stop level
Sardion, thank you for being keen to help!
No, I do not mean buy/sell stop, I mean buy/ sell limit order.
Let me quote the documentation of MetaTrader 5 to clarify:
“
- Buy Limit – a trade request to buy at the Ask price that is equal to or less than that specified in the order. The current price level is higher than the value in the order. Usually this order is placed in anticipation of that the security price, having fallen to a certain level, will increase.
- Buy Stop – a trade order to buy at the "Ask" price equal to or greater than the one specified in the order. The current price level is lower than the value in the order. Usually this order is placed in anticipation of that the security price, having reached a certain level, will keep on increasing.
- Sell Limit – a trade order to sell at the "Bid" price equal to or greater than the one specified in the order. The current price level is lower than the value in the order. Usually this order is placed in anticipation of that the security price, having increased to a certain level, will fall.
- Sell Stop – a trade order to sell at the "Bid" price equal to or less than the one specified in the order. The current price level is higher than the value in the order. Usually this order is placed in anticipation of that the security price, having reached a certain level, will keep on falling.
”
- www.metatrader5.com
For buy limit order, we buy at the price lower than current market price; for sell limit order, we sell at the price higher than current market price.
So my question is, can we actually write a code that places a buy limit order at a price higher than the current market price and a sell limit order at a price lower than the current market price?
I am not asking for the code, I just want to know if it is even possible.
Thank you very much!
Technically there is no restriction. It is MT5/4 that makes it impossible to put a Buy Limit at a higher price or Sell Limit at lower price.
There are brokers that provide a workaround for this limitation. It is not possible to do this with code from within the Terminal as the restriction is in the Terminal itself.
Technically there is no restriction. It is MT5/4 that makes it impossible to put a Buy Limit at a higher price or Sell Limit at lower price.
There are brokers that provide a workaround for this limitation. It is not possible to do this with code from within the Terminal as the restriction is in the Terminal itself.
Thank you for your answer! I wonder why do they impose restrictions as such...
Speaking about the brokers that provide a workaround, I will be grateful if can you suggest any of them. Thank you again.
Thank you for your answer! I wonder why do they impose restrictions as such...
Speaking about the brokers that provide a workaround, I will be grateful if can you suggest any of them. Thank you again.
Recommendations about brokers is not allowed. You have to do your own research. But to steer you in the right direction. Look for brokers that provide service for traders. These are the brokers without bonus programs/ib programs or any other crap that has nothing to do with providing best trading conditions.
Recommendations about brokers is not allowed. You have to do your own research. But to steer you in the right direction. Look for brokers that provide service for traders. These are the brokers without bonus programs/ib programs or any other crap that has nothing to do with providing best trading conditions.I
Oh I'm new here and didn't know about that rule. Thank you for your guidance tho - it does help me a lot!
When you registered you agreed to Metaquotes' rules.
General rules and best pratices of the Forum. - MQL5 programming forum 2017.10.27
Think about who is MetaQuotes' customers. It is not us users.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
For buy limit order, we buy at the price lower than current market price; for sell limit order, we sell at the price higher than current market price.
So my question is, can we actually write a code that places a buy limit order at a price higher than the current market price and a sell limit order at a price lower than the current market price?
I am not asking for the code, I just want to know if it is even possible.
Thank you very much!