Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
46.535%
Drawdown
7.000%
Expectancy
0
Net Profit
22.855%
Sharpe Ratio
3.171
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.908
Beta
-26.099
Annual Standard Deviation
0.123
Annual Variance
0.015
Information Ratio
3.006
Tracking Error
0.123
Treynor Ratio
-0.015
Total Fees
$2.05
class VerticalUncoupledCompensator(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Minute)


    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''

        if not self.Portfolio.Invested:
            self.SetHoldings("SPY", 1)
            
    # Override the base class event handler for order events
    def OnOrderEvent(self, orderEvent):
        order = self.Transactions.GetOrderById(orderEvent.OrderId)
        self.Log("{0}: {1}: {2}".format(self.Time, order.Type, orderEvent))