error on stoploss even sending order without Stoploss!

To add comments, please log in or register
Amirfakhredin Ghanbari
215
Amirfakhredin Ghanbari  

hi guys,


got weird issue 

i keep getting error 130 invalid stop error... so i got frustrated then removed it and still get same error

2019.09.22 19:51:20.125 2019.09.02 04:06:03   USDJPY,M15: Error number 130 = invalid stops

2019.09.22 19:51:20.125 2019.09.02 04:06:03   USDJPY,M15: OrderSend error 130

2019.09.22 19:51:20.059 2019.09.02 04:06:00   USDJPY,M15: 0.0

double longSignal=OrderSend(NULL,OP_BUY,0.01,Ask,3,0,Bid+(Target*pips),"Long",0,0,clrBlue);

wondering what's going on!

can anyone help me out tnX in advance

Marius Ovidiu Sunzuiana
1842
Marius Ovidiu Sunzuiana  
Amirfakhredin Ghanbari:

hi guys,


got weird issue 

i keep getting error 130 invalid stop error... so i got frustrated then removed it and still get same error

2019.09.22 19:51:20.125 2019.09.02 04:06:03   USDJPY,M15: Error number 130 = invalid stops

2019.09.22 19:51:20.125 2019.09.02 04:06:03   USDJPY,M15: OrderSend error 130

2019.09.22 19:51:20.059 2019.09.02 04:06:00   USDJPY,M15: 0.0

double longSignal=OrderSend(NULL,OP_BUY,0.01,Ask,3,0,Bid+(Target*pips),"Long",0,0,clrBlue);

wondering what's going on!

can anyone help me out tnX in advance

You have to multiply with Point() function. Ask+takeprofit*Point()

Marius Ovidiu Sunzuiana
1842
Marius Ovidiu Sunzuiana  
check also freeze level of broker before send a buy/sell order. Freeze level property
Amirfakhredin Ghanbari
215
Amirfakhredin Ghanbari  
Marius Ovidiu Sunzuiana:

You have to multiply with Point() function. Ask+takeprofit*Point()

i don't have issue with TP, as you can see its fine i get invalid stop error

Marius Ovidiu Sunzuiana
1842
Marius Ovidiu Sunzuiana  
Amirfakhredin Ghanbari:

i don't have issue with TP, as you can see its fine i get invalid stop error

Same error you will get for invalid take profit invalid stop loss

Marius Ovidiu Sunzuiana
1842
Marius Ovidiu Sunzuiana  

Try before send the order instead ask or bid use SymbolInfoDouble(Symbol(),symbol ask or symbol bid) 

Pavel Shutovskiy
47044
Pavel Shutovskiy  
Documentation on MQL5: Conversion Functions / NormalizeDouble
Documentation on MQL5: Conversion Functions / NormalizeDouble
  • www.mql5.com
Calculated values of StopLoss, TakeProfit, and values of open prices for pending orders must be normalized with the accuracy, the value of which can be obtained by Digits(). Please note...
Amirfakhredin Ghanbari
215
Amirfakhredin Ghanbari  
Amirfakhredin Ghanbari:

i don't have issue with TP, as you can see its fine i get invalid stop error

thank you let me check it out

Amirfakhredin Ghanbari
215
Amirfakhredin Ghanbari  
2019.09.22 22:17:19.426 2019.09.20 20:59:52  USDJPY,H1: 107.67
2019.09.22 22:17:19.426 2019.09.20 20:59:52  USDJPY,H1: Error number 130 = invalid stops


double StopLOSS= NormalizeDouble(Bid-(10*Points),3);

double longSignal=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,StopLOSS,Ask+(10*pips),"Long",0,0,clrBlue);


Still same issue =_=

Pavel Shutovskiy
47044
Pavel Shutovskiy  
Amirfakhredin Ghanbari:
2019.09.22 22:17:19.426 2019.09.20 20:59:52  USDJPY,H1: 107.67
2019.09.22 22:17:19.426 2019.09.20 20:59:52  USDJPY,H1: Error number 130 = invalid stops


double StopLOSS= NormalizeDouble(Bid-(10*Points),3);

double longSignal=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,StopLOSS,Ask+(10*pips),"Long",0,0,clrBlue);


Still same issue =_=

double minstoplevel = SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL);

double StopLOSS = NormalizeDouble(Bid - minstoplevel * _Point * StopLOSS, _Digits); // Buy

double TakeProfit= NormalizeDouble(Bid + minstoplevel * _Point * TakeProfit, _Digits); // Buy

For Buy orders, opening at the ASK price, placing stop-loss and take-profit at the bid price

Amirfakhredin Ghanbari
215
Amirfakhredin Ghanbari  
Pavel Shutovskiy:

For Buy orders, opening at the ASK price, placing stop-loss and take-profit at the bid price

Thank you Pavel let me check,

12
To add comments, please log in or register