I can't get my EA to place any orders, either Buy or Sell . Below is the code I used, and when I run the EA it says I have invalid stops. Is there something I'm doing wrong, or is my code wrong?
- Error 4756, Invalid Stops
- Unable to place buy or sell orders
- [ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3.
you need to set the request.sl, request.tp, request.filling, and request.type_filling
But - there's a better streamlined way of programming buy or sell using Trade.mqh instead of the request structure
Mr OIRU #:
Do you have an example of using Trade.mqh , I’m new to writing in MQL5.
https://www.mql5.com/en/articles/15299
Do you have an example of using Trade.mqh , I’m new to writing in MQL5.
Thank you very much, my code is running now.
Can Trade.mqh be used to set Sell Limit and Buy Limit orders, or do I need to use something else for that?
Mr OIRU #:
Can Trade.mqh be used to set Sell Limit and Buy Limit orders, or do I need to use something else for that?
Can Trade.mqh be used to set Sell Limit and Buy Limit orders, or do I need to use something else for that?
It can.
trade.BuyLimit(vol, price, NULL, 0,0, ORDER_TIME_SPECIFIED, expirationTime); trade.SellLimit(vol, price, NULL, 0,0, ORDER_TIME_SPECIFIED, expirationTime);
u don't need to set any expiration time by the way
after typing "trade." press Ctrl + space, you will see the API options
Conor Mcnamara #:
Oh, thank you so much. I couldn't find any information about using Trade. in the MQL5 documentation (F1). Can I message you personally for guidance on how to use Trade. ?
It can.
u don't need to set any expiration time by the way
after typing "trade." press Ctrl + space, you will see the API options

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