Download MetaTrader 5
To add comments, please log in or register
MQL5 language supports OpenCL. Try it!
Khashi
15
Khashi 2015.06.15 10:27 
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.

PomeGranate
554
PomeGranate 2015.06.15 12:15  
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. 

Khashi
15
Khashi 2015.06.15 12:31  
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.
whroeder1
13619
whroeder1 2015.06.15 16:21  
Why use a buystop at all? just wait for the market to reach your price and open.
Khashi
15
Khashi 2015.06.15 16:44  

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

/
To add comments, please log in or register