Overall Statistics
Total Orders
4
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Start Equity
100000
End Equity
100026.9
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
$26000000.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):
        if self.time.day == 1 and self.time.hour == 9 and self.time.minute == 31:
            self.limit_if_touched_order("SPY", 10, 429.0, 428.95)

        elif self.time.day == 2 and self.time.hour == 9 and self.time.minute == 31:
            self.limit_if_touched_order("SPY", -10, 431.7, 431.75)
            self.limit_if_touched_order("SPY", 10, 431.7, 400)
            self.limit_if_touched_order("SPY", 10, 400, 400)