Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
924.741%
Drawdown
2.400%
Expectancy
0
Net Profit
2.583%
Sharpe Ratio
4.278
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.477
Beta
155.467
Annual Standard Deviation
0.39
Annual Variance
0.152
Information Ratio
4.245
Tracking Error
0.39
Treynor Ratio
0.011
Total Fees
$2.01
class ResistanceHorizontalCircuit(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)  # Set Start Date
        self.SetEndDate(2019, 1, 5)
        self.SetCash(100000)  # Set Strategy Cash
        security = self.AddEquity("SPY", Resolution.Daily)
        
        # set buying power model
        security.MarginModel = BuyingPowerModel(requiredFreeBuyingPowerPercent = 0.05)


    def OnData(self, data):
        if not self.Portfolio.Invested:
           self.SetHoldings("SPY", 1)
    
    def OnOrderEvent(self, orderEvent):
        self.Log(orderEvent)
        self.Log(f'cash reserved: {self.Portfolio.Cash}')