Error 130 : invalid stops

Back to topics list To post a new topic, please log in or register
avatar
316
ernest02 2016.01.04 06:53
 

I get the 130 error from time to time and i cannot figure out why this happens. I place two pending trades - a Buy stop and a Sell stop. The one will get accepted and the other is rejected with an error 130 message.

I use ThinkForex which have no minimum StopLevel. They are a STP broker. My Stop Loss (and Take Profit) are rounded to 5 decimals (which the broker uses). So why does the one pending trade accepted and the other rejected?

Here are the details from my Journal with the results of the error:

 2016.01.04 06:41:18.549    Scalping System EURUSD,H1: open #70680332 sell stop 13.69 EURUSD at 1.08267 sl: 1.08297 tp: 1.08067 ok
2016.01.04 06:41:18.255    Scalping System EURUSD,H1: Ask: 1.08808 Lots: 13.69 Stop: 1.08736 Profit: 1.08966
2016.01.04 06:41:18.255    Scalping System EURUSD,H1: Alert: Open Buy Stop Order - Error 130: invalid stops
2016.01.04 06:41:17.756    Scalping System EURUSD,H1: initialized
2016.01.04 06:41:17.756    Scalping System EURUSD,H1: Spread is 0.00015


Thanking you in advance

avatar
2017
gooly 2016.01.04 11:23 #
 
I would first ask the broker!
avatar
13009
WHRoeder 2016.01.04 13:51 #
 
  1. When I tried stops, I couldn't get them to work. I think it was comparing current market to the TP/SL. Perhaps that problem is back; try setting the pending first and then set the stops.
  2. There is no reason to use pending orders in a EA. Humans can't look at the market continuously, EAs can. Just wait until the market reaches your price.
  3. My Stop Loss (and Take Profit) are rounded to 5 decimals
avatar
316
ernest02 2016.01.05 09:35 #
 
Thank you WHRoeder for that very helpful response. I will certainly make use of your recommendations and advice!
avatar
119
Doerk 2016.01.06 01:16 #
 

"No reasons for EAs to use pending orders" .... sure? 

1. A pending limit order is executed as limit, an EA opens at market. In other words: The higher the precision, the lower the slippage the higher the gained profit.

2. A pending order stays on brokers server even if you are disconnected. In other words: The higher the security the higher the gained profit.

And there are many reasons more why the usage of pending orders is much better than only using market oders. And btw, that is what the TO asked for and I guess he got a reason to use pending orders. What you suggested is a local software based version of MIT orders. There are reasons for MIT orders, sometimes in special cases, but sureley not in general.

My suggestion for the TO is, write a class that manages virtual orders without being affected from success of placing an order physically. If an order could not be sent, the class should optionally still have the option to execute those orders as market orders. This way the main part of your EA doesn't need to bother with such problems but you still get the advantages of especially limit orders in probably 99% of all cases.

Back to topics list  

To add comments, please log in or register