I’m a newbie to live trading…and I have an EA that I’ve tested and am about to go live this week.
My broker is MB Trading, an ECN. My EA works sufficiently well with back and forward testing (hopefully!..we’ll see…), but I still have some basic questions about going live. I’m not sure everything will work the same…I’m new at this! My EA allows only one order open at a time, and uses between 1-2.5% of the account balance (I start low).
Should I set the “slippage” on my OrderSend to zero? It’s an ECN…so I suppose it should be zero, right?
I’m opening orders at market price. On the OrderSend() should I just stick in the “Ask” or “Bid”? If the market is moving fast, the split second my order gets there might be too late, right? Perhaps I should stick a fraction of a pip above (for a long) or below (for a short)…but then again I don’t want to pay too much.
I’ve dropped in the “OrderSendReliable”, “OrderModifyReliable” stuff that I’ve seen around. It seems like a good idea…errors are handled well, multiple order executions are performed if necessary, etc. Is this OK? Are there any problems you know of with this?
I remember having to open orders with no SL and TP…to avoid an error. Then I immediately modify the order to get these in. Sometimes I worry that if the modification doesn’t get in, I’m a sitting duck (no SL!). I’d like to run this and be away from my computer! Do you guys have to do this? I’m a bit nervous!
If you have tested your EA on demo then there should be no problems.
In terms of your questions :-
When it comes to an ECN(or market execution) broker, the slippage parameter of the OrderSend function is ignored. Set it to anything you like, makes no difference.
You should always set the price to buy at Ask or sell at bid. There is no other price you can send. If you are worried about a fast moving market, consider using pending orders. Once again, at an ECN the price(Bid or Ask) is totally ignored by the server. Try this as an experiment if you have any doubts :-
int ticket=OrderSend(Symbol(),OP_BUY,1.0,0,0,0,0,"comment",123,0,CLR_NONE);
Note the buy price of 0…
The moral of this is that you send an instruction that you wish to buy(or sell) and the broker will return your trade with the best price the market can offer…the price you wished to get is irrelevant. Technically your slippage is unlimited and you will never see a requote at a ECN broker.
That said, it is good practice to use the correct OrderSend parameters in order to ensure compatibility with the bucketshop instant execution brokers.
I have never used OrderReliable. I’m sure its good but I prefer to look after my own error handling.
When it comes to entering the TP & SL as an OrderModify, you have no choice…there simply is no other way. This is where error handling becomes important.
One technique you could use is to send a stop order at the Ask price(or Bid for a sell). This should be converted to a market order virtually immediately and allows you to enter a stoploss & takeprofit in the same order. There will be the occassional trade that gets rejected if the market moves so fast that it causes an invalid price. Use error handling for this. There will also be the occasional trade that will not be converted to a market order as the price gets missed. This is just tough. remember to delete the order later(MB Trading do not support expirations BTW).