Overall Statistics
Total Orders
2
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Start Equity
100000
End Equity
99970.5
Net Profit
0%
Sharpe Ratio
0
Sortino 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
$2.00
Estimated Strategy Capacity
$18000000.00
Lowest Capacity Asset
SPY R735QTJ8XC9X
Portfolio Turnover
4.30%
from AlgorithmImports import *

class HipsterYellowGreenHippopotamus(QCAlgorithm):

    def initialize(self):
        self.set_start_date(2021, 7, 1)
        self.set_end_date(2021, 7, 3)
        self.set_cash(100000)
        self.universe_settings.data_normalization_mode = DataNormalizationMode.RAW
        self.add_equity("SPY")

    def on_data(self, data):
        d = data.quote_bars["SPY"]
        if self.time.day == 1 and self.time.hour == 9 and self.time.minute == 31:
            self.stop_limit_order("SPY", -10, 428.95, 429.00)

        elif self.time.day == 2 and self.time.hour == 9 and self.time.minute == 31:
            self.stop_limit_order("SPY", 10, 431.80, 431.75)