solved. My bad (of course).
The order of the arguments was wrong. (vol, price, symbol, sl, tp) would be correct.
Why would you make an EA to place limit orders? I mean is not like an EA cannot wait for right moment to open a market order ?! 😳
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.
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
Hi,
I have no ideas anymore what might be wrong with my code. I try to open a SELL LIMIT order but the terminal just says "invalid order", Error code 10035.
Here is the core fragment:
The output is
I also attached the full mq5 file.
Thank you very much for your help!
I am out of ideas. :(
Update: ok, I see the variable res_process was not assigned. But the error is there anyway. See the first line in the screenshot, which is the direct output of CTrader.