Could also be ECN, open first THEN set stops.
My understanding was that with an ECN broker I should be able to set SL and TP with a pending order . . . but I will adjust my code to set order with SL and TP at 0 and then modify order to see if it fixes this issue.
I just get uneasy when things work most of the time and then occasionally don't and I can't explain it . . .
When it's in the Strategy Tester does it matter what the Broker is ? won't the Strategy Tester just go by it's recorded MarketInfo variables ?
Bugs in the tester don't obey any thing.
I don't mind if it's a bug in the Tester as long as I can confirm that it is a bug in the Tester. Wonder if there is a list of known bugs . . . .
I have build 229 on one of my older PCs and the documentation says:
RaptorUK is suppose to answer question, not ask.
But it also says:
- execution prices for all trade operations are defined by the broker;
- Stop Loss and Take Profit orders can only be executed for an open position, but not for pending orders;
- history charts are drawn only for BID prices in the terminal. At that, a part of orders shown in charts is drawn for ASK prices. To enable displaying of the latest bar ASK price, one has to flag the "Show Ask line" in the terminal settings.
I have build 229 on one of my older PCs and the documentation says:
RaptorUK is suppose to answer question, not ask.
:-) very funny
Thanks for the quote from the documentation.
My understanding was that with an ECN broker I should be able to set SL and TP with a pending order . . . but I will adjust my code to set order with SL and TP at 0 and then modify order to see if it fixes this issue.
I modified my code to place the Buy/Sell with TP & SL set to 0, then modify the order afterwards to add the correct SL and TP . . . it seems to have cleared up my error 130s.
I'm a little paranoid about placing orders without a SL. For the EA I'm currently working on I have started with all the generic functions, even if this EA turns out to be a dud I will still have some functions I can reuse for the next EA. I have created a function to check open orders for missing SLs and TPs and also SLs and TPs that have already been passed by without closing the order . . . in the event of a problem the error will be logged to screen and emailed. Not sure what else I can do . . . personally I don't plan to trade with an ECN broker but others that will use this EA will be.
18:49:36 2008.03.27 11:11 OBTraderV2T GBPUSD,H1: OP_BUYSTOP: TradeSize= 1 Trade_Entry= 2.0171 Ask= 2.0175 Trade_SL= 2.0088 Trade_TP= 2.0194
18:49:36 2008.03.27 11:11 OBTraderV2T GBPUSD,H1: RefreshRates: Bid=2.0173 Ask= 2.0175
You try to open a buystop below the ask/bid. You have to use BUYLIMIT for that
You try to open a buystop below the ask/bid. You have to use BUYLIMIT for that
It might look like that but the BUYLIMIT was actually set to be placed at Ask not Trade_Entry ;-)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've been looking at this particular problem for some time and am starting to feel I am missing something very obvious. Running on the Strategy tester I get error 130 consistently for some trades that happen during my testing period . . the vast majority of trades are fine. For example:
I use a BUY_STOP so I can set SL and TP (MBT ECN broker) . . another . . .
Now the error 130 . . .
Freeze Level and Stop Level are both 0.0, it's an ECN broker, but anyway, the Stops are a long way off on all 3 trades, the TPs are 16 pips, 13 pips away from Ask and 19 pips for the trade that gave Error 130. As you can see from the RefreshRates entry the price is not changing super quickly . . . what am I missing ? any ideas ?