If want to get into the market, I would not offset the current close price by 3 ticks, I would offset the current bid if selling or the current ask if buying. I would also use the methods GetCurrentAsk() and GetCurrentBid() to retrieve those prices. This will give you the best chance of getting filled at market.
The following 4 users say Thank You to NinjaTrader for this post:
Interesting. I may need to reconsider how I code that in my own strategies. My approach is generally I want to enter at market, but not if the price has already moved x ticks away from the last traded price. Why would an offset on the bid or ask give a better chance to get filled at market? Because of potential large spread of certain instruments?
Last edited by monpere; April 24th, 2012 at 12:28 PM.
If you want to enter market with limit based on an offset from the last price on your chart then your approach is correct. If you want to enter at market, then there are several reasons for offsetting the bid/ask price:
- For example, it is very possible that Close - 3 tick offset to sell might be still greater than the bid price --> No fill
- GetCurrentAsk() and GetCurrentBid() return the current prices which is especially in fast moving markets will be more recent/ahead of the event driven OnMarketData(). This is due to the asynchronous aspect of the actual market data/brokerage adapter.
The following 2 users say Thank You to NinjaTrader for this post:
Yes, thanks. If trading an instrument with occasional large spread, then I don't want the order executed if the spread is larger then x ticks at the moment. If trading a fast instrument, then I don't want the order executed if there is a fast move greater then x ticks away from my intended price. In both cases I want a No Fill.
I said 3 ticks, just as an example. I think the actual number of ticks you would use would depend on the instrument you are trading because of any of the reasons mentioned above. Also depends on your trading methodology. It could be 1000 ticks if you just want to enter the market at any price for example. I generally trade instruments with very tight spreads so 3 ticks is plenty for me, others may require more to guarantee a fill. Also, for me there is a certain price after which I no longer want that trade. For instance, I don't want to enter 5 ticks away from the last trade price, if my profit target is 10 ticks away from that last traded price. Half my potential profit would be gone, so that trade is not worth for me at that price.