Converting SID to SYMBOL in Research

when printing the orders history of an algorithm within Notebooks, is there a way to convert SID to Symbol?

2 responses

Hi Pej,

You can use the symbols function to convert a SID to an Asset object. For example, symbols(24) will return Equity(24 [AAPL]). To get the ticker alone, you can use .symbol -- for example, symbols(24).symbol will return AAPL.

I've attached an example so you can see how this works in practice. Hope this helps!

12
p = bt.positions[["amount", "cost_basis", "last_sale_price", "sid"]]