Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.
And the answer is yes, I was missing a parameter setting up the OrderSend() function:
treq.type_filling = ORDER_FILLING_RETURN;
Now it works fine. Happy days

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
I have written my first trading robot using mql5 and tested it on the demo account AMP Futures have provided. As I was trying to run the robot on the live account all the pending orders have been cancelled immediately after being accepted by the trade server. So I have written a small piece of code to test things out. Here it is:
If I use the built-in CTrade wrapper it works fine. If i try to use OrderSend() in just gets cancelled instantly. Why?
Am I missing something while setting up the order? Why is it ok like that on the demo account?