Overall Statistics
Total Orders
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Start Equity
100000
End Equity
100000
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
-4.038
Tracking Error
0.07
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
Portfolio Turnover
0%
Drawdown Recovery
0
# MWN (Micro Ultra U.S. Treasury Bond, CBOT) live-data probe.
# The chain has no universe files in the cloud store, so contracts are added
# one by one from their expiry ticker.
from AlgorithmImports import *


class MwnLiveDataCheck(QCAlgorithm):

    TICKERS = ["MWNZ26", "MWNH27", "MWNM27"]

    def initialize(self):
        self.set_start_date(2026, 8, 20)
        self.set_cash(100000)

        self.counts = {}
        for ticker in self.TICKERS:
            symbol = SymbolRepresentation.parse_future_symbol(ticker)
            self.add_future_contract(symbol, Resolution.MINUTE, extended_market_hours=True)
            self.counts[symbol] = 0
            self.log(f"INIT: {ticker} -> {symbol.value} expiry={symbol.id.date:%Y-%m-%d %H:%M}")

        self.schedule.on(self.date_rules.every_day(), self.time_rules.every(timedelta(minutes=30)),
                         self.report)

    def on_data(self, slice):
        for symbol in self.counts:
            bar = slice.bars.get(symbol) or slice.quote_bars.get(symbol)
            if bar is None:
                continue
            if self.counts[symbol] == 0:
                self.log(f"FIRST DATA {symbol.value} @ {self.time} close={bar.close}")
            self.counts[symbol] += 1

    def report(self):
        counts = {symbol.value: count for symbol, count in self.counts.items()}
        self.set_runtime_statistic("MWN bars", str(sum(counts.values())))
        self.set_runtime_statistic("Counts", str(counts))
        self.log(f"MWN bars={sum(counts.values())} {counts}")