| Overall Statistics |
|
Total Trades 117 Average Win 0.24% Average Loss -0.45% Compounding Annual Return -87.592% Drawdown 8.400% Expectancy -0.287 Net Profit -8.044% Sharpe Ratio -6.013 Probabilistic Sharpe Ratio 0% Loss Rate 53% Win Rate 47% Profit-Loss Ratio 0.53 Alpha -0.517 Beta 0.399 Annual Standard Deviation 0.129 Annual Variance 0.017 Information Ratio -0.698 Tracking Error 0.178 Treynor Ratio -1.946 Total Fees $117.00 Estimated Strategy Capacity $6300000.00 Lowest Capacity Asset AAPL R735QTJ8XC9X |
### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
self.SetStartDate(2022, 4, 15) #Set Start Date
self.SetEndDate(2022, 4, 30) #Set End Date
self.SetCash(5000) #Set Strategy Cash
self.AddEquity("AAPL", Resolution.Minute)
self.rsi = self.RSI("AAPL", 14, MovingAverageType.Exponential)
def OnData(self, data):
if not self.rsi.IsReady:
return
if self.rsi.Current.Value < 30 and self.Portfolio["AAPL"].Invested <= 0:
self.SetHoldings("AAPL", 1.0)
if self.rsi.Current.Value > 60:
self.Liquidate()