DXLinkStreamer._channel_request hardcodes "contract": "AUTO" in the CHANNEL_REQUEST message for every event type, including Candle. For Candle subscriptions with a start_time, this means the server never sends historical backfill — it responds with a single FEED_DATA event carrying eventFlags=14 (SNAPSHOT_BEGIN | SNAPSHOT_END | REMOVE_EVENT — dxFeed's convention for an explicit empty snapshot terminator) and all-NaN/zero OHLC fields, even for a highly liquid symbol like AAPL with start_time 90 days back.
Manually driving the dxLink protocol and requesting "contract": "HISTORY" instead of "AUTO" on the same channel, with everything else identical, returns real backfill immediately — dozens of real daily OHLC bars with correct dates, prices, and volume.
Repro (using tastytrade==13.2.3):
from datetime import datetime, timedelta, timezone
from tastytrade import Session, DXLinkStreamer
from tastytrade.dxfeed import Candle
session = Session(...)
async with session:
await session.refresh(force=True)
start_time = datetime.now(timezone.utc) - timedelta(days=90)
async with DXLinkStreamer(session) as streamer:
await streamer.subscribe_candle(["AAPL"], "1d", start_time=start_time)
candle = await streamer.get_event(Candle)
print(candle.time, candle.open, candle.close)
# -> time equals the requested start_time verbatim (echoed back),
# open/close are 0 - not a real bar.
What I found by bypassing the SDK and sending a raw CHANNEL_REQUEST with "parameters": {"contract": "HISTORY"} instead of "AUTO" (same FEED_SETUP/FEED_SUBSCRIPTION messages otherwise): real daily bars for AAPL, SPX, and a front-month futures symbol (/MESU26:XCME) all came back correctly, with realistic dates/prices/volume and proper eventFlags (4 for the live/current-day bar, 0 for closed days).
Reproduced against both the current PyPI release (13.2.3) and unreleased master — _channel_request is unchanged in both.
Suggested fix: either let subscribe_candle()/_channel_request request "HISTORY" for Candle channels specifically, or expose contract as a parameter so callers can choose.
Happy to open a PR if that's useful — wanted to confirm this isn't already-known/by-design first.
DXLinkStreamer._channel_requesthardcodes"contract": "AUTO"in theCHANNEL_REQUESTmessage for every event type, includingCandle. ForCandlesubscriptions with astart_time, this means the server never sends historical backfill — it responds with a singleFEED_DATAevent carryingeventFlags=14(SNAPSHOT_BEGIN | SNAPSHOT_END | REMOVE_EVENT— dxFeed's convention for an explicit empty snapshot terminator) and all-NaN/zero OHLC fields, even for a highly liquid symbol likeAAPLwithstart_time90 days back.Manually driving the dxLink protocol and requesting
"contract": "HISTORY"instead of"AUTO"on the same channel, with everything else identical, returns real backfill immediately — dozens of real daily OHLC bars with correct dates, prices, and volume.Repro (using
tastytrade==13.2.3):What I found by bypassing the SDK and sending a raw
CHANNEL_REQUESTwith"parameters": {"contract": "HISTORY"}instead of"AUTO"(sameFEED_SETUP/FEED_SUBSCRIPTIONmessages otherwise): real daily bars forAAPL,SPX, and a front-month futures symbol (/MESU26:XCME) all came back correctly, with realistic dates/prices/volume and propereventFlags(4for the live/current-day bar,0for closed days).Reproduced against both the current PyPI release (
13.2.3) and unreleasedmaster—_channel_requestis unchanged in both.Suggested fix: either let
subscribe_candle()/_channel_requestrequest"HISTORY"forCandlechannels specifically, or exposecontractas a parameter so callers can choose.Happy to open a PR if that's useful — wanted to confirm this isn't already-known/by-design first.