Err # 3 Invalid trade parameters, read them in include under stderror.mqh
Of course it is an error, you set pending order price at ask or within freeze level and/or stop level :(, and that order expiration ?, try to replace that with zero.
I don't understand, what's causing problem here exactly? expiration is 4hours, is it wrong?
reuptake:
I don't understand, what's causing problem here exactly? expiration is 4hours, is it wrong?
I don't understand, what's causing problem here exactly? expiration is 4hours, is it wrong?
Exactly ?
ticket = OrderSend(Symbol(), // symbol for trading OP_BUYLIMIT, // operation type NormalizeDouble((AccountEquity() * Lots) / (StopLoss * 100000), 2), // number of lots Ask, // preferred price of the trade 1, // max. slippage High[1] - StopLoss, // stoploss High[1] + TakeProfit, // takeprofi Order_Comment, // comment MagicNumber, // magic number 14400, // order expiration Blue);
For OP_BUYLIMIT the opening price should below Bid price, expiration date may be disable in some trade server and you get error Trade expiration denied, before sending any order check the size of lot size, is the lot size comply with
MarketInfo (Symbol(), MODE_MINLOT); MarketInfo (Symbol(), MODE_LOTSTEP); MarketInfo (Symbol(), MODE_MAXLOT);
Open MetaEditor, Navigator window (Ctrl + D), dictionary tab, select MQL4 Reference > Trading functions > OrderSend and read all description of it.
Have fun :)
Expiration is a future date, your 14400 corresponds to Thu, 01 Jan 1970 04:00:00 GMT
These gurus are correct
I would like to expand on this if you wonder why the changing it from OP_BUYLIMIT to OP_BUY works ?
It is because of exactly what the other guru's indicated about the (14400)
OP_BUY is to buy right now at market price,
OP_BUYLIMIT is buy at future price at future time
See here:
https://docs.mql4.com/trading/OrderSend
Noticed on this page (expiration) next to that says (pending orders only)
This means that the (14400) will be disregarded for OP_BUY market orders, and will place the order
And will NOT work for OP_BUYLIMIT because (14400) it's referring to a time that has already passed as the guru's have indicated
So the main thing to fix is to use and accurate time which will be in the future of the current market time in order for OP_BUYLIMIT to work
I hope this expanded viewpoint helps
Thanks
I would like to expand on this if you wonder why the changing it from OP_BUYLIMIT to OP_BUY works ?
It is because of exactly what the other guru's indicated about the (14400)
OP_BUY is to buy right now at market price,
OP_BUYLIMIT is buy at future price at future time
See here:
https://docs.mql4.com/trading/OrderSend
Noticed on this page (expiration) next to that says (pending orders only)
This means that the (14400) will be disregarded for OP_BUY market orders, and will place the order
And will NOT work for OP_BUYLIMIT because (14400) it's referring to a time that has already passed as the guru's have indicated
So the main thing to fix is to use and accurate time which will be in the future of the current market time in order for OP_BUYLIMIT to work
I hope this expanded viewpoint helps
Thanks
OP_BUY is to buy right now at market price,
OP_BUYLIMIT is buy at a LOWER future price at future time
OP_BUYSTOP is buy at a HIGHER future price at future time
OP_BUYLIMIT is buy at a LOWER future price at future time
OP_BUYSTOP is buy at a HIGHER future price at future time

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
This is my first EA which I'm trying to backtest, and I run into weird problem.
Code above gives Error 3. What's strange, when I change OP_BUYLIMIT to OP_BUY it works!
Anyone could help me on this?