You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request.security() runs in live mode. Each context resolves its symbol through the chart's provider: timeframes are canonicalized (D -> 1D), the chart's own symbol maps back to the provider string (ProviderPlugin.provider_symbol), and ccxt resolves exchange ids, with the .P suffix for the swap market. A symbol that cannot be resolved raises the new R0055live_security_symbol.
A context's warmup starts at the earlier of the chart start and 500 bars of its own timeframe. A failed warmup is R0049, and a coded failure in a security child exits it with code 1 without a second traceback.
Late closes are fetched from the history. A close that misses the stream grace is requested through LiveProviderPlugin.backfill_closed_bars, with a backoff from 2 s to 30 s inside a timeframe-dependent budget (a quarter of the period, 2 to 10 minutes). The target bar gives its value, a later bar gives gap semantics at once, and an exhausted budget publishes na with one warning. A published value is never patched. The same retry covers the final intrabar of a request.security_lower_tf window.
A same-timeframe context no longer takes a forming bar as closed.
The outage gap after a reconnect is filled on security streams too; before, a context lost every closed bar missed while its feed was down.
The forming last history bar runs with barstate.isconfirmed false, so barstate.islastconfirmedhistory is true on the last closed bar.
Ctrl-C: security children ignore SIGINT (the chart owns their shutdown), and a repeated interrupt no longer ends in "release unlocked lock".
Live stream recovery
The live stream recovers missed closed bars for every provider. After a reconnect it fills the gap before any socket bar goes on, asks the history for a close the socket missed once the venue's publish lag has passed, and holds later socket updates behind a slot the history has not answered yet. Two consecutive closes that only the history delivered force a reconnect.
A failed startup-gap query is retried instead of starting the stream with a hole; a connection lost under it is renewed through the reconnect path. A failed gap fill after a reconnect is retried on the new connection instead of starting another reconnect round.
The first close after a session reopen, and the close of a warmup bar that was still forming at download time, are recovered from the history when the socket misses them.
Only a close from the socket proves the close subscription alive; forming updates no longer do.
Slot closes follow the calendar, so monthly timeframes close on time.
Recovered bars are logged with their timestamp range, and failed missed-close queries on the broker log.
Catch-up bars do not trade. A closed bar delivered too late to be the live edge, and a stale update of a forming bar, run the script with strategy orders suppressed as on warmup bars; a broker run sends nothing to the venue for them, while fills are still booked. Paper trading with live_history_trades keeps trading on those bars.
New live provider declarations (validated by the plugin contract and documented in the broker plugin authoring guide):
history_publish_lag (default 10 s): an empty history answer counts as "no bar" only when it was asked at least this long after the slot's close.
history_has_idle_bars (default True): when False, a slot the history has no bar for stays empty instead of getting a zero-volume filler. ccxt declares it for Coinbase.
stream_closes_match_history (default True): when False, the socket close is the slot's last forming update and the closed bar comes from the history once the publish lag has passed; the socket close stands in at the deadline with a warning.
history_revises_before_lag (default False): when True, a history bar from an answer asked before its close plus the publish lag is not spliced in.
ccxt implements backfill_closed_bars, and its rollover publishes the previous candle's final OHLCV instead of the last cached update.
ScriptRunner takes a live_clock for feeds replayed on their own timeline.
Broker
An entry is held behind an unresolved earlier send. After a restart the sync engine could dispatch an entry again under the same client order id while the previous process's send was still unresolved; on a venue that does not refuse a duplicate client order id this opened the position twice. Pending dispatches adopted from an earlier process are now parked at startup, and on every venue whose idempotency is not NATIVE the dispatch waits until the earlier send is resolved (warning once, reminder every 10 minutes). The same gate covers the stop-fired market order of an entry with both stop and limit, and a complete entry fill releases the park.
New ParkedDispatchResolver: turns a plugin's venue lookup into landed / refused / absent / inconclusive and writes the journal outcome and the engine resolution in one transaction.
validate_plugin_contract rejects an inherited backfill_closed_bars and invalid history_publish_lag, history_has_idle_bars and feed_timeout_bars declarations; the engine validates a plugin's ports when it first sees them.
publish_native_failsafe_sl is declared on BrokerPlugin as an optional hook.
Provider downloads
download_provider_history(..., in_memory=True) keeps the bars in ProviderHistory.bars and writes nothing into the data directory. A provider-mode download used to replace a saved dataset of the same symbol and timeframe.
ProviderPlugin.fetch_symbol_info() fetches the symbol info without saving it.
The OHLCV writer's candle check is public as validate_candle() (now including the timestamp range), and in-memory bars are checked with it and must be strictly increasing.
A file download publishes its .extra.csv sidecar along with the binary, removes a stale one, and restores the previous dataset when a step fails.
Fixes
A coded error names the Pine line only when pyne run was given the .pine source. Running the compiled .py reported the Pine line whenever a matching sourcemap and the .pine sat next to it; it now reports the Pyne code's file:line:column.
Importing pynecore.core.syminfo or pynecore.core.live_runner as the first PyneCore module failed with an ImportError (import cycle through the type package).