- ago
Hello,

How do experienced WL users set up their backtests to include slippage on limit orders? Would it be better if the "adjust prices" setting and the "limit orders" setting were mutually exclusive (or this was an option)? Is there a database or method for determining the average slippage to use in a backtest on a particular contract? How do you determine if your slippage estimate is accurate in real time on limit orders? Would it just be the number of times you are left with an orphan position?

I recently discovered that changing the slippage settings in the preferences had a huge effect on some of my strategies using limit orders and trading frequently. For most, if not all of my backtests, I did not have the limit orders box checked because most of the contracts I was trading were so liquid that I never ran into this problem. However, I did use the "adjust entry/exit" because of my liberal usage of stop orders.

It seems to me that since limit orders never execute with slippage, they should not be affected by that setting, but they are indeed. Thus when both boxes are checked, limit orders are basically subject to twice the slippage. Am I right about that effect?

One of my strategies appears very promising, but when I turned on the "limit orders" slippage setting, it wrecked the strategy. How can I determine which settings to use and how high to turn the slippage number of ticks?

Many questions here but hopefully you can see they are all basically asking the same thing: how do we deal with slippage on limit orders for futures contracts in back-testing?

Thanks,
Dandude
0
374
8 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.92% )
- ago
#1
Since I wrote it in the help already, I'm going to copy it for talking points:

3. Limit Order Slippage prevents filling trades if prices don't trade beyond the limit price. This may keep your backtests from participating in trades that ultimately would have resulted in losses (positive impact) or in profits (negative impact).

4. We recommend disabling limit-order slippage for Live trading of strategies that use limit orders to enter positions because it may prevent a strategy from executing the exit logic. Also, Use Live Positions in the Trading Preferences can help keep most strategies synchronized with broker positions.


Is there some confusion about either of these?

Also, if you're testing futures slippage with more than 1 tick, I'd like to know why you'd do that.

0
Glitch8
 ( 11.27% )
- ago
#2
Limit orders aren’t subjected to twice the slippage. When enabled, the backtester calculates the order price with slippage applied. If the actual price doesn’t reach this adjusted level then the trade does not fill. It simulates what sometimes happens in real life when using limit orders and the price just hits the limit for a short period of time and then reverses.

Personally I don’t use the setting because it happens so rarely in my trading (Nasdaq 100 stocks) it’s a non-issue.
0
- ago
#3
Thanks for the responses guys.

Yes I understand the function of the limit order slippage setting. I was asking about how to use it properly on futures contracts. For example Cone, you said, "why are you setting it above one tick?" The answer is I don't know! I am not sure how many ticks to set it to, because I run tests on a variety of futures contracts, some might have more or less slippage but I am not sure how I can find the data that would allow me to choose the correct setting. It sounds to me like you recommend using only one tick?

When I say that limit orders are hit twice, I mean that if both boxes are checked under slippage, the entry/exit prices are adjusted against the trader AND some trades will not be executed. In reality, it would only be the lack of execution for the limit order and the prices would not be adjusted. When testing a strategy that contains both stop orders and limit orders, you cannot accurately account for slippage in this case, since only one of the two conditions would apply to either the stop or the limit, but WL applies both conditions to the limit orders.
0
Glitch8
 ( 11.27% )
- ago
#4
No, WL doesn't adjust the price of the limit orders, that's not possible, the trade can only execute at the limit price.
0
Cone8
 ( 4.92% )
- ago
#5
And, I was scared into double-checking that.

On the first point, I trade mainly index futures. These are very liquid contracts. If the market traded past my limit price by 1 tick it's nearly certain I would be filled - but anything's possible in a fast market - like after a FOMC rate decision.

Even for an illiquid contract, if your order was in the market, it's hard to imagine that it wouldn't be filled if the market traded beyond your price by 1 tick. The point is, the best you can do for a backtest is to ensure that the market traded past your price. If it did, I think you can safely assume you would have been filled.

I'd be interested to hear about any experience to the contrary.
0
- ago
#6
Cone: It happened to me last night. I was trading Brazillian Real Futures and it traded well below my price but I was not filled. Perhaps I need to change some settings in IB because I know they have some "smart" adaptations that keep the orders off the exchange on occasion. However, I think what happened now that I look at it again is that I got a single contract filled and then on the next bar WL removed my order because it thought it was filled, and that is when the price moved well below my order.

Glitch: I ran a backtest last night where I checked and unchecked the adjust entry/exit prices and it changed the results of my strategy that only uses limit orders. I could be mistaken, so I will investigate again and make sure that this is correct and let you know if I find the problem again.
0
Cone8
 ( 4.92% )
- ago
#7
The hypothetical backtest will always fill if the prices agree.

If your strategy is compatible and you enabled "Use Live Positions", and you're not filled (at all), then you'd keep trying.
But even a partial fill is a "Position", so that sends you to your Exit logic.
0
Glitch8
 ( 11.27% )
- ago
#8
>>Glitch: I ran a backtest last night where I checked and unchecked the adjust entry/exit prices and it changed the results of my strategy that only uses limit orders.<<

Yes, of course it will change the results. It's potentially EXCLUDING trades.
0

Reply

Bookmark

Sort