ERROR130 (order modify error)

 

Hi,

I test my EA on EUR/USD and I dont understand the why the error 130.

many of stop loss modification are rejected ( for a long position, all my new stop loss are -20 pips of the current ask), here is the error message and my alert. PLEASE help me.


2009.03.27 07:31:56 2009.03.04 05:42  ST_002 EURUSD,M1: OrderModify error 130

2009.03.27 07:31:56 2009.03.04 05:42  ST_002 EURUSD,M1: Alert: open long at= 1.2468  current ask= 1.2509  new stoplose= 1.2488  freeze_level= 3 stop_level= 10


 
auto13 wrote >>

Hi,

I test my EA on EUR/USD and I dont understand the why the error 130.

many of stop loss modification are rejected ( for a long position, all my new stop loss are -20 pips of the current ask), here is the error message and my alert. PLEASE help me.

2009.03.27 07:31:56 2009.03.04 05:42 ST_002 EURUSD,M1: OrderModify error 130

2009.03.27 07:31:56 2009.03.04 05:42 ST_002 EURUSD,M1: Alert: open long at= 1.2468 current ask= 1.2509 new stoplose= 1.2488 freeze_level= 3 stop_level= 10

yes, this is puzzling; do you have source code for us to look at?

 
auto13:

Hi,

I test my EA on EUR/USD and I dont understand the why the error 130.

many of stop loss modification are rejected ( for a long position, all my new stop loss are -20 pips of the current ask), here is the error message and my alert. PLEASE help me.


2009.03.27 07:31:56 2009.03.04 05:42  ST_002 EURUSD,M1: OrderModify error 130

2009.03.27 07:31:56 2009.03.04 05:42  ST_002 EURUSD,M1: Alert: open long at= 1.2468  current ask= 1.2509  new stoplose= 1.2488  freeze_level= 3 stop_level= 10


Apologies if you've already thought of this or I'm misunderstanding what you're trying to do, but...


It looks as though you're logging MODE_FREEZELEVEL and MODE_STOPLEVEL versus the current ask price. However, it looks as though you're trying to put a S/L on a long position. The stop is a sell, and therefore gets taken out at the bid, not the ask. You need to be checking that the S/L is at least MODE_FREEZELEVEL/MODE_STOPLEVEL from the current bid, not the current ask. 


In your example it looks as though the new stop is 21 pips from the current ask price (1.2488 versus 1.2509). If the spread is, say, 20 pips, then you're within freeze_level.

 
ronaldosim:

yes, this is puzzling; do you have source code for us to look at?

thank you much, here is the code, apply the EA on EUR/USD (M1, with 10K account).


near 5 march 2009 there is many many oerder modify error please help me.

thank you much.

Files:
error_130.mq4  7 kb
 
auto13 wrote >>

thank you much, here is the code, apply the EA on EUR/USD (M1, with 10K account).

near 5 march 2009 there is many many oerder modify error please help me.

thank you much.

error came about as you modify yr orders; it looks like you are modifying the stoploss amd takeprofit of the order. can i confirm that u only want to modify the stoploss but not the takeprofit?

 
ronaldosim:

error came about as you modify yr orders; it looks like you are modifying the stoploss amd takeprofit of the order. can i confirm that u only want to modify the stoploss but not the takeprofit?

yes, I need just to modify the stop loss, the problem is that, some time the stop is accepted and some ones rejected.

 
auto13 wrote >>

yes, I need just to modify the stop loss, the problem is that, some time the stop is accepted and some ones rejected.

then ordermodify shld use OrderTakeProfit() and not takeprofit since u are not changing the takeprofit

 

Look at your start:

int start()
  {            
double volume=OrderLots();
int slippage;
int Tik=OrderTicket();
int Tiks=OrderTicket();
double price=OrderOpenPrice();
double stoploss=OrderStopLoss();
double takeprofit=OrderTakeProfit();
string comment=OrderComment();
int magic=OrderMagicNumber();
datetime expiration=OrderExpiration();   

You don't know which order you define yet.

Reason: