PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pine_value_admit_decl.hpp
Go to the documentation of this file.
1#pragma once
2
4
6
7#include <cmath>
8
9namespace pineforge::source {
10
11// D3-a is pending. MAP: strategy(na/computed expression) is not emitted as a
12// numeric member; omissions are finite. No script provenance for a raw host
13// NaN is established, so preserve it. The supervisor can flip this one line.
14inline constexpr bool kDeclarationNanIsInvalid = false;
15
16inline bool declaration_value_is_invalid(double value) noexcept {
17 return std::isinf(value) || (kDeclarationNanIsInvalid && std::isnan(value));
18}
19
20// Call only for the source declaration, before storage and any caller override
21// merge. Finite values, including non-positive margins, keep their definitions.
22// Existing financial/domain refusals and caller values have their own doors.
37
38} // namespace pineforge::source
constexpr const char * strategy_default_qty_value
constexpr const char * strategy_margin_short
constexpr const char * strategy_margin_long
void admit_strategy_declaration(const PineStrategyConfig &config)
bool declaration_value_is_invalid(double value) noexcept
void throw_strategy_value_invalid(const char *field, StrategyValueReason reason)
The coded failure of a source-owned invalid actionable value.
constexpr bool kDeclarationNanIsInvalid