Ordersend function returns a value.
int ticket=OrderSend(....
wow you solved it thank you, can you tell me what does this int ticket do in brief ?
Exactly what the documentation say's.
https://docs.mql4.com/trading/ordersend
Returned value
Returns number of the ticket assigned to the order by the trade server or -1 if it fails. To get additional error information, one has to call the GetLastError() function.

OrderSend - Trade Functions - MQL4 Reference
- docs.mql4.com
Returns number of the ticket assigned to the order by the trade server or -1 if it fails. To get additional error information, one has to call the GetLastError() function. At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price. If operation is performed with a...

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
hello, I have written this simple program but when I run it on the chart it does not sell or buy