Jump to content

spread and backtest


microsat2

Recommended Posts

When we backtest, should we consider the spread between last and bid/ask?

 

Suppose a bar's close price is 50 (last) and triggers a market buy order, would the market order be filled at 50? If not, what price is it most likely to be filled at? ask price? (suppose ask price be 51)

 

Suppose later a bar's close price reaches 52(last) and triggers a exitlong market order, would the market sell order be filled at 52? if not, it would be filled at bid price? (suppose bid price be 51)

 

If you don't consider spread, the trading above is a win trade (2 - commission fee).

But when you consider spread, the trading above is a loss trade (0- commision fee).

 

How to consider the effect of bid-ask spread in Ninjatrader's backtest?

Edited by microsat2
Link to comment
Share on other sites

When we backtest, should we consider the spread between last and bid/ask?

 

Suppose a bar's close price is 50 (last) and triggers a market buy order, would the market order be filled at 50? If not, what price is it most likely to be filled at? ask price? (suppose ask price be 51)

 

Suppose later a bar's close price reaches 52(last) and triggers a exitlong market order, would the market sell order be filled at 52? if not, it would be filled at bid price? (suppose bid price be 51)

 

If you don't consider spread, the trading above is a win trade (2 - commission fee).

But when you consider spread, the trading above is a loss trade (0- commision fee).

 

How to consider the effect of bid-ask spread in Ninjatrader's backtest?

 

I normally just change slippage to 1 or 2 depending on the market I am back testing. Although this is not perfect, back testing isn't perfect. You should still go through your executions to see if the market was moving too quickly to get filled at all your levels/filled at the price even with slipapge.

Link to comment
Share on other sites

thanks.

Do you mean the slippage option in the ninjatrader backctest already contains the effect of this kind of spread?

 

I am just wondering why ninjatrader's backtest cannot just use bid or ask price to enter/exit trades. For example, when a bar with close price of 50 is triggerred, the market buy orer would be filled at the ask price of 51. And in the chart, 51 is plotted as entry.

It is not difficult to add this function to ninjatrader's backtest. I am just wondering why not?

 

In addition to the slippage caused by spread, there is another slippage which is caused by market's fast movement. If we could set spread slippage and market's fast movement slippage separately, it would help us determine the effect of each one.

 

 

 

I normally just change slippage to 1 or 2 depending on the market I am back testing. Although this is not perfect, back testing isn't perfect. You should still go through your executions to see if the market was moving too quickly to get filled at all your levels/filled at the price even with slipapge.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...