OpenPine C++ API
C++ wrapper for the OpenPine Pine Script VM
Loading...
Searching...
No Matches
openpine::ScriptInfo Class Reference

Script metadata (type, overlay, title, inputs, alerts) produced by the VM. More...

#include <script_info.hpp>

Public Member Functions

 ScriptInfo (const ffi::ScriptInfo *p)
bool overlay () const
 Whether the script is drawn on the price chart.
ScriptTypeKind scriptType () const
 Script type discriminant.
std::optional< std::string_view > title () const
 Script title if present.
std::optional< Indicator > indicator () const
 Full indicator payload. Only defined when scriptType() == Indicator. String refs inside the struct are valid as long as this ScriptInfo is alive.
std::optional< Library > library () const
 Full library payload. Only defined when scriptType() == Library.
std::optional< Strategy > strategy () const
 Full strategy payload. Only defined when scriptType() == Strategy. String refs inside the struct are valid as long as this ScriptInfo is alive.
uintptr_t inputsLength () const
 Number of declared user inputs.
std::optional< ScriptInputinputAt (uintptr_t index) const
 Input at the given index, or nullopt if index is out of range.
uintptr_t alertConditionsLength () const
 Number of declared alert conditions.
std::optional< std::string_view > alertConditionTitle (uintptr_t index) const
 Alert condition title at the given index.
std::optional< std::string_view > alertConditionMessage (uintptr_t index) const
 Alert condition message at the given index.

Detailed Description

Script metadata (type, overlay, title, inputs, alerts) produced by the VM.

The underlying pointer is borrowed from an Instance.

Definition at line 33 of file script_info.hpp.

Constructor & Destructor Documentation

◆ ScriptInfo()

openpine::ScriptInfo::ScriptInfo ( const ffi::ScriptInfo * p)
inline

Definition at line 38 of file script_info.hpp.

Member Function Documentation

◆ alertConditionMessage()

std::optional< std::string_view > openpine::ScriptInfo::alertConditionMessage ( uintptr_t index) const
inline

Alert condition message at the given index.

Definition at line 129 of file script_info.hpp.

References openpine::detail::optRefToView().

◆ alertConditionsLength()

uintptr_t openpine::ScriptInfo::alertConditionsLength ( ) const
inline

Number of declared alert conditions.

Definition at line 112 of file script_info.hpp.

◆ alertConditionTitle()

std::optional< std::string_view > openpine::ScriptInfo::alertConditionTitle ( uintptr_t index) const
inline

Alert condition title at the given index.

Definition at line 119 of file script_info.hpp.

References openpine::detail::optRefToView().

◆ indicator()

std::optional< Indicator > openpine::ScriptInfo::indicator ( ) const
inline

Full indicator payload. Only defined when scriptType() == Indicator. String refs inside the struct are valid as long as this ScriptInfo is alive.

Definition at line 69 of file script_info.hpp.

◆ inputAt()

std::optional< ScriptInput > openpine::ScriptInfo::inputAt ( uintptr_t index) const
inline

Input at the given index, or nullopt if index is out of range.

Definition at line 103 of file script_info.hpp.

◆ inputsLength()

uintptr_t openpine::ScriptInfo::inputsLength ( ) const
inline

Number of declared user inputs.

Definition at line 98 of file script_info.hpp.

◆ library()

std::optional< Library > openpine::ScriptInfo::library ( ) const
inline

Full library payload. Only defined when scriptType() == Library.

Definition at line 78 of file script_info.hpp.

◆ overlay()

bool openpine::ScriptInfo::overlay ( ) const
inline

Whether the script is drawn on the price chart.

Returns
true if overlay on main chart, false if separate subchart.

Definition at line 44 of file script_info.hpp.

◆ scriptType()

ScriptTypeKind openpine::ScriptInfo::scriptType ( ) const
inline

Script type discriminant.

Returns
Indicator, Library, or Strategy.

Definition at line 50 of file script_info.hpp.

◆ strategy()

std::optional< Strategy > openpine::ScriptInfo::strategy ( ) const
inline

Full strategy payload. Only defined when scriptType() == Strategy. String refs inside the struct are valid as long as this ScriptInfo is alive.

Definition at line 89 of file script_info.hpp.

◆ title()

std::optional< std::string_view > openpine::ScriptInfo::title ( ) const
inline

Script title if present.

Returns
The title as a string view, or std::nullopt if none.

Definition at line 56 of file script_info.hpp.

References openpine::detail::refToView().


The documentation for this class was generated from the following file: