I try to understand how the algorithm framework works. For this purpose, I experiment with boot camp code called Liquid Value Stocks. Several questions arose during this process.

  1. How to set the portfolio construction model to rebalance only once a month? Unfortunately, I did not find any example that would show me how to do this in a algorithm framework environment. In a given lesson, the portfolio rebalances on a daily basis.
  2. How to properly monitor the number of open positions? I just want to make sure I added the correct code. In this case, the number of open positions seems to be equal to the number of insights. def OnData(self, data): self.Plot("Positions", "Number of open positions", len(self.Portfolio))

     

  3. Why does the algorithm constantly increase the number of insights? I would expect 10 insights for long positions and 10 insights for short positions to be issued at the beginning of each month. So a total of 20 insights (positions). That's not happening. Instead, the number of insights grows each month.

Thank you

..