8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
29 const ffi::PlotCandle* p_;
38 std::optional<std::string_view>
title()
const {
39 ffi::PineStringRef ref;
40 if (ffi::plotCandleTitle(p_, &ref)) {
50 std::optional<ffi::Bar>
value(uintptr_t idx)
const {
52 if (ffi::plotCandleValue(p_, idx, &v)) {
62 std::optional<uint32_t>
color(uintptr_t idx)
const {
64 if (ffi::plotCandleColor(p_, idx, &col)) {
74 std::optional<uint32_t>
wickColor(uintptr_t idx)
const {
76 if (ffi::plotCandleWickColor(p_, idx, &col)) {
88 if (ffi::plotCandleBorderColor(p_, idx, &col)) {
98 bool editable()
const {
return ffi::plotCandleEditable(p_); }
105 if (ffi::plotCandleShowLast(p_, &v)) {
120 std::optional<std::string_view>
format()
const {
121 ffi::PineStringRef ref;
122 if (ffi::plotCandleFormat(p_, &ref)) {
134 if (ffi::plotCandlePrecision(p_, &v)) {
A type-safe display bitmask.
Display display() const
Gets the display bitmask.
std::optional< std::string_view > title() const
Gets the title.
PlotCandle(const ffi::PlotCandle *p)
std::optional< uint32_t > wickColor(uintptr_t idx) const
Gets the wick color at the specified index.
std::optional< int32_t > precision() const
Gets the optional decimal precision.
bool forceOverlay() const
Gets whether the plot-candle is forced to render as overlay.
std::optional< uintptr_t > showLast() const
Gets the show_last value, if set.
std::optional< uint32_t > borderColor(uintptr_t idx) const
Gets the border color at the specified index.
bool editable() const
Returns whether the plot-candle is editable.
std::optional< ffi::Bar > value(uintptr_t idx) const
Gets the OHLC bar at the specified index.
std::optional< uint32_t > color(uintptr_t idx) const
Gets the body color at the specified index.
std::optional< std::string_view > format() const
Gets the optional formatting hint.
Type-safe wrappers for display bitmasks used by visuals.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.