error on stoploss even sending order without Stoploss!

 

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

 
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()

 
check also freeze level of broker before send a buy/sell order. Freeze level property
 
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

 
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

 

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

 
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:

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

 
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 =_=

 
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

 
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,