Can one use order() or otherwise set the per existing portfolio in initialization code?
When I tried, order() came back with runtime error when used in initialize(). What I am trying to do is start not from a blank portfolio with some amount of cash in it but with a portfolio that already has securities. This would be usefule when:
- Using quantopian for analysis while manually entering trades in another brokerage account.
- Using live trading in quantopian trading one algorithm, then switching to another algorithm.
One could run one algorithm live while thinking we are in a bull market, then switching to another for bear market. A bit like manual gear shift in a car.