Download MetaTrader 5
To add comments, please log in or register
Launch your trading signal. Make profit from paid subscription!
Tsz Yau Lo
235
Tsz Yau Lo 2016.03.01 15:11 
Hello guys, I am new to coding mql5 or mql4. What should be the first ticket number? I have seen in the documentation that an error is -1. But I wonder what should be the first ticket number? 1 or 0? As I have seen in examples that if ticket number > 0, then an order is sent successfully.
Osama Shaban
1385
Osama Shaban 2016.03.02 00:08  

Quick answer :)

if  ticket = 0, means false, or faild

if  ticket = 1, means true, or successful operation.

Alain Verleyen
Moderator
30295
Alain Verleyen 2016.03.02 13:48  
Osama Shaban:

Quick answer :)

if  ticket = 0, means false, or faild

if  ticket = 1, means true, or successful operation.

The mql4 documentation says an error is -1.

mql5 is different.

OrderSend - Trade Functions - MQL4 Reference
OrderSend - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderSend - Trade Functions - MQL4 Reference
Tsz Yau Lo
235
Tsz Yau Lo 2016.03.02 22:59  
Alain Verleyen:

The mql4 documentation says an error is -1.

mql5 is different.

Thank you sir for your reply. However, how is it different in mql5?
Alain Verleyen
Moderator
30295
Alain Verleyen 2016.03.03 08:07  
Tsz Yau Lo:
Thank you sir for your reply. However, how is it different in mql5?

See this article...

Orders, Positions and Deals in MetaTrader 5
Orders, Positions and Deals in MetaTrader 5
  • 2011.02.01
  • MetaQuotes Software Corp.
  • www.mql5.com
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
/
To add comments, please log in or register