Using Delisted Data
Using Delisted Data
I was wondering if anyone here uses delisted data? I am curious on how you go about telling tradingblox when and how to dump the position when the data ends so that equity will not be frozen in that position until the end of the test.
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas
Yes, for stocks delisted data is necessary in order to avoid survivorship bias. In historical testing you can look ahead to see when the last bar of trading is and exit on or ahead of that. This is postdictive, but tolerable given that it is rare that a stock stops trading unannounced. In live trading, we don't get "stuck" in a stock that quits trading, we either liquidate the shares or receive shares of another company if it is a merger or whatnot. There is the occasional case (fraud, etc.) where a stock halts trading unexpectedly and never resumes. This might be a total loss...
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas
-
- Roundtable Knight
- Posts: 112
- Joined: Wed Jul 31, 2013 3:33 pm
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas
In order to avoid survivorship bias, you shouldn't need a special script. You will need a survivorship bias free database with the issues that no longer trade marked as inactive in the stock dictionary. The current release of Trading Blox exits stocks marked as inactive in historical testing on the close of the final bar if the system holds a position at that time.
-
- Roundtable Knight
- Posts: 112
- Joined: Wed Jul 31, 2013 3:33 pm
He's my issue:
i'm downloading the current S&P 500 from CSI. It includes Facebook Inc. (FB). FB was not added to the S&P until Dec 21st 2013, however, in a backtest I entered the trade on Dec 16th 2013 which would be inaccurate. So I was wondering if I code to ignore FB when date is <20131221 - would this suffice as performing a surviorship free portfolio (I realize i'd have to do this for numerous securities but I need my backtests to be as accurate as possible)
i'm downloading the current S&P 500 from CSI. It includes Facebook Inc. (FB). FB was not added to the S&P until Dec 21st 2013, however, in a backtest I entered the trade on Dec 16th 2013 which would be inaccurate. So I was wondering if I code to ignore FB when date is <20131221 - would this suffice as performing a surviorship free portfolio (I realize i'd have to do this for numerous securities but I need my backtests to be as accurate as possible)
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas
That is correct, since your aim is to recreate the historical membership of an index, you have to know the members of the index for each date in your test and communicate that to TB. One way to do this is to "hard code" a line (sometimes more than one) for each stock setting the dates it is allowed to trade. Another is to create an external file listing the stocks and dates of membership, and read that into Blox.
-
- Roundtable Knight
- Posts: 112
- Joined: Wed Jul 31, 2013 3:33 pm
Does Tradingblox get the active/inactive information from the stockInfo.txt? Also, can this be programming into the script, such as Before Test, X, Y and Z stock is inactive?Jake Carriker wrote:In order to avoid survivorship bias, you shouldn't need a special script. You will need a survivorship bias free database with the issues that no longer trade marked as inactive in the stock dictionary. The current release of Trading Blox exits stocks marked as inactive in historical testing on the close of the final bar if the system holds a position at that time.
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas