Overall Statistics |
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe 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.231 Tracking Error 0.443 Treynor Ratio 0 Total Fees $0.00 |
import sys import traceback class TachyonVerticalRegulators(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 12, 2) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.AddEquity("SPY", Resolution.Minute) def OnData(self, data): try: 1/0 except: exc_type, exc_value, exc_tb = sys.exc_info() # exc_type is the error type (i.e. ZeroDivision) # exc_value is the message of the error # exc_tb is the error traceback # This will format the error in a list formatted_error = traceback.format_exception(exc_type, exc_value, exc_tb) # You can log the whole thing, or just exc_value if you just want the type of error self.Log('{0}{1}{2}'.format(formatted_error[0], formatted_error[1], formatted_error[2]))