Back to Community
How do I get sector for a stock right before trading?

Hello all,

How do i get the sector for an individual stock prior to trading it?

Thanks,

ted

1 response

Looks like I need to use Bound Columns. Once I've bound the morningstar_sector_code into the pipeline as the "sector" column, its part of the context. I can then access it in the rebalance function as:

context.output.get_value(symbol('AAPL'), 'sector')