Please don't post randomly in any section. MT4/mql4 has it's own section on the forum.
I have moved your topic to the correct section. Please don't create another topic.
This has already be discussed on the forum multiple times. Please do a search before posting.
It is very easy: type something (what you need) in the search area (top right corner of the page) and search.
![Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial](https://c.mql5.com/36/67/requirements-and-limitations-in.png)
- book.mql4.com
Please don't post randomly in any section. MT4/mql4 has it's own section on the forum.
I have moved your topic to the correct section. Please don't create another topic.
int buy = OrderSend(Symbol(), OP_BUYLIMIT, LOT, Open[0], SLIPPAGE, 0, 0, "buy", 9999, 0, clrRed);
-
Always post all relevant code (using Code button) or attach the source file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem -
We can't know what LOT, Open[0], SLIPPAGE are, or what the Bid was at the time you tried to make the order.
At the first tick of a new bar, Open[0] equals Close[0] equals Bid. You can't create a pending order at the current market price.
You can't create a pending order closer to market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
Requirements and Limitations in Making Trades - Appendixes - MQL4 TutorialOn some ECN type brokers, the value might be zero (the broker doesn't know). Use a minimum of two (2) PIPs.
The checks a trading robot must pass before publication in the Market - MQL5 Articles (2016)
-
There is no need to create pending orders in code.
-
The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
Don't worry about it unless you're scalping M1 or trading news.
-
Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-
Resolved, thank you. I am a beginner and didn't really understand the rules. Next time I will properly present all the codes involved in the code.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The following code generated an error even though no stop loss was set.
The error codes are as follows