- ago
Greetings, I am running a backtest and working with the backtest slippage settings. The preferences adjustments seem to adjust from an APR / equity curve standpoint but do not display under the positions tab or charts. Pictured below is positions tab after a run with .4% slippage on entries and exits. Is this expected behavior and is there a way to view how much slippage was applied on a per trade basis? Thanks in advance.

Notes: Entry Signal / Exit Signal show initial entry and exit prices. Slippage is observed on the session open if there is a gap but not otherwise. Data used was of the 30min scale.


0
582
Solved
23 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.08% )
- ago
#1
I'm not sure what you're expecting to see? Slippage on limit orders doesn't change the price, because the order can't fill above the limit price. Instead, transactions are eliminated with limit slippage. It's explained in the Help.
0
- ago
#2
Sorry yes should have specified the "Sell At Close" is a market at close order. Was hoping for a representation of the effect of the slippage setting.
0
- ago
#3
from the help:
QUOTE:
"Adjust Entry/Exit Prices (Applies to: Market, Stop, and AtClose orders)
Check this box to include the effects of slippage in your system performance results for these order types. This slippage option adversely adjusts entry and exit prices for Market, Stop, and AtClose orders by the slippage amount, but never beyond the low/high range of the bar.",


but not seeing this in the data representation of the backtest only the apr/equity curve.
0
Glitch8
 ( 11.08% )
- ago
#4
I see what you mean about the At Close transactions, I will investigate.
0
Cone8
 ( 4.83% )
- ago
#5
This is a pet peeve of mine - you're using at MarketClose order with an intraday strategy? Why?

You cannot trade this way and there is only ONE TRADE difference between the CLOSE (which you cannot get) and the OPEN of the next bar. Wait another bar, and place a Market order for an intraday strategy.

Now, MarketClose orders are meant for the end of the trading session. They can be placed anytime of the day, but before the last 5 or 10 minutes of the close of the session if you want the order to participate in the closing auction. If you do, you will get the settled closing price - NO SLIPPAGE.

Alternatively, you can disable "Use MOC" and specify the number of seconds before the close that you want WealthLab to place the closing order AT MARKET. This is the only case - a closing session order - that would make sense for an intraday strategy, and yes, applying slippage can make sense for this scenario.
0
- ago
#6
Much appreciated thanks!
0
- ago
#7
Cone, I agree. However for boiler plate purposes and for referencing a time series it makes sense to be able to sell at the close of a bar even if a different order type will be used in real practice. If there is another way to observe slippage around a exiting market order I'm all for it.
0
Glitch8
 ( 11.08% )
- ago
#8
Since we’re talking intraday and like Cone says this amounts to a ONE TRADE difference why not switch to market orders? To be placed one bar later of course.
0
- ago
#9
This seems perfectly reasonable. A bit more information might bring some clarity. I am using python and my brokers API for order entry which accepts a time activation rule. So the idea of selling market on the close of a interday bar is conceptlly quite possible and probably looks much like what Cone described in the last paragraph. However simulating this with market at close orders in WL seems to be a close approximation. The slippage representation is mainly needed here to break / disprove the strategy I am working with. For now it would be great to know if the slippage is indeed being calculated correctly in the APR and equity curves? Or a work around to show slippage in the positions tab / charts. Thanks
0
Glitch8
 ( 11.08% )
- ago
#10
There's no slippage at all currently calculated for MarketClose orders. Any change in the metrics will be due to limit orders that didn't make it past the slippage. We do need to fix the Help for this item, apologies for the confusion there!
0
- ago
#11
Interesting, will the slippage issue also occur with regular market orders as well? Also is this a planned fix or a permanent result for MOC orders? Thanks.
0
Glitch8
 ( 11.08% )
- ago
#12
>>Interesting, will the slippage issue also occur with regular market orders as well?<<

Slippage is being applied to Market orders, but not MarketClose. The Help in incorrect in that regard.

>> Also is this a planned fix or a permanent result for MOC orders?<<

It’s currently going to be a fix to the Help. We need some time to consider whether it makes sense to introduce slippage to MarketClose orders.
0
Best Answer
- ago
#13
Great, thank you for the assistance!
0
Cone8
 ( 4.83% )
- ago
#14
QUOTE:
So the idea of selling market on the close of a interday bar is conceptlly quite possible
It's conceptually possible only in a backtesting, hypothetical scenario. It's impossible for real trading (and this is easy to prove).

The only Market On Close (or Market On Open) order that's possible in live trading is the one supported by the trading exchange. If you place orders that participate in those Closing or Opening auctions, there is zero slippage.

The price you get for MOC orders is the Settled Close. All EOD providers agree on this price. However, the last trade of the regular session for intraday data can differ from the settled closing price, which can take place several minutes after the close on the NYSE.

However, the ONLY Provider that gives you the Primary Market Open price - the price at which MOO orders will be filled - is Wealth-Data. If you use Wealth-Data for EOD testing, there is zero slippage even for Market orders. All other providers take the first full lot (100 or more shares) traded on any exchange as the opening price - this can be several percent away from where the primary market is trading.

See some examples of recent differences at https://www.wealth-data.com
1
Glitch8
 ( 11.08% )
- ago
#15
I think it’s just as possible to have a strategy sell at close intraday as it is to sell at open the next bar. But practically speaking there would be little if any difference.
0
Glitch8
 ( 11.08% )
- ago
#16
I think the answer is we include slippage for intraday MarketClose orders, or in Daily+ scales if you haven't enabled the "Use MOC" Trading Preference.

We could also avoid adding slippage intraday if it's the last bar of the day and "Use MOC" is enabled.
0
Cone8
 ( 4.83% )
- ago
#17
QUOTE:
I think it’s just as possible to have a strategy sell at close intraday as it is to sell at open the next bar. But practically speaking there would be little if any difference.

Okay, I guess I have to prove it.

At trade on the instrument you're trading occurs on a 1 minute bar at 12:00:15... and it turns out to be the CLOSING TRADE of the interval. You already missed it. Case closed.
1
Glitch8
 ( 11.08% )
- ago
#18
There is nothing preventing me from submitting an order at the moment in time an intraday bar closes. Thus, I could trade an intraday system that issues MarketClose orders. Case closed.
0
- ago
#19
Hypothetically, what if a user was using non WL data and did not have the primary provider as a data set? In my instance I experience slippage from what is observed in my brokers data as the opening print using market on open orders. Slippage is a fact of any trading and it seems reasonable to include with any order event. In terms of inter-day trading the idea of using a market order makes sense but runs into issues around the close of the day. For instance a exiting order that should have been placed at the close is now placed at the next days open. Extra logic is needed to filter this out if a just a market order is used. From a user standpoint it seems convenient to allow for MOC slippage even if its practicality is debatable.
0
Glitch8
 ( 11.08% )
- ago
#20
I'm not suggesting changing how an END OF DAY strategy works with MarketClose.

I'm saying that if you're using MarketClose orders DURING THE TRADING DAY with an intraday strategy, you might as well use Market orders instead targeting the next bar like normal. This way you get the calculated slippage.

For example, at 11:30am in the US stock market, you might as well not issue a MarketClose, just use a Market order for next bar.

If you're place a true MOC MarketClose order for the end of the trading day you won't experience slippage.

Above I suggested we might make a change to calculate slippage on INTRADAY MarketClose orders too, just in case folks are using them in this way.
0
Cone8
 ( 4.83% )
- ago
#21
QUOTE:
There is nothing preventing me from submitting an order at the moment in time an intraday bar closes. Thus, I could trade an intraday system that issues MarketClose orders. Case closed.
But it's not trading the Close of the bar, so if you want to pretend to miss the whole point of the discussion, I'm out.
0
Glitch8
 ( 11.08% )
- ago
#22
Why is it not trading at the close of the bar? If you want to just disengage that's fine but it would be great to understand your point.
0
Glitch8
 ( 11.08% )
- ago
#23
To wrap this up, I made a change for Build 49 to apply slippage to MarketClose orders, unless the following is true:

- It's a daily+ scale and the Trading Preference Use MOC/LOC is enabled
- If it's intraday, and it's the last bar of the trading day, and the MOC/LOC is enabled
0

Reply

Bookmark

Sort