Nooby McNoob becomes a quant

1. The real money results
2. The real time strategy engine results
3. The backtest results from the strategy engine
4. Calculating trades by hand, just using price data

Hi Kevin,

This is exactly what I'm trying to match up. Unfortunately, the actual data being used while live is different from the backtest which is where I'm currently stuck. And I think it's due to my choice of platform.
 
Hi Kevin,

This is exactly what I'm trying to match up. Unfortunately, the actual data being used while live is different from the backtest which is where I'm currently stuck. And I think it's due to my choice of platform.

Agreed! That is a key one. You have to have the same data, or things will be different. Not sure why you see differences, but continuous contracts can play a big role, mainly becuase of different rollover dates with different vendors. I've had good Tradestation strats that look awful in MultiCharts, and vice versa - primarily due to rollover differences.

Filtered tick data could also be an issue.

Unfortunately, these pitfalls you are experiencing are rarely taught or discussed. Most people do not even realize they exist!

EDIT: Sorry, I missed the earlier post where you found the "data off by one hour issue." That obviously need to be your focus, before anything I said...
 
Last edited:
Filtered tick data could also be an issue.
This is a huge issue. For example, if your system implements granular/precision calculations in real-time, you’ll see a drastic difference in execution when feeding it with IB snapshot data, as opposed to IQFeed tick data.
 
The backtested bar that occurs one hour before the live bar (the bars are hourly). That is: there is an off-by-1 issue somewhere. The backtested data occurs an hour earlier than the corresponding live data. Note that the offset bars don't match _exactly_ especially with regards to open and close values. In live trading, those may be one value, whereas IB may rejigger historical data due to various issues. So I'm not too worried about that. I have also confirmed that the backtesting has last price occurring one period earlier than live trading.
Could it be that there is a mix up in the time definitions of the ohlc bars? That in one case the time is interpreted as the starting time of the bar, whereas in the other case it is interpreted as the ending time of the bar?
 
Still working on it, managed to reproduce the bug using the author's own code but he closed my bug report :-/

Will keep working on it though. Apparently I'm not the only one reporting such issues.
 
The one thing I'm grateful for in this setup is that I can swap out the trading platform for any other, and everything else (my dashboard, for example) will continue to keep working. This was why I spent a little bit of time getting the architecture right. I hope the author can help sort out the issue.
 
Could it be that there is a mix up in the time definitions of the ohlc bars? That in one case the time is interpreted as the starting time of the bar, whereas in the other case it is interpreted as the ending time of the bar?

This turned out to be the issue. The default mode is, shall we say, surprising: with historical data, it uses the end of the bar, with live, it uses the start. This is "by design". I believe the issue is sorted, will know more today.
 
Journal entry

Profit, net of commissions: $5250

(I'm not counting today since I was messing around, but still.. gonna take the win :))

The issue, as @HobbyTrading correctly surmised, was that backtesting vs live trading treats bars differently enough that it causes discrepancies between the relevant data. I will reserve judgement on that design decision by the author, but suffice it to say it was genuinely facepalm-inducing. We are now trading with the correct parameters and I've verified that historical bars match live bars.

So we're back to verifying that backtesting entries match live (paper) trading entries.

Thanks to everyone on this thread for their help!
 
Last edited:
Back
Top