Overall Statistics
Total Trades
208
Average Win
0%
Average Loss
0%
Compounding Annual Return
-0.021%
Drawdown
0.000%
Expectancy
0
Net Profit
-0.001%
Sharpe Ratio
-5.348
Probabilistic Sharpe Ratio
1.665%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
3.038
Tracking Error
0.243
Treynor Ratio
-1.428
Total Fees
$208.00
Estimated Strategy Capacity
$1200000000.00
Lowest Capacity Asset
HRE R735QTJ8XC9X
# region imports
from AlgorithmImports import *
# endregion

class FatBlueLion(QCAlgorithm):

    def Initialize(self):
        self.end_date = datetime(2022,6,10)
        
        self.SetStartDate(2022, 6, 1)  # Set Start Date
        self.SetCash(100_000_000)  # Set Strategy Cash

        self.UniverseSettings.Resolution = Resolution.Daily
        self.AddUniverse(self.get_coarse, self.get_fine)

        self.list_of_reits = []
        self.to_buy = []

        self.rebalance = self.Time
        self.rebalance_days = 30
        
        self.SetWarmup(timedelta(1))
    
    def get_coarse(self, coarse):
        if self.Time < self.rebalance:
            return Universe.Unchanged
        
        # selected = [x.Symbol for x in coarse if x.HasFundamentalData]
        selected = [x.Symbol for x in coarse]
        
        return selected
    
    def get_fine(self, fine):
        symbols = [x.Symbol for x in fine if (x.CompanyReference.IsREIT == 1) & (x.SecurityReference.IsPrimaryShare == 1)]
        self.to_buy = symbols
        self.list_of_reits = list(set(symbols + self.list_of_reits))
        return symbols


    def OnData(self, data: Slice):
        if self.IsWarmingUp: return
        if self.Time < self.rebalance: return
        self.rebalance = self.Time + timedelta(self.rebalance_days)

        for symbol in self.Portfolio.Keys:
            if self.Portfolio[symbol].Invested:
                self.Liquidate(symbol)
                self.to_buy = [x for x in self.to_buy if x != symbol]
                
        for symbol in self.to_buy:
            if not self.Portfolio[symbol].Invested:
                self.Buy(symbol, 1)