Current Positions shows same position with 2 different SIDS

Brian - I ran a report this morning on my current positions and it's listing the same security twice under two different SIDS (FIBBG00L1KN476 and FIBBG00NNN9QQ8). It's the same position. I don't know if this matters but how do I resolve duplicate SIDS for the same security showing up in my databases / universes? Please advise. Thanks.

What function/command are you running where this shows up?

'''''
from quantrocket.account import download_account_portfolio
import io
f = io.StringIO()
download_account_portfolio(f)
portfolio = pd.read_csv(f, parse_dates=["LastUpdated"])
portfolio.tail(50)
''''''''

This stock received a new Sid (which can happen for various reasons) but it kept the same ibkr_ConId (IBKR's unique contract identifier). When you query the download_account_portfolio, IBKR returns the positions identified by ConIds, which QuantRocket then matches to the corresponding Sid. Since there are two Sids for this stock, a single position gets matched to both and shows up twice in the output.

This isn't ideal and could be improved by QuantRocket only matching to Sids that aren't delisted. That improvement will be included in the next release.

Since download_account_portfolio is only intended for viewing your portfolio manually and isn't used internally by Zipline or Moonshot or any other parts of QuantRocket, this is only a cosmetic issue, so you can safely disregard it for now. The only way to get rid of it immediately would be to delete the old sid in the securities master database, but it's better/safer to just ignore it for now.

1 Like

Got it. Thank you.