Where does it know TRUE value if Ordersend() is not made?
if(!OrderSend(request,result)) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-- HERE PrintFormat("OrderSend error %d",GetLastError());
OrderSend function returns a boolean value (true/false) true if the function worked, false if the function failed in some way.
so: if(OrderSend(request,result)) will execute the if statement if OrderSend returns True
and if(!OrderSend(request,result)) will execute the if statement if OrderSend returns False
the ! basically means NOT so if (NOT OrderSend()) means if it doesn't work and returns False.
you could rewrite it to this
if(OrderSend(request,result)) { // do stuff here if OrderSend returns True } else { // do stuff here if false }
but if you are only interested in capturing the False (and therefore an error) then it is shorter to use !OrderSend
Note: the true/false refers to the function execution and not the result of the trade request.OrderSend function returns a boolean value (true/false) true if the function worked, false if the function failed in some way.
so: if(OrderSend(request,result)) will execute the if statement if OrderSend returns True
and if(!OrderSend(request,result)) will execute the if statement if OrderSend returns False
the ! basically means NOT so if (NOT OrderSend()) means if it doesn't work and returns False.
you could rewrite it to this
but if you are only interested in capturing the False (and therefore an error) then it is shorter to use !OrderSend
Note: the true/false refers to the function execution and not the result of the trade request.right.. so i understand now this Ordersend() returns true or false valuse,
but how do i make an order?? i thoguht this mqlrequest thing was going to make an order..?
this request. request. things are not just making list to make an order??
but how do i EXECUTE and SEND the order??
i want to let the program ORDER THE ORDER but i complied success and backtested it wont order..
right.. so i understand now this Ordersend() returns true or false valuse,
but how do i make an order?? i thoguht this mqlrequest thing was going to make an order..?
this request. request. things are not just making list to make an order??
but how do i EXECUTE and SEND the order??
i want to let the program ORDER THE ORDER but i complied success and backtested it wont order..
It will make the order based upon the request and return the output into the result structure
ok thank you!
i understood this part but i will study more and look what u told me

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
https://www.mql5.com/en/docs/constants/structures/mqltraderequest
hello guys im just trying to learn MQL5 Coding by myself..
but i need some help here..
In this mql reference doesnt use Ordersend(request, result)
but only !Ordersend(request,result)
how does it work?
i mean,
Where does it know TRUE value if Ordersend() is not made?
and below is the function im trying to make 'Close all position by magic number'.
where should i put Ordersend() if i have to? or where should i fix more?
Thank you for helping..!