Hi All,

I don't have luck on my strategy. Hope that anyone can give me some insights of it.

My strategy is that, i will use coarse universe to get several stocks with resolution=minutes. I will then fire the insight at first hour bar for the stocks.

 

For the insight i fired, i will buy 5% of my total portfolio and hold for 30days

Here are my insights (p.s. backtesting start = 3Jan2022 / end = 5Jan2022). Period is set to be 30days

     

222952_1675970121.jpg

As i don't want to rebalance daily, therefore, i set both of them are false. Problem: i found that no order can be triggered. 

        # i managed to create my own fixed weighting portfolio construction model that will allocate 5% for an insight
        self.SetPortfolioConstruction(FixedWeightingPortfolioConstructionModel())

        self.Settings.RebalancePortfolioOnInsightChanges = False
        self.Settings.RebalancePortfolioOnSecurityChanges = False
        self.SetExecution(ImmediateExecutionModel()) 
        

 

Then, i tried to play around with the settings, and enable the rebalance portfolio on security change 

        self.Settings.RebalancePortfolioOnInsightChanges = False
        self.Settings.RebalancePortfolioOnSecurityChanges = True

 

After setup like that, i can see order placed. 

Problems: I am not expecting a sell order for SYTA on 5Jan as the insight set to be 30days. and i am not expecting a rebalance for NYC at 2nd row, and a sell of NYC on 4th row. 

222952_1675970364.jpg

I changed the Rebalance setup with Insight changes = true 

        self.Settings.RebalancePortfolioOnInsightChanges = True
        self.Settings.RebalancePortfolioOnSecurityChanges = False

The orders are as below, same as above.

222952_1675970036.jpg

 

I am expecting the following orders

2022-01-03 NYC Buy Market 5% of portfolio

2022-01-04 NYC Buy Market 5% of portfolio

2022-01-04 SYTA Buy Market 5% of portfolio

2022-01-05 NYC Buy Market 5% of portfolio

2022-01-05 TBPH Buy Market 5% of portfolio

 

May i know what's wrong with my setting?

The problems so far are 

  1. insight period=30days doesn't hold the stock for 30days, it will sold in the next day
  2. if i disable rebalance, it won't make any purchase
  3.  How can i purchase the stock daily and hold for 30days without rebalancing? Should i give up the portfolio construction and using insight but directly place the order inside ondata event?

 

Thanks for advise