error 130 when sending a buystop orderT

 
OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask + 15*Point,3, Bid-20*Point,Bid+20*Point);

When sending a buystop I get an error 130 , Searched the web to find the solution and one of them was setting the buystop close to the current price , but 15 points is really enough I think , is there any other thing that could be causing this error ? Thanks.

 
kshahnazari:
OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask + 15*Point,3, Bid-20*Point,Bid+20*Point);

When sending a buystop I get an error 130 , Searched the web to find the solution and one of them was setting the buystop close to the current price , but 15 points is really enough I think , is there any other thing that could be causing this error ? Thanks.

  

TP is only 5 points away from buystop. That might be the problem. You can check minimum distances using MarketInfo functions: https://docs.mql4.com/marketinformation/marketinfo

As to the missing parameters in your OrderSend call, donno if that might be source of error. 

 
PomeGranate:

TP is only 5 points away from buystop. That might be the problem. You can check minimum distances using MarketInfo functions: https://docs.mql4.com/marketinformation/marketinfo

As to the missing parameters in your OrderSend call, donno if that might be source of error. 

So I changed the code to    OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask + 15*Point,3, Bid - 15*Point,Bid+30*Point); still error 130 , after I changed the take profit and stop loss to 0 , and got the error again so the problem isn't from those 2 I guess.
 
Why use a buystop at all? just wait for the market to reach your price and open.
 

That will take alot of coding (in my case) that is really unneseccery , cause I want to put a sellstop with it and an expire time to both of them and .... , with all said , think the buystop is the best thing for me

Reason: