| Overall Statistics |
|
Total Trades 4713 Average Win 0.07% Average Loss -0.07% Compounding Annual Return -20.461% Drawdown 15.100% Expectancy -0.067 Net Profit -10.881% Sharpe Ratio -1.556 Probabilistic Sharpe Ratio 2.233% Loss Rate 52% Win Rate 48% Profit-Loss Ratio 0.95 Alpha -0.201 Beta 0.298 Annual Standard Deviation 0.129 Annual Variance 0.017 Information Ratio -0.664 Tracking Error 0.302 Treynor Ratio -0.674 Total Fees $4713.00 |
class QuantumOptimizedProcessor(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2019, 10, 20) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.spy = self.AddEquity("SPY").Symbol # Add spy data
self.ticket = None # Flag for position status
def OnData(self, data):
# If not in a position
if self.ticket is None:
# Enter position
self.ticket = self.MarketOrder(self.spy, 100)
elif self.UtcTime >= self.ticket.Time + timedelta(minutes = 20): # Atleast 20 mins since fill
# Exit position
self.Liquidate(self.spy)
self.ticket = None