A very quick question

 
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.
 

Quick answer :)

if  ticket = 0, means false, or faild

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

 
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
 
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?
 
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.
Reason: