| Overall Statistics |
|
Total Trades 3 Average Win 0% Average Loss 0.00% Compounding Annual Return 0.820% Drawdown 9.100% Expectancy -1 Net Profit 0.412% Sharpe Ratio 0.084 Probabilistic Sharpe Ratio 25.805% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.019 Beta 0.218 Annual Standard Deviation 0.099 Annual Variance 0.01 Information Ratio -0.325 Tracking Error 0.355 Treynor Ratio 0.038 Total Fees $3.00 |
class ModulatedHorizontalProcessor(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020, 1, 30) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.stock = self.AddEquity("SPY", Resolution.Minute)
self.x = 1
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 self.x is 2: return
self.x += 1
self.Debug(self.CalculateOrderQuantity(self.stock.Symbol, .25))
self.Debug(self.CalculateOrderQuantity(self.stock.Symbol, .5))
self.SetHoldings(self.stock.Symbol, .25)
self.Debug(self.Portfolio[self.stock.Symbol].Quantity)
self.SetHoldings(self.stock.Symbol, .5)
self.SetHoldings(self.stock.Symbol, .25, True)
# self.MarketOrder(self.stock.Symbol, self.CalculateOrderQuantity(self.stock.Symbol, .25))
# self.MarketOrder(self.stock.Symbol, self.CalculateOrderQuantity(self.stock.Symbol, .25))
self.Debug(self.Portfolio[self.stock.Symbol].Quantity)