So I have an existing portfolio that I'm trying to run a QC algorithm in conjunction with.

I've tried using self.Debug() to print some of the portfolio details just to check that the data is being stored correctly but nothing seems to appear in the console. It connects and everything but I don't see the debug messages that ought to appear automatically. 

Part of the difficulty is that I'm trying to work with an existing portfolio from IB. This makes it a bit harder to initialise something similar for testing without coding up purchase orders. 

The other thing I'm not sure about is option securities. I add all the existing option contract symbols to the universe using AddOptionContract and store the resulting securities.option.option object. Then I add the option pricing model to each one individually. The whole thing of how securities objects work is relatively under documented in terms of the fact it seems pretty important to how the whole underlying OnData command works but it's unclear what's going on. Any pointers in that direction or advice would be appreciated.