How to handle delisted symbol
Author: LenMoz
Creation Date: 1/27/2015 12:16 PM
profile picture

LenMoz

#1
A delisted symbol has several consequences in WealthLab. If a strategy backtest is holding the symbol, it may never be sold, causing a distortion of performance, and a reduction of buying power that would not happen in live trading. A paper account driven by Strategy Monitor may have a stranded holding. I have one now, BIRT, which prompted this question.

1. Is there an easy way to identify delisted symbols across all portfolios? One way (for Fidelity Provider) is the end of the "LastUpdateLog.txt" file (Provider does not recognize symbol messages). The Data Tool can get rid of them (Also remove symbols with last date before), but they are not identified(?)(not sure, never tried this).

2. How can the holdings of the symbol be reconciled in a paper account?
profile picture

Cone

#2
1. Data Manager > Fidelity Data tab > Turn on Symbol Management
On the right, adjust the "Error(s) Before Quarantine"

Here's some code I use in strategies that I trade so that I don't unknowingly use old data:
CODE:
Please log in to see this code.


2. Do you mean to exit a trade for a symbol that no longer trades? It's not supported, but you could add a HistoricalTrade record to TradeHistory.xml (close WLP and do a backup first!).





profile picture

Eugene

#3
QUOTE:
1. Is there an easy way to identify delisted symbols across all portfolios? One way (for Fidelity Provider) is the end of the "LastUpdateLog.txt" file (Provider does not recognize symbol messages).

For any other providers (non-Fidelity data), I'd consider relying on a web service. If such web service, be it paid or free, doesn't exist, one could resort to parsing the returned web page of a financial website. To illustrate my line of thinking, normally a site like Yahoo! Finance would return quotes and other information for a listed symbol. If it suddenly stops doing this, the symbol might have been delisted.
profile picture

LenMoz

#4
In the case of BIRT, I owned the stock in my Fidelity account so I know exactly what happened in a live account.. My position was frozen for about three trading days and then I got a "Merger Payout" transaction (cash with no commission or fees) and the position was simultaneously removed.

QUOTE:
It's not supported, but you could add a HistoricalTrade record to TradeHistory.xml (close WLP and do a backup first!).

Now that you've got me looking at the files... To simulate what happened in my live account in my paper account, more than Trade History might need adjustment. I'm thinking that I would similarly have to make two manual adjustments to Accounts.xml, the first to remove the <AccountPosition> tag for the symbol, and the second to adjust the values of <AvailableCash>, <BuyingPower>, and <AccountValue>. What's the definition of those three? Am I missing anything?

Any automation you might want to bring to bear on this would be helpful, like a "retroactive trade at price" ticket.
profile picture

LenMoz

#5
QUOTE:
Here's some code I use in strategies that I trade so that I don't unknowingly use old data

Thanks. I've added that to the script I use to check that Fidelity fundamentals are being updated - two checks for the price of one.
profile picture

Cone

#6
You're right. Adding the closing trade is actually the least important thing to do and not even required.

It looks to me like:
<AccountValue> is the starting cash value of the [paper] account
<BuyingPower> = <AvailableCash> for a cash [paper] account

So, you just have to remove the position and update the <AvailableCash> and <BuyingPower>. (Worked for me)
profile picture

LenMoz

#7
QUOTE:
<AccountValue> is the starting cash value of the [paper] account
Mmmm Account Value looks more like current Cash plus Positions value for my account

CODE:
Please log in to see this code.
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).