Overall Statistics |
Total Trades 3 Average Win 0% Average Loss 0% Compounding Annual Return 19.227% Drawdown 12.800% Expectancy 0 Net Profit 30.070% Sharpe Ratio 1.117 Probabilistic Sharpe Ratio 52.744% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0.833 Annual Standard Deviation 0.123 Annual Variance 0.015 Information Ratio -0.406 Tracking Error 0.067 Treynor Ratio 0.166 Total Fees $4.52 Estimated Strategy Capacity $8500000.00 Lowest Capacity Asset BND TRO5ZARLX6JP |
#region imports from AlgorithmImports import * import datetime from io import StringIO #import os import pandas as pd import traceback #import typing #import QuantConnect #import requests #import operator #import math #from SmartRollingWindow import * #endregion class OptimizedTransdimensionalReplicator(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 9, 19) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.AddEquity("SPY", Resolution.Minute) self.AddEquity("BND", Resolution.Minute) self.AddEquity("AAPL", Resolution.Minute) try: data = StringIO(self.Download("https://www.dropbox.com/s/r1jwm0bhqsb4c02/Tips_20220304.csv?dl=1")) self.df1 = pd.read_csv(data) self.df2 = self.df1.groupby('Symbol') for name, group in self.df2: self.Log(name) #self.Log(group) except Exception: ex = traceback.format_exc print(ex) #tickers = SelectSymbols() #self.symbols = [Symbol.Create(ticker, SecurityType.Equity, Market.USA)] #self.SetUniverseSelection(FineFundamentalUniverseSelectionModel(self.CoarseSelectionFunction, self.FineSelectionFunction)) #self.UniverseSettings.Resolution = Resolution.Daily def OnData(self, data): if not self.Portfolio.Invested: self.SetHoldings("SPY", 0.33) self.SetHoldings("BND", 0.33) self.SetHoldings("AAPL", 0.33) def CoarseSelectionFunction(self, coarse): return self.symbols def FineSelectionFunction(self, fine): return self.symbols