Overall Statistics
Total Trades
25
Average Win
0.00%
Average Loss
-0.01%
Compounding Annual Return
8.955%
Drawdown
0.100%
Expectancy
-0.749
Net Profit
0.094%
Sharpe Ratio
5.427
Probabilistic Sharpe Ratio
69.794%
Loss Rate
83%
Win Rate
17%
Profit-Loss Ratio
0.51
Alpha
0.023
Beta
-0.043
Annual Standard Deviation
0.011
Annual Variance
0
Information Ratio
3.656
Tracking Error
0.262
Treynor Ratio
-1.42
Total Fees
$25.00
Estimated Strategy Capacity
$42000000.00
Lowest Capacity Asset
SPY R735QTJ8XC9X
class EmotionalGreenBaboon(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 1, 26)
        self.SetEndDate(2021,1,31)
        self.SetCash(100000) 
        self.spy = self.AddEquity("SPY", Resolution.Minute).Symbol
        self.min = self.MIN(self.spy,5,Resolution.Minute,Field.Low)
        self.SetWarmup(5)
        self.tp = None
        self.sl = None

    def OnData(self, data):
        if self.IsWarmingUp:return 
        if not self.Portfolio.Invested:
           SL =  self.min.Current.Value
           TP = (data.Bars[self.spy].Close - SL) * 1.5 + data.Bars[self.spy].Close
           self.MarketOrder(self.spy,10)
           self.sl = self.StopMarketOrder(self.spy, -10, SL)
           self.tp = self.LimitOrder(self.spy,-10,TP)
    def OnOrderEvent(self, orderEvent):
        
        
        if not (orderEvent.Status == OrderStatus.Filled):
            return
        
        if (self.tp is None) or (self.sl is None): 
            return
        
        if self.tp.OrderId == orderEvent.OrderId: 
            self.sl.Cancel()
            return
            
        if self.sl.OrderId == orderEvent.OrderId: 
            self.tp.Cancel()

            return