21#include "../native_execution_consumer.hpp"
35 return NativeExecutionConsumer::bound(host);
46 const NativeExecutionConsumer& consumer = NativeExecutionConsumer::bound(host);
47 if (consumer.running())
48 return {NativeLifecycleKind::Running, consumer.state_spec(), consumer.state_phase()};
95 std::uint64_t
run = 0;
104 std::uint64_t run)
noexcept {
105 NativeHostCache*
const cache = consumer.host_cache();
108 return facts->owner == owner && facts->run == run ? facts :
nullptr;
118 const void* owner, std::uint64_t run) {
119 if (consumer.running()) {
121 facts !=
nullptr && facts->aggregates_input_bars) {
122 ++facts->fact_answers;
123 return *facts->aggregates_input_bars;
126 return consumer.aggregates_input();
The public native host: an abstract subclass of BacktestEngine with no PineScript on it.
NativeRunPhase
Which driving is Running: a batch run(), a stream's internal warmup, or its realtime leg.
NativeLifecycleKind
Where a host stands.
RunState run_state(const NativeStrategyHost &host)
NativePhysicalPosition run_position(const NativeStrategyHost &host)
void take_run_facts(NativeExecutionConsumer &consumer, const PineExecutionAdapter &adapter, std::uint64_t run)
const NativeCurrentPointView * callback_point(const NativeStrategyHost &host)
bool run_aggregates_input_bars(const NativeExecutionConsumer &consumer, const void *owner, std::uint64_t run)
const NativeCurrentPointView * selected_replay_point(const NativeStrategyHost &host) noexcept
const NativeCurrentPointView * live_callback_point(const NativeStrategyHost &host)
const NativeRunSpec * run_spec(const NativeStrategyHost &host)
NativeExecutionConsumer & run_consumer(const NativeStrategyHost &host)
const char kPineRunCacheKind
NativeRunPhase run_phase(const NativeStrategyHost &host)
PineRunCache * run_cache(const NativeExecutionConsumer &consumer, const void *owner, std::uint64_t run) noexcept
NativeLifecycleKind run_kind(const NativeStrategyHost &host)
What current_execution_point() answers inside a callback: the point's decision context,...
The book as one aggregate: signed units, the volume-weighted average entry price and the number of op...
The flattened run state native_state() answers: the lifecycle kind, a borrowed pointer to the staged ...
const NativeRunSpec * spec
One complete setup value, staged/copied by NativeStrategyHost before it is applied at begin.
std::uint64_t fact_answers
std::optional< bool > aggregates_input_bars
const NativeRunSpec * spec