Overall Statistics
Total Trades
211
Average Win
0.00%
Average Loss
0%
Compounding Annual Return
0.000%
Drawdown
0.000%
Expectancy
0
Net Profit
0.005%
Sharpe Ratio
0.254
Probabilistic Sharpe Ratio
0.098%
Loss Rate
0%
Win Rate
100%
Profit-Loss Ratio
0
Alpha
-0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.66
Tracking Error
0.144
Treynor Ratio
0.05
Total Fees
$210.00
Estimated Strategy Capacity
$3900000000.00
Lowest Capacity Asset
RRF R735QTJ8XC9X
# region imports
from AlgorithmImports import *
# endregion

class FatBlueLion(QCAlgorithm):

    def Initialize(self):
        self.end_date = datetime(2022,6,10)
        
        self.SetStartDate(2010, 1, 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.end_date:
            self.Log(f"LIST OF REITS:")
            self.Log(self.list_of_reits)
        if self.Time < self.rebalance: return
        self.rebalance = self.Time + timedelta(self.rebalance_days)
        
        
        for symbol in self.to_buy:
            if not self.Portfolio[symbol].Invested:
                self.Buy(symbol, 1)