|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
Another instrument's own bars of one timeframe, installed as data. More...
#include <native_run_spec.hpp>
Data Fields | |
| std::string | instrument |
| std::string | tf |
| std::vector< Bar > | bars |
| std::vector< std::int64_t > | close_ms |
| std::vector< NativeInstrumentColumn > | columns |
Another instrument's own bars of one timeframe, installed as data.
A run may hold any number of them, keyed by (instrument, tf); a declared series reads one through NativeSeriesSource::InstrumentFeed. The feed drives nothing by itself – no matching point, no calculation, no script bar – and the kernel guesses no calendar for the instrument: every bar carries its own close, close_ms[i], beside its open, bars[i].timestamp.
instrument is an opaque key (no venue or symbol grammar is read). tf must parse; it is part of the key and pairs with nothing, so a feed may be finer or coarser than the input. bars are strictly increasing, their prices finite, their volume finite and nonnegative or NaN (the instrument publishes none). close_ms has one entry per bar, each after its own open and at or before the next bar's open. columns each hold one value per bar.
Delivery is by interval and by nothing else. On each accepted input, a series reading the feed is handed, in feed order, every bar it has not yet been handed that is visible at that input: lookahead = false: bars whose close_ms <= the input's NativeInterval::last_traded_close_ms – the bars that have closed by the time the input has; lookahead = true: bars whose open <= the input's NativeInterval::open_ms – the bar in progress at the input's open included, with the final values the feed gives it. The input's interval is its calendar interval: under a raw label partition, whose inputs carry no duration, the interval the run's session, zone and input timeframe give the input's label. The last bar handed over is the series' visible value (native_series_bar()), each delivery reaches on_native_timeframe_bar, and the delivery point is the one every series has: after on_native_input, before the input is aggregated, matched or calculated. So bars earlier than the first input are handed over on that first input (history), a bar the feed carries past the last input's horizon never is, and every bar is handed over exactly once, in order: a host that counts deliveries knows the feed index of each. gaps is the subscription contract's: true clears the series on every accepted input that hands it nothing. NativeTimeframeBarContext::interval is the bar's own: open_ms and eligible_open_ms its open, last_traded_close_ms and next_period_open_ms its close_ms, next_input_open_ms the next feed bar's open (its close_ms for the last bar); completion is Confirmed.
Opt-in: absent (empty) is the whole default surface, and the continuation digest folds the feeds only when there are any. Historical runs only: stream_begin refuses a spec that installs one.
Definition at line 580 of file native_run_spec.hpp.
| std::string pineforge::native_run_spec_v3::NativeInstrumentFeed::instrument |
Definition at line 581 of file native_run_spec.hpp.
Referenced by pineforge::source::PineStrategyHost::set_symbol_feed(), pineforge::source::PineStrategyHost::set_symbol_feed_borrowed(), and pineforge::source::PineStrategyHost::set_symbol_feed_column().
| std::string pineforge::native_run_spec_v3::NativeInstrumentFeed::tf |
Definition at line 582 of file native_run_spec.hpp.
Referenced by pineforge::source::PineStrategyHost::set_symbol_feed(), pineforge::source::PineStrategyHost::set_symbol_feed_borrowed(), and pineforge::source::PineStrategyHost::set_symbol_feed_column().
| std::vector<Bar> pineforge::native_run_spec_v3::NativeInstrumentFeed::bars |
Definition at line 583 of file native_run_spec.hpp.
Referenced by pineforge::source::PineStrategyHost::set_symbol_feed(), and pineforge::source::PineStrategyHost::set_symbol_feed_borrowed().
| std::vector<std::int64_t> pineforge::native_run_spec_v3::NativeInstrumentFeed::close_ms |
Definition at line 584 of file native_run_spec.hpp.
Referenced by pineforge::source::PineStrategyHost::set_symbol_feed(), and pineforge::source::PineStrategyHost::set_symbol_feed_borrowed().
| std::vector<NativeInstrumentColumn> pineforge::native_run_spec_v3::NativeInstrumentFeed::columns |
Definition at line 585 of file native_run_spec.hpp.
Referenced by pineforge::source::PineStrategyHost::security_column_value(), pineforge::source::PineStrategyHost::set_symbol_feed_borrowed(), and pineforge::source::PineStrategyHost::set_symbol_feed_column().