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 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 |
class ResistanceTransdimensionalCircuit(QCAlgorithm): def Initialize(self): self.SetStartDate(2018, 1, 20) # Set Start Date self.SetEndDate(2018, 1, 26) self.SetCash(100000) # Set Strategy Cash universe = ["WTICOUSD"] symbols = [Symbol.Create(x, SecurityType.Cfd, Market.Oanda) for x in universe] self.SetUniverseSelection(ManualUniverseSelectionModel(symbols)) self.symbols = {} def OnSecuritiesChanged(self, changes): for security in changes.AddedSecurities: symbol = security.Symbol if symbol not in self.symbols: self.symbols[symbol] = SymbolData(self, symbol) class SymbolData: def __init__(self, algorithm, symbol): self.algorithm = algorithm self.symbol = symbol customconsolidator = QuoteBarConsolidator(self.Custom) self.algorithm.SubscriptionManager.AddConsolidator(symbol, customconsolidator) customconsolidator.DataConsolidated += self.OnDataConsolidated def OnDataConsolidated(self, sender, bar): self.algorithm.Debug(f"Custom Consolidated: {bar.Symbol}, @ {bar.Time} -> {bar.EndTime} with OHLC: {bar.Open}, {bar.High}, {bar.Low}, {bar.Close}") def Custom(self, dt): period = timedelta(hours = 23) start = dt.replace(hour = 18) if start > dt: start -= period return CalendarInfo(start, period)