Overall Statistics |
Total Orders 7 Average Win 0% Average Loss -4.14% Compounding Annual Return -18.540% Drawdown 63.000% Expectancy -1 Start Equity 100000 End Equity 77242.48 Net Profit -22.758% Sharpe Ratio -0.139 Sortino Ratio -0.174 Probabilistic Sharpe Ratio 8.197% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.135 Beta -2.224 Annual Standard Deviation 0.502 Annual Variance 0.252 Information Ratio -0.29 Tracking Error 0.558 Treynor Ratio 0.031 Total Fees $8.79 Estimated Strategy Capacity $220000000.00 Lowest Capacity Asset TSLA UNU3P8Y3WFAD Portfolio Turnover 0.49% |
# region imports from AlgorithmImports import * # endregion class HyperActiveRedOrangeAlpaca(QCAlgorithm): def Initialize(self): self.SetStartDate(2023, 1, 29) self.SetCash(100000) self.tsla = self.AddEquity("TSLA", Resolution.Minute).Symbol # Initialize RSI indicator with a period of 14 (default) self.rsi = self.RSI(self.tsla, 14, MovingAverageType.Wilders, Resolution.Minute) self.is_invested = False def OnData(self, data: Slice): if not self.rsi.IsReady: return current_rsi = self.rsi.Current.Value if not self.Portfolio.Invested and current_rsi != 99: self.SetHoldings(self.tsla, -1) # Short TSLA self.is_invested = True elif self.is_invested and current_rsi == 1: self.Liquidate(self.tsla) # Exit short position self.is_invested = False