| Overall Statistics |
|
Total Orders 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Start Equity 10000.00 End Equity 10000 Net Profit 0% Sharpe Ratio 0 Sortino 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 1.291 Tracking Error 0.369 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset Portfolio Turnover 0% Drawdown Recovery 0 |
from AlgorithmImports import *
class BtcUsdtGapRepro(QCAlgorithm):
def initialize(self):
self.set_start_date(2022, 3, 5)
self.set_end_date(2022, 3, 9)
self.set_cash(10000)
self.set_time_zone(TimeZones.UTC)
self.symbol = self.add_crypto_future(
"BTCUSDT", Resolution.HOUR, Market.BINANCE, fill_forward=False
).symbol
self.count = 0
self.last_time = None
def on_data(self, slice: Slice):
self.count += 1
has_bar = self.symbol in slice.bars
bar_time = slice.bars[self.symbol].end_time if has_bar else None
self.log(f"ONDATA time={self.time} has_bar={has_bar} bar_end_time={bar_time}")
self.last_time = self.time
def on_end_of_algorithm(self):
self.log(f"TOTAL_ONDATA_CALLS={self.count} LAST_TIME={self.last_time} ALGO_END={self.end_date}")