Add provider-neutral historical-to-realtime streaming#85
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
request.security()state, and partial timeframe aggregation across the handoffsyminfosession instead of manufacturing tradable bars across market closuresWhy
TradingView strategies load confirmed historical bars and then continue on realtime data without replacing the strategy instance. PineForge previously only exposed one-shot backtests, so switching data sources could not preserve the complete broker and script state.
This PR introduces the engine-owned lifecycle needed by a separate data layer such as
pineforge-data. Any community provider adapter can normalize its payload intopf_trade_tick_t; the engine remains deterministic, dependency-free, and unaware of HTTP, WebSockets, credentials, or vendor schemas.It also establishes the realtime execution foundation needed for later
alert(), order-fill alert, and JSON webhook work. Alert delivery itself is intentionally not part of this PR.Validation
Current head (
1226c64):ctest --test-dir build --output-on-failure: 85/85 passed, including provider-neutral ABI coverage, session-aware gap handling, andtest_tutorial_stream./scripts/run_corpus.sh: 252/252 executed; 239 excellent, 12 strong, 1 existing anomaly; no moderate/weak/minimal resultspython3 scripts/check_c_abi_runtime.py: passedbash docs/build.sh: generated without warningsgit diff --check: passedExisting 24×7 raw-trade replay evidence for the streaming lifecycle:
The long replay used three session starts (2025-03-29, 2025-03-30, and 2025-03-31), each ending exclusively at 2025-05-01. Each strategy/session received one contiguous
strategy_stream_push_ticks(pointer, count)call.