PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
market_driver.hpp File Reference
#include <pineforge/bar.hpp>
#include <pineforge/native_calendar.hpp>
#include <cstdint>
#include <optional>
#include <string>
Include dependency graph for market_driver.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pineforge::native_driver_v5::NativeCoordinate
 Everything the kernel knows about WHERE a point is, as one owning value: its event ordinal, the interval index, the nominal and scheduled-eligible opens, the last traded close, the next period and next input opens, the effective time the account converts and hashes at, the source price time, and the three classifications above. More...
 
struct  pineforge::native_driver_v5::NativeDriverPoint
 One point the driver produced: its coordinate, the raw price before slippage or any grid, the provider's sequence for an observed print (nullopt otherwise), and whether the point is a matching point, an excursion sample, or both. More...
 
struct  pineforge::native_driver_v5::NativeDriverStatistics
 
struct  pineforge::native_driver_v5::NativeDecisionContext
 
class  pineforge::native_driver_v5::INativeDriverSink
 
struct  pineforge::native_driver_v5::NativeInputPreflightResult
 What preflight_native_inputs answers: the error and the first offending bar's index, or -1 when the refusal is not about one bar. More...
 

Namespaces

namespace  pineforge
 
namespace  pineforge::native_run_spec_v3
 
namespace  pineforge::native_driver_v5
 

Enumerations

enum class  pineforge::native_driver_v5::NativePriceProvenance : std::uint8_t {
  pineforge::native_driver_v5::Confirmed = 0 ,
  pineforge::native_driver_v5::ObservedPrint = 1 ,
  pineforge::native_driver_v5::ModeledOHLCOpen = 2 ,
  pineforge::native_driver_v5::ModeledOHLCClose = 3 ,
  pineforge::native_driver_v5::CarriedOpen = 4 ,
  pineforge::native_driver_v5::AfterCalculationClose = 5 ,
  pineforge::native_driver_v5::PartialFinalized = 6 ,
  pineforge::native_driver_v5::Calculation = 7 ,
  pineforge::native_driver_v5::CurrentExecution = 8
}
 Where a driver point's price came from. More...
 
enum class  pineforge::native_driver_v5::NativePathPhase : std::uint8_t {
  pineforge::native_driver_v5::None = 0 ,
  pineforge::native_driver_v5::Open = 1 ,
  pineforge::native_driver_v5::High = 2 ,
  pineforge::native_driver_v5::Low = 3 ,
  pineforge::native_driver_v5::Close = 4
}
 Which leg of a modeled OHLC walk a point sits on. More...
 
enum class  pineforge::native_driver_v5::NativeCompletionKind : std::uint8_t {
  pineforge::native_driver_v5::Confirmed = 0 ,
  pineforge::native_driver_v5::LazyComplete = 1 ,
  pineforge::native_driver_v5::SessionShortened = 2 ,
  pineforge::native_driver_v5::PartialFinalized = 3
}
 How a script interval or a higher-timeframe bucket was closed. More...
 
enum class  pineforge::native_driver_v5::NativeInputPolicy : std::uint8_t {
  pineforge::native_driver_v5::Batch = 0 ,
  pineforge::native_driver_v5::StreamWarmup = 1
}
 
enum class  pineforge::native_driver_v5::NativeInputPreflightError : std::uint16_t {
  pineforge::native_driver_v5::None = 0 ,
  pineforge::native_driver_v5::NullArray = 1 ,
  pineforge::native_driver_v5::InvalidCount = 2 ,
  pineforge::native_driver_v5::StructuralInvalid = 3 ,
  pineforge::native_driver_v5::Unaligned = 4 ,
  pineforge::native_driver_v5::OffGridLabel = 5 ,
  pineforge::native_driver_v5::NotStrictlyIncreasing = 6 ,
  pineforge::native_driver_v5::OverlappingSlot = 7 ,
  pineforge::native_driver_v5::InSessionGap = 8 ,
  pineforge::native_driver_v5::CalendarFailure = 9 ,
  pineforge::native_driver_v5::TimestampDeltaOverflow = 10
}
 Why a bar array was refused before the run touched anything. More...
 

Functions

bool pineforge::native_driver_v5::native_bar_structurally_valid (const Bar &bar) noexcept
 Whether a bar can be admitted at all: finite positive OHLC with high >= max(open, close) and low <= min(open, close), and a finite nonnegative volume.
 
bool pineforge::native_driver_v5::native_confirmed_bar_label_admitted (const native_calendar::NativeInterval &interval, int64_t timestamp) noexcept
 
int64_t pineforge::native_driver_v5::native_canonical_input_completion (const native_calendar::NativeInterval &interval) noexcept
 
NativeInputPreflightResult pineforge::native_driver_v5::preflight_native_inputs (const NativeRunSpec &spec, const Bar *bars, int n, NativeInputPolicy policy)
 Judge a whole bar array against a run spec before any of it is consumed, under NativeInputPolicy::Batch (sparse input is admitted; missing in-session slots are legal) or StreamWarmup (every provided slot must be a complete confirmed interval and an in-session gap is refused).
 

Variables

constexpr const char * pineforge::native_driver_v5::kNativeDriverSemanticVersion = "native-driver/v5"
 
constexpr const char * pineforge::native_driver_v5::kNativeConsumerSemanticVersion = "native-consumer/v7"
 
constexpr const char * pineforge::native_driver_v5::kNativeCalendarSemanticVersion = "native-calendar/v1"