return value of 'ordersend' should be checked issue

 

 i can't see any problem on my codes, can anyone help pls?

    if (signal == "buy" && OrdersTotal()==0) 

    OrderSend(_Symbol, OP_BUY,0.10,Ask,3,Ask-200*_Point,Ask+200*_Point,NULL,0,0,Green);

      

    if (signal == "sell" && OrdersTotal()==0)

    OrderSend(_Symbol,OP_SELL,0.10,Bid,3,0,Bid-150*_Point,NULL,0,0,Red);

    

 
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.

Topics concerning MT4 and MQL4 have their own section. Your query certainly does not belong in the indicators section!
In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

Read the documentation about OrderSend() and check the return value.

 
gogoknow:

 i can't see any problem on my codes, can anyone help pls?

    if (signal == "buy" && OrdersTotal()==0) 

    OrderSend(_Symbol, OP_BUY,0.10,Ask,3,Ask-200*_Point,Ask+200*_Point,NULL,0,0,Green);

      

    if (signal == "sell" && OrdersTotal()==0)

    OrderSend(_Symbol,OP_SELL,0.10,Bid,3,0,Bid-150*_Point,NULL,0,0,Red);

    

bool OrderSendResult;
if (signal == "buy" && OrdersTotal()==0) 

    OrderSendResult=OrderSend(_Symbol, OP_BUY,0.10,Ask,3,Ask-200*_Point,Ask+200*_Point,NULL,0,0,Green);

      

    if (signal == "sell" && OrdersTotal()==0)

    OrderSendResult=OrderSend(_Symbol,OP_SELL,0.10,Bid,3,0,Bid-150*_Point,NULL,0,0,Red);
 

You can use an "if" statement to check your OrderSendResult after your code to see if it returns an error.