How best to troubleshoot discrepancies between backtesting and real-time trading?
Author: djmundus
Creation Date: 9/18/2018 2:52 PM
profile picture

djmundus

#1
I have a pretty simple strategy (based on the DipBuyer strategy that comes with Wealth-Lab). If the broader Nasdaq is above a moving average and the stock is above its moving average, buy at a limit order X% below the daily close.

I download my data 20 minutes before market open so that any corrections are accounted for. I run the strategy from the Strategy Monitor and then open the selected trades in the Quotes window. I have the alarm trigger when stocks drop 85% of the distance to the limit order. That gives me enough time to place the order.

But when I run the strategy, I frequently see sell orders for trades that never executed in real-time trading.

Any idea what the cause of this might be and how to troubleshoot it?
profile picture

Eugene

#2
Ideas:

1. Not using Raw Profit mode for the Strategy Monitor position sizing

2. Failure to set Position.Priority (or "Use Worst Trades in Portfolio Simulation") in conjunction with ~100% capital allocation (e.g. 10% equity on a portfolio of 10 stocks, >90% equity to 1 symbol etc.)
profile picture

djmundus

#3
I've been using 5% of my portfolio for position sizing in both my backtesting and real-time trading. In my experience, the sharpe ratio seems like the best predictor of how a strategy will perform on data it hasn't seen...

CODE:
Please log in to see this code.


Take yesterday for example... I had a limit order for VSTM at $8.22. It never triggered during the day. But when I downloaded yesterday's data this morning, it shows VSTM with a low of $8.21. So... I'm confused.
profile picture

Eugene

#4
More ideas:

3. A difference between the data used for real-time trading and backtesting.
profile picture

Cone

#5
First thing is to read the FAQ at https://www.wealth-data.com/faq. My suspicion is that you'll have better luck using Wealth-Data for trading EOD limit systems (Wealth-Data covers only S&P 500 and Nasdaq 100), however, there will definitely be times when a buy limit order is not filled precisely at (or very near) the low of the day; sometimes it will fill, sometimes not, it just depends on the depth of the bid. You can remove those extreme trades (the ones that are near the low of the session) from a backtest by activating Preferences (F12) > Slippage > Activate Slippage for Limit Orders.

Re: VSTM
Observing the TOS from 18 September, the only explanation that I can see that you weren't filled at $8.22 is that you didn't have the order active in the market between 09:51:11 and 09:53:20. There were thousands of shares traded at and below 8.22 during that period.

Which data provider do you use that indicates VSTM's low yesterday was only $8.21?
profile picture

MustPlayOptions

#6
I ran into that a lot. I ended up changing my settings to "Convert to Market" on the Quotes Window and it correlated closer.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).