Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
0
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
from clr import AddReference
AddReference("QuantConnect.Research")
from QuantConnect.Research import QuantBook

class UncoupledHorizontalSplitter(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 7, 11)  # Set Start Date
        self.SetEndDate(2020, 7, 14)
        self.SetCash(100000)  # Set Strategy Cash
        
        self.AddUniverse(self.CoarseFilter)
    
    def CoarseFilter(self, coarse):
        qb = QuantBook()
        usEquities = [c for c in coarse if c.Symbol.ID.Market.lower() == "usa" and c.Symbol.SecurityType == SecurityType.Equity and c.HasFundamentalData]
        usEquities.sort(key=lambda c: c.DollarVolume, reverse=True)
        for c in usEquities[:10]:
            self.Debug(c.Symbol.Value)
            oi = qb.GetFundamental(c.Symbol, "FinancialStatements.IncomeStatement.OperatingIncome", datetime(2020,12,1), datetime(2020,12,3))
            self.Debug(oi)
            for tup in oi.itertuples():
                self.Debug(f"{tup.Index} {tup[1].Value} {tup[1].ThreeMonths}")
        
        self.Quit()
        return []