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

Chart data produced by the VM. More...

#include <chart.hpp>

Public Member Functions

 Chart (const ffi::Chart *p)
 Constructs a chart wrapper around the given pointer.
uintptr_t seriesLength () const
 Gets the series length of the chart.
FilledOrdersIterator filledOrdersOnBar (uintptr_t bar_index) const
 Creates an iterator over filled orders on a bar (strategy order fills).
SeriesGraphIterator seriesGraphIterator (std::optional< SeriesGraphType > type=std::nullopt) const
 Creates an iterator over the series graphs in the chart.
GraphIterator graphIterator (std::optional< GraphType > type=std::nullopt) const
 Creates an iterator over the non-series graphs in the chart.
BarColors asBarColors () const
 Gets the bar-colors settings for the chart.

Detailed Description

Chart data produced by the VM.

The underlying pointer is borrowed from an Instance.

Definition at line 35 of file chart.hpp.

Constructor & Destructor Documentation

◆ Chart()

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

Constructs a chart wrapper around the given pointer.

Definition at line 41 of file chart.hpp.

Member Function Documentation

◆ asBarColors()

BarColors openpine::Chart::asBarColors ( ) const
inline

Gets the bar-colors settings for the chart.

Returns
BarColors wrapper; valid while the chart is alive.

Definition at line 82 of file chart.hpp.

◆ filledOrdersOnBar()

FilledOrdersIterator openpine::Chart::filledOrdersOnBar ( uintptr_t bar_index) const
inline

Creates an iterator over filled orders on a bar (strategy order fills).

Parameters
bar_indexBar index (base 0).
Returns
FilledOrdersIterator; each element has signal name, price, quantity.

Definition at line 54 of file chart.hpp.

◆ graphIterator()

GraphIterator openpine::Chart::graphIterator ( std::optional< GraphType > type = std::nullopt) const
inline

Creates an iterator over the non-series graphs in the chart.

Parameters
typeIf set, only graphs of this type are yielded.
Returns
A GraphIterator for the chart.

Definition at line 73 of file chart.hpp.

◆ seriesGraphIterator()

SeriesGraphIterator openpine::Chart::seriesGraphIterator ( std::optional< SeriesGraphType > type = std::nullopt) const
inline

Creates an iterator over the series graphs in the chart.

Parameters
typeIf set, only series graphs of this type are yielded.
Returns
A SeriesGraphIterator for the chart.

Definition at line 63 of file chart.hpp.

◆ seriesLength()

uintptr_t openpine::Chart::seriesLength ( ) const
inline

Gets the series length of the chart.

Returns
The number of bars currently held by the chart.

Definition at line 47 of file chart.hpp.


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