Live Trading Account Allocation Adjustments

Brian - in the documentation for Zipline strategies it indicates a specific starting capital $ amount should be referenced in the Allocations YAML file. In the Moonshot section it shows where a % of the accounts Net Liquidation Value can be used for Allocations in the YAML file.

  1. Can a % of the accounts Net Liquidation Value also be used for Zipline strategies?
  2. If in the future I want to shift my capital allocation weightings across strategies do I just have to change the allocation % in the YAML file? What happens if the strategies have different Rebalance periods? Will the blotter reconcile all of this or do I have to do something manually?

Thanks.

  1. Zipline doesn't support a % allocation in the yaml file, only a dollar allocation.
  2. For Zipline live trading, the impact of the dollar allocation in the allocations yaml file is fairly limited and depends on your strategy. Your live strategy's PNL to date (from the blotter) is added to the starting capital (defined in the YAML file) to get the "virtual" portfolio value for your Zipline strategy. In some cases, the virtual portfolio value may be irrelevant because it's not used. One of the few places it is used is if you use order_target_percent, as the shares will be calculated as a percent of the virtual portfolio value. Changing the allocation will affect the virtual portfolio value and thus would affect the calculation of shares required by order_target_percent. But changing the allocation would not automatically adjust your portfolio.

@Brian got it regarding % allocations in Zipline. So if I'm investing $100 dollars across 4 strategies and I start with $25 in each strategy but in the future decide I want to increase my capital allocation to one strategy and decrease the allocation to another how would I do that? Do I have to close positions and the re-initiate each strategy?

You could do it that way. Or you could adjust your code as desired for placing future orders in the correct size, and adjust the existing positions using manual orders placed through the blotter. As long as the manual orders reflect the order ref of your strategy, your strategy will treat those orders and executions as if they came from Zipline.

@Brian when you say adjust your code for future orders how would that work if I'm using "order_target_percent"? What happens if I just adjust the staring capital number in the Zipline YAML file after the strategy has already been trading live? Thanks.

If you only use order_target_percent and you double the starting capital, it will approximately double the position sizes the next time order_target_percent is used, with the caveat that the target percent is based not on starting capital but portfolio value, which is starting capital plus PNL to date. So it might be more or less than double depending on the PNL.

This answer should be accurate for a simple, straightforward case of using order_target_percent. But I'm hedging a little because there can be gotchas depending on the specific details of the strategy, given the many ways a strategy can implement its order and rebalancing logic. The safest bet is to understand how starting capital affects order_target_percent, as I've described, then think through your order logic and the implications that will follow from changing the starting capital.