nautechsystems/nautilus_trader · error
Trade bin missing low price for
Error message
Trade bin missing low price for {instrument_id} What it means
Same guard family as the missing open/high/close checks in parse_trade_bin: the BitMEX trade bin's `low` field is null so no valid Bar can be built. The library treats OHLC as mandatory for Bar construction and fails fast with an anyhow error naming the instrument.
Solutions
- Exclude the current unfinalized bin from the requested bar range.
- Refetch the bin after the bin interval elapses; finalized bins carry all OHLC values.
- Pre-filter bins with null OHLC fields before parsing.
- Verify the symbol/timeframe combination is valid on BitMEX (valid tradeBin endpoints).
Example fix
// before
let low = bin.low.ok_or_else(|| anyhow::anyhow!("Trade bin missing low price for {instrument_id}"))?;
// after
let Some(low) = bin.low else {
log::warn!("Skipping incomplete bin for {instrument_id}");
return Ok(None);
}; Defensive patterns
Strategy: validation
Validate before calling
if bin.low.is_none() { /* skip or refetch bin */ } Type guard
fn has_ohlc(bin: &BitmexTradeBin) -> Option<(f64, f64, f64, f64)> {
Some((bin.open?, bin.high?, bin.low?, bin.close?))
} Try / catch
let bar = parse_trade_bin(&bin, instrument_id, precision)
.map_err(|e| { log::warn!("incomplete bin skipped: {e}"); e })
.ok(); Prevention
- Request only closed bins for historical analysis.
- Treat null OHLC fields in BitMEX responses as expected, not exceptional.
- Add a completeness filter upstream of the parser.
When it happens
Trigger: request_bars processing a trade bin JSON where `low` is null — e.g. an in-progress bin streamed/fetched before the exchange computed the low, or a partial REST response.
Common situations: Polling the newest bin; BitMEX returning degraded/partial data during outages; symbols with thin liquidity where fields may be momentarily absent.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Trade bin missing close price for
- Trade bin missing high price for
- BitMEX does not support
- Fill missing both trd_match_id and exec_id
- Only EXTERNAL aggregation bars are supported
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/d501e128c2e38a01.
Report an issue: GitHub.
Appendix: source
Thrown at crates/adapters/bitmex/src/http/parse.rs:745
/// Returns an error when required OHLC fields are missing from the payload.
pub fn parse_trade_bin(
bin: &BitmexTradeBin,
instrument: &InstrumentAny,
bar_type: &BarType,
ts_init: UnixNanos,
) -> anyhow::Result<Bar> {
let instrument_id = bar_type.instrument_id();
let price_precision = instrument.price_precision();
let open = bin
.open
.ok_or_else(|| anyhow::anyhow!("Trade bin missing open price for {instrument_id}"))?;
let high = bin
.high
.ok_or_else(|| anyhow::anyhow!("Trade bin missing high price for {instrument_id}"))?;
let low = bin
.low
.ok_or_else(|| anyhow::anyhow!("Trade bin missing low price for {instrument_id}"))?;
let close = bin
.close
.ok_or_else(|| anyhow::anyhow!("Trade bin missing close price for {instrument_id}"))?;
let open = Price::new(open, price_precision);
let high = Price::new(high, price_precision);
let low = Price::new(low, price_precision);
let close = Price::new(close, price_precision);
let (open, high, low, close) =
normalize_trade_bin_prices(open, high, low, close, &bin.symbol, Some(bar_type));
let volume_contracts = normalize_trade_bin_volume(bin.volume, &bin.symbol);
let volume = parse_contracts_quantity(volume_contracts, instrument);
let ts_event = UnixNanos::from(bin.timestamp);
Ok(Bar::new(
*bar_type, open, high, low, close, volume, ts_event, ts_init,View on GitHub (pinned to 18893faf8b)