OpenPine C++ API
C++ wrapper for the OpenPine Pine Script VM
Loading...
Searching...
No Matches
ffi.hpp
Go to the documentation of this file.
1#pragma once
2
3// Warning, this file is autogenerated by cbindgen. Don't modify this manually.
4
5#include <cstdarg>
6#include <cstdint>
7#include <cstdlib>
8#include <ostream>
9#include <new>
10
11namespace openpine {
12namespace ffi {
13
17constexpr static const uint32_t DISPLAY_ALL = 65535;
18
22constexpr static const uint32_t DISPLAY_NONE = 0;
23
27constexpr static const uint32_t DISPLAY_DATA_WINDOW = 1;
28
32constexpr static const uint32_t DISPLAY_PANE = 2;
33
37constexpr static const uint32_t DISPLAY_PINE_SCREENER = 4;
38
42constexpr static const uint32_t DISPLAY_PRICE_SCALE = 8;
43
47constexpr static const uint32_t DISPLAY_STATUS_LINE = 16;
48
54enum class OutputMode {
58 Chart = 0,
62 Stream = 1,
63};
64
68enum class EventKind {
72 Log = 0,
76 Alert = 1,
80 BarStart = 2,
84 BarEnd = 3,
88 HistoryEnd = 4,
92 DrawAddPlot = 5,
96 DrawUpdatePlot = 6,
97};
98
102enum class ScriptTypeKind {
103 Indicator = 0,
104 Library = 1,
105 Strategy = 2,
106};
107
111enum class Format : int32_t {
112 Inherit = 0,
113 Price = 1,
114 Volume = 2,
115 Percent = 3,
116 MinTick = 4,
117};
118
122enum class ScaleType : int32_t {
123 None = 0,
124 Left = 1,
125 Right = 2,
126};
127
131enum class QuantityType : int32_t {
132 Fixed = 0,
133 Cash = 1,
134 PercentOfEquity = 2,
135};
136
140enum class CommissionType : int32_t {
141 Percent = 0,
142 CashPerContract = 1,
143 CashPerOrder = 2,
144};
145
149enum class CloseEntriesRule : int32_t {
150 FIFO = 0,
151 ANY = 1,
152};
153
157enum class TimeUnit {
158 Second = 0,
159 Minute = 1,
160 Day = 2,
161 Week = 3,
162 Month = 4,
163 Tick = 5,
164};
165
169enum class SourceType : int64_t {
170 Open = 0,
171 High = 1,
172 Low = 2,
173 Close = 3,
174 Hl2 = 4,
175 Hlc3 = 5,
176 Ohlc4 = 6,
177 Hlcc4 = 7,
178};
179
185enum class TradeSession {
189 PreMarket,
193 Regular,
197 AfterHours,
201 Overnight,
202};
203
207enum class GraphType {
208 Hline,
209 Label,
210 Line,
211 LineFill,
212 Box,
213 Polyline,
214 Table,
215};
216
222enum class HlineStyle {
223 Solid = 0,
224 Dashed = 1,
225 Dotted = 2,
226};
227
231enum class XLocation {
232 Index,
233 Time,
234};
235
239enum class Extend {
240 None,
241 Left,
242 Right,
243 Both,
244};
245
249enum class LineStyle {
250 Solid,
251 Dotted,
252 Dashed,
253 ArrowLeft,
254 ArrowRight,
255 ArrowBoth,
256};
257
261enum class HorizontalAlign {
262 Left,
263 Center,
264 Right,
265};
266
270enum class VerticalAlign {
271 Top,
272 Middle,
273 Bottom,
274};
275
279enum class TextWrap {
280 Auto,
281 None,
282};
283
287enum class FontFamily {
288 Default,
289 Monospace,
290};
291
295enum class TextFormatting {
296 None,
297 Bold,
298 Italic,
299};
300
307enum class TablePosition {
308 TopLeft,
309 TopRight,
310 TopCenter,
311 BottomLeft,
312 BottomRight,
313 BottomCenter,
314 MiddleLeft,
315 MiddleRight,
316 MiddleCenter,
317};
318
322enum class YLocation {
323 Price,
324 AboveBar,
325 BelowBar,
326};
327
331enum class LabelStyle {
332 None,
333 ArrowDown,
334 ArrowUp,
335 Circle,
336 Cross,
337 Diamond,
338 Flag,
339 LabelCenter,
340 LabelDown,
341 LabelLeft,
342 LabelLowerLeft,
343 LabelLowerRight,
344 LabelRight,
345 LabelUp,
346 LabelUpperLeft,
347 LabelUpperRight,
348 Square,
349 TextOutline,
350 TriangleDown,
351 TriangleUp,
352 XCross,
353};
354
358enum class SeriesGraphType {
362 Plot,
366 BackgroundColors,
370 Fill,
374 PlotArrow,
378 PlotBar,
382 PlotCandle,
386 PlotChar,
390 PlotShape,
391};
392
396enum class FillAnchorType {
400 Plot,
404 Hline,
405};
406
410enum class FillColorType {
411 Solid,
412 Gradient,
413};
414
418enum class Location {
419 AboveBar = 0,
420 BelowBar = 1,
421 Absolute = 2,
422 Top = 3,
423 Bottom = 4,
424};
425
429enum class Size {
430 Auto = 0,
431 Tiny = 1,
432 Small = 2,
433 Normal = 3,
434 Large = 4,
435 Huge = 5,
436};
437
441enum class Shape {
442 ArrowDown = 0,
443 ArrowUp = 1,
444 Circle = 2,
445 Cross = 3,
446 Diamond = 4,
447 Flag = 5,
448 LabelDown = 6,
449 LabelUp = 7,
450 Square = 8,
451 TriangleDown = 9,
452 TriangleUp = 10,
453 XCross = 11,
454};
455
461enum class PlotStyle {
462 Line = 0,
463 LineBr = 1,
464 Area = 2,
465 AreaBr = 3,
466 Circles = 4,
467 Columns = 5,
468 Cross = 6,
469 Histogram = 7,
470 StepLine = 8,
471 Diamond = 9,
472 StepLineBr = 10,
473};
474
480enum class PlotLineStyle {
481 Solid = 0,
482 Dashed = 1,
483 Dotted = 2,
484};
485
500struct Result;
501
507struct BackgroundColors;
508
514struct BarColors;
515
521struct Box;
522
529struct CandlestickStream;
530
536struct Chart;
537
543struct Fill;
544
551struct FilledOrdersIterator;
552
558struct Graph;
559
565struct CGraphIterator;
566
572struct Hline;
573
577struct Input;
578
582struct Instance;
583
589struct Label;
590
596struct Line;
597
603struct LineFill;
604
610struct Plot;
611
617struct PlotArrow;
618
624struct PlotBar;
625
631struct PlotCandle;
632
638struct PlotChar;
639
645struct PlotShape;
646
652struct Polyline;
653
657struct ScriptInfo;
658
664struct SeriesGraph;
665
672struct CSeriesGraphIterator;
673
679struct Table;
680
686struct TableCell;
687
688template<typename T = void>
689struct Option;
690
696struct Position {
700 uint32_t column;
704 uint32_t line;
708 uint32_t byte_offset;
709};
710
716struct Span {
720 Position start;
724 Position end;
725};
726
733struct PineStringRef {
737 const uint8_t *data;
741 uintptr_t len;
742};
743
747struct LastInfo {
751 uintptr_t index;
755 int64_t time;
756};
757
764struct PartialSymbolInfo {
770 const char *currency;
776 int32_t min_move;
782 int32_t price_scale;
783};
784
792struct DataProvider {
796 void *context;
804 const char *(*symbol_info_fn)(void *context,
805 const uint8_t *symbol,
806 uintptr_t symbol_len,
807 PartialSymbolInfo *out);
819 CandlestickStream *(*candlesticks_open_fn)(void *context,
820 const uint8_t *symbol,
821 uintptr_t symbol_len,
822 const uint8_t *timeframe,
823 uintptr_t timeframe_len,
824 int64_t from_time);
825};
826
830struct CreateInstanceOptions {
834 PineStringRef source;
838 const PineStringRef *path;
842 PineStringRef timeframe;
846 PineStringRef symbol;
850 const uint32_t *background_color;
854 const LastInfo *last_info;
860 const DataProvider *data_provider;
864 OutputMode output_mode;
865};
866
870struct BarStartEvent {
874 uintptr_t bar_index;
878 int64_t timestamp;
883 int32_t bar_state;
884};
885
889struct DrawUpdatePlot {
893 int64_t id;
897 uintptr_t bar_index;
901 int64_t timestamp;
905 double value;
906};
907
911struct DrawAddPlot {
915 int64_t id;
919 const uint8_t *title;
923 uintptr_t title_len;
924};
925
932struct Event {
936 EventKind kind;
940 BarStartEvent bar_start;
944 DrawUpdatePlot draw_update_plot;
948 DrawAddPlot draw_add_plot;
949};
950
958using InstanceEventCallback = void(*)(const Event *event, void *user_data);
959
968using InstanceRunCallback = void(*)(const Result *result, void *user_data);
969
970struct Indicator {
971 PineStringRef title;
972 bool has_short_title;
973 PineStringRef short_title;
974 bool overlay;
975 Format format;
976 bool has_precision;
977 uint8_t precision;
978 ScaleType scale;
979 bool has_max_bars_back;
980 uintptr_t max_bars_back;
981 bool has_timeframe;
982 PineStringRef timeframe;
983 bool timeframe_gaps;
984 bool explicit_plot_zorder;
985 uintptr_t max_lines_count;
986 uintptr_t max_labels_count;
987 uintptr_t max_boxes_count;
988 bool has_calc_bars_count;
989 uintptr_t calc_bars_count;
990 uintptr_t max_polylines_count;
991 bool dynamic_requests;
992 bool behind_chart;
993};
994
995struct Library {
996 PineStringRef title;
997 bool overlay;
998 bool dynamic_requests;
999};
1000
1001struct Strategy {
1002 PineStringRef title;
1003 bool has_short_title;
1004 PineStringRef short_title;
1005 bool overlay;
1006 Format format;
1007 bool has_precision;
1008 uint8_t precision;
1009 ScaleType scale;
1010 uint32_t pyramiding;
1011 bool calc_on_order_fills;
1012 bool calc_on_every_tick;
1013 bool has_max_bars_back;
1014 uintptr_t max_bars_back;
1015 uint32_t backtest_fill_limits_assumption;
1016 QuantityType default_qty_type;
1017 double default_qty_value;
1018 double initial_capital;
1019 PineStringRef currency_code;
1020 uint32_t slippage;
1021 CommissionType commission_type;
1022 double commission_value;
1023 bool process_orders_on_close;
1024 CloseEntriesRule close_entries_rule;
1025 double margin_long;
1026 double margin_short;
1027 bool explicit_plot_zorder;
1028 uintptr_t max_lines_count;
1029 uintptr_t max_labels_count;
1030 uintptr_t max_boxes_count;
1031 bool has_calc_bars_count;
1032 uintptr_t calc_bars_count;
1033 double risk_free_rate;
1034 bool use_bar_magnifier;
1035 bool fill_orders_on_standard_ohlc;
1036 uintptr_t max_polylines_count;
1037 bool dynamic_requests;
1038 bool behind_chart;
1039};
1040
1041struct InputInt {
1042 int64_t id;
1043 int64_t default_value;
1044 bool has_title;
1045 PineStringRef title;
1046 bool has_tooltip;
1047 PineStringRef tooltip;
1048 bool has_inline;
1049 PineStringRef inline_;
1050 bool has_group;
1051 PineStringRef group;
1052 uint64_t display;
1053 bool active;
1054 uintptr_t options_length;
1055 bool has_min_value;
1056 int64_t min_value;
1057 bool has_max_value;
1058 int64_t max_value;
1059 bool has_step;
1060 int64_t step;
1061 bool confirm;
1062};
1063
1064struct InputFloat {
1065 int64_t id;
1066 double default_value;
1067 bool has_title;
1068 PineStringRef title;
1069 bool has_tooltip;
1070 PineStringRef tooltip;
1071 bool has_inline;
1072 PineStringRef inline_;
1073 bool has_group;
1074 PineStringRef group;
1075 uint64_t display;
1076 bool active;
1077 bool has_options;
1078 uintptr_t options_length;
1079 bool has_min_value;
1080 double min_value;
1081 bool has_max_value;
1082 double max_value;
1083 bool has_step;
1084 double step;
1085 bool confirm;
1086};
1087
1088struct InputBool {
1089 int64_t id;
1090 bool default_value;
1091 bool has_title;
1092 PineStringRef title;
1093 bool has_tooltip;
1094 PineStringRef tooltip;
1095 bool has_inline;
1096 PineStringRef inline_;
1097 bool has_group;
1098 PineStringRef group;
1099 uint64_t display;
1100 bool active;
1101 bool confirm;
1102};
1103
1104struct InputColor {
1105 int64_t id;
1106 uint32_t default_value;
1107 bool has_title;
1108 PineStringRef title;
1109 bool has_tooltip;
1110 PineStringRef tooltip;
1111 bool has_inline;
1112 PineStringRef inline_;
1113 bool has_group;
1114 PineStringRef group;
1115 uint64_t display;
1116 bool active;
1117 bool confirm;
1118};
1119
1120struct InputString {
1121 int64_t id;
1122 PineStringRef default_value;
1123 bool has_title;
1124 PineStringRef title;
1125 bool has_tooltip;
1126 PineStringRef tooltip;
1127 bool has_inline;
1128 PineStringRef inline_;
1129 bool has_group;
1130 PineStringRef group;
1131 uint64_t display;
1132 bool active;
1133 uintptr_t options_length;
1134 bool confirm;
1135};
1136
1137struct InputPrice {
1138 int64_t id;
1139 double default_value;
1140 bool has_title;
1141 PineStringRef title;
1142 bool has_tooltip;
1143 PineStringRef tooltip;
1144 bool has_inline;
1145 PineStringRef inline_;
1146 bool has_group;
1147 PineStringRef group;
1148 uint64_t display;
1149 bool active;
1150 bool confirm;
1151};
1152
1153struct InputSymbol {
1154 int64_t id;
1155 PineStringRef default_value;
1156 bool has_title;
1157 PineStringRef title;
1158 bool has_tooltip;
1159 PineStringRef tooltip;
1160 bool has_inline;
1161 PineStringRef inline_;
1162 bool has_group;
1163 PineStringRef group;
1164 uint64_t display;
1165 bool active;
1166 bool confirm;
1167};
1168
1172struct TimeFrame {
1173 uint32_t quantity;
1174 TimeUnit unit;
1175};
1176
1177struct InputTimeFrame {
1178 int64_t id;
1179 bool is_chart_default;
1180 TimeFrame default_value;
1181 bool has_title;
1182 PineStringRef title;
1183 bool has_tooltip;
1184 PineStringRef tooltip;
1185 bool has_inline;
1186 PineStringRef inline_;
1187 bool has_group;
1188 PineStringRef group;
1189 uint64_t display;
1190 bool active;
1191 uintptr_t options_length;
1192 bool confirm;
1193};
1194
1195struct InputSource {
1196 int64_t id;
1197 SourceType default_value;
1198 bool has_title;
1199 PineStringRef title;
1200 bool has_tooltip;
1201 PineStringRef tooltip;
1202 bool has_inline;
1203 PineStringRef inline_;
1204 bool has_group;
1205 PineStringRef group;
1206 uint64_t display;
1207 bool active;
1208 bool confirm;
1209};
1210
1211struct InputEnum {
1212 int64_t id;
1213 uintptr_t enum_typeid;
1214 int64_t default_value;
1215 bool has_title;
1216 PineStringRef title;
1217 bool has_tooltip;
1218 PineStringRef tooltip;
1219 bool has_inline;
1220 PineStringRef inline_;
1221 bool has_group;
1222 PineStringRef group;
1223 uint64_t display;
1224 bool active;
1225 uintptr_t options_length;
1226 bool confirm;
1227};
1228
1229struct InputSession {
1230 int64_t id;
1231 PineStringRef default_value;
1232 bool has_title;
1233 PineStringRef title;
1234 bool has_tooltip;
1235 PineStringRef tooltip;
1236 bool has_inline;
1237 PineStringRef inline_;
1238 bool has_group;
1239 PineStringRef group;
1240 uint64_t display;
1241 bool active;
1242 uintptr_t options_length;
1243 bool confirm;
1244};
1245
1246struct InputTime {
1247 int64_t id;
1248 int64_t default_value;
1249 bool has_title;
1250 PineStringRef title;
1251 bool has_tooltip;
1252 PineStringRef tooltip;
1253 bool has_inline;
1254 PineStringRef inline_;
1255 bool has_group;
1256 PineStringRef group;
1257 uint64_t display;
1258 bool active;
1259 bool confirm;
1260};
1261
1262struct InputTextArea {
1263 int64_t id;
1264 PineStringRef default_value;
1265 bool has_title;
1266 PineStringRef title;
1267 bool has_tooltip;
1268 PineStringRef tooltip;
1269 bool has_group;
1270 PineStringRef group;
1271 uint64_t display;
1272 bool active;
1273 bool confirm;
1274};
1275
1276struct InputEnumOption {
1277 int64_t value;
1278 PineStringRef title;
1279};
1280
1286struct Candlestick {
1290 int64_t time;
1294 double open;
1298 double high;
1302 double low;
1306 double close;
1310 double volume;
1314 double turnover;
1318 TradeSession trade_session;
1319};
1320
1327struct CandlestickItem {
1331 Candlestick candlestick;
1335 bool confirmed;
1336};
1337
1344struct FilledOrder {
1348 PineStringRef order_id;
1352 double price;
1356 double quantity;
1357};
1358
1362struct PolylinePoint {
1363 int64_t x;
1364 double y;
1365};
1366
1370struct FillGradient {
1371 double top_value;
1372 double bottom_value;
1373 uint32_t color1;
1374 uint32_t color2;
1375};
1376
1382struct Bar {
1383 double open;
1384 double high;
1385 double low;
1386 double close;
1387};
1388
1389extern "C" {
1390
1394bool resultIsSuccess(const Result *result);
1395
1399const char *resultErrorMessage(const Result *result);
1400
1404const Span *resultErrorSpan(const Result *result);
1405
1411void resultDelete(Result *result);
1412
1418Result *instanceCreate(const CreateInstanceOptions *options, Instance **instance);
1419
1433Result *instanceRun(Instance *instance,
1434 const uint8_t *symbol,
1435 uintptr_t symbol_len,
1436 const uint8_t *timeframe,
1437 uintptr_t timeframe_len,
1438 int64_t from_time,
1439 Option<InstanceEventCallback> event_callback,
1440 InstanceRunCallback callback,
1441 void *user_data);
1442
1446void instanceDelete(Instance *instance);
1447
1448const ScriptInfo *instanceScriptInfo(const Instance *instance);
1449
1450bool scriptInfoOverlay(const ScriptInfo *script_info);
1451
1452ScriptTypeKind scriptInfoScriptType(const ScriptInfo *script_info);
1453
1454bool scriptInfoTitle(const ScriptInfo *script_info, PineStringRef *value);
1455
1456bool scriptInfoIndicator(const ScriptInfo *script_info, Indicator *out);
1457
1458bool scriptInfoLibrary(const ScriptInfo *script_info, Library *out);
1459
1460bool scriptInfoStrategy(const ScriptInfo *script_info, Strategy *out);
1461
1462uintptr_t scriptInfoInputsLength(const ScriptInfo *script_info);
1463
1464const Input *scriptInfoInput(const ScriptInfo *script_info, uintptr_t index);
1465
1466bool inputFillInt(const Input *input, InputInt *out);
1467
1468bool inputFillFloat(const Input *input, InputFloat *out);
1469
1470bool inputFillBool(const Input *input, InputBool *out);
1471
1472bool inputFillColor(const Input *input, InputColor *out);
1473
1474bool inputFillString(const Input *input, InputString *out);
1475
1476bool inputFillPrice(const Input *input, InputPrice *out);
1477
1478bool inputFillSymbol(const Input *input, InputSymbol *out);
1479
1480bool inputFillTimeFrame(const Input *input, InputTimeFrame *out);
1481
1482bool inputFillSource(const Input *input, InputSource *out);
1483
1484bool inputFillEnum(const Input *input, InputEnum *out);
1485
1486bool inputFillSession(const Input *input, InputSession *out);
1487
1488bool inputFillTime(const Input *input, InputTime *out);
1489
1490bool inputFillTextArea(const Input *input, InputTextArea *out);
1491
1492bool inputIntOptionAt(const Input *input, uintptr_t index, int64_t *out);
1493
1494bool inputFloatOptionAt(const Input *input, uintptr_t index, double *out);
1495
1496bool inputStringOptionAt(const Input *input, uintptr_t index, PineStringRef *value);
1497
1498bool inputTimeFrameOptionAt(const Input *input, uintptr_t index, PineStringRef *value);
1499
1500bool inputEnumOptionAt(const Input *input, uintptr_t index, InputEnumOption *out);
1501
1502bool inputSessionOptionAt(const Input *input, uintptr_t index, PineStringRef *value);
1503
1504uintptr_t scriptInfoAlertConditionsLength(const ScriptInfo *script_info);
1505
1506bool scriptInfoAlertConditionTitle(const ScriptInfo *script_info,
1507 uintptr_t index,
1508 PineStringRef *value);
1509
1510bool scriptInfoAlertConditionMessage(const ScriptInfo *script_info,
1511 uintptr_t index,
1512 PineStringRef *value);
1513
1526CandlestickStream *candlestickStreamCreate(const uint8_t *_symbol,
1527 uintptr_t _symbol_len,
1528 const uint8_t *_timeframe,
1529 uintptr_t _timeframe_len,
1530 int64_t _from_time);
1531
1538Result *candlestickStreamPush(CandlestickStream *stream, const CandlestickItem *item);
1539
1548Result *candlestickStreamFinish(CandlestickStream *stream);
1549
1556const Chart *instanceChart(const Instance *instance);
1557
1561uintptr_t chartSeriesLength(const Chart *chart);
1562
1569FilledOrdersIterator *chartFilledOrdersOnBar(const Chart *chart, uintptr_t bar_index);
1570
1578bool filledOrdersIteratorNext(FilledOrdersIterator *iter, FilledOrder *out);
1579
1583void filledOrdersIteratorDelete(FilledOrdersIterator *iter);
1584
1588CGraphIterator *chartGraphIterator(const Chart *chart);
1589
1595bool graphIteratorNext(CGraphIterator *iter, int64_t *id, const Graph **graph);
1596
1600void graphIteratorDelete(CGraphIterator *iter);
1601
1605GraphType graphType(const Graph *g);
1606
1610const Hline *graphHline(const Graph *g);
1611
1615const Label *graphLabel(const Graph *g);
1616
1620const Line *graphLine(const Graph *g);
1621
1625const LineFill *graphLineFill(const Graph *g);
1626
1630const Polyline *graphPolyline(const Graph *g);
1631
1635const Table *graphTable(const Graph *g);
1636
1640const Box *graphBox(const Graph *g);
1641
1645double hlineValue(const Hline *h);
1646
1652bool hlineColor(const Hline *h, uint32_t *color);
1653
1657bool hlineTitle(const Hline *h, PineStringRef *value);
1658
1662HlineStyle hlineLineStyle(const Hline *h);
1663
1667int32_t hlineLineWidth(const Hline *h);
1668
1672bool hlineEditable(const Hline *h);
1673
1677uint32_t hlineDisplay(const Hline *h);
1678
1682int64_t lineX1(const Line *l);
1683
1687double lineY1(const Line *l);
1688
1692int64_t lineX2(const Line *l);
1693
1697double lineY2(const Line *l);
1698
1702XLocation lineXloc(const Line *l);
1703
1707Extend lineExtend(const Line *l);
1708
1714bool lineColor(const Line *l, uint32_t *color);
1715
1719LineStyle lineStyle(const Line *l);
1720
1724int32_t lineWidth(const Line *l);
1725
1729bool lineForceOverlay(const Line *l);
1730
1734int64_t lineFillLine1Id(const LineFill *lf);
1735
1739int64_t lineFillLine2Id(const LineFill *lf);
1740
1746bool lineFillColor(const LineFill *lf, uint32_t *color);
1747
1751uintptr_t polylinePointsLength(const Polyline *p);
1752
1758bool polylinePoint(const Polyline *p, uintptr_t idx, PolylinePoint *out);
1759
1763bool polylineCurved(const Polyline *p);
1764
1768bool polylineClosed(const Polyline *p);
1769
1775bool polylineLineColor(const Polyline *p, uint32_t *color);
1776
1782bool polylineFillColor(const Polyline *p, uint32_t *color);
1783
1787LineStyle polylineLineStyle(const Polyline *p);
1788
1792int32_t polylineLineWidth(const Polyline *p);
1793
1797bool polylineForceOverlay(const Polyline *p);
1798
1802int64_t boxLeft(const Box *b);
1803
1807double boxTop(const Box *b);
1808
1812int64_t boxRight(const Box *b);
1813
1817double boxBottom(const Box *b);
1818
1824bool boxBorderColor(const Box *b, uint32_t *color);
1825
1829int32_t boxBorderWidth(const Box *b);
1830
1834LineStyle boxBorderStyle(const Box *b);
1835
1839Extend boxExtend(const Box *b);
1840
1844XLocation boxXloc(const Box *b);
1845
1851bool boxBackgroundColor(const Box *b, uint32_t *color);
1852
1856void boxText(const Box *b, PineStringRef *value);
1857
1861uint32_t boxTextSize(const Box *b);
1862
1868bool boxTextColor(const Box *b, uint32_t *color);
1869
1873HorizontalAlign boxTextHalign(const Box *b);
1874
1878VerticalAlign boxTextValign(const Box *b);
1879
1883TextWrap boxTextWrap(const Box *b);
1884
1888FontFamily boxTextFontFamily(const Box *b);
1889
1893TextFormatting boxTextFormatting(const Box *b);
1894
1898bool boxForceOverlay(const Box *b);
1899
1903TablePosition tablePosition(const Table *t);
1904
1908uintptr_t tableNumColumns(const Table *t);
1909
1913uintptr_t tableNumRows(const Table *t);
1914
1920bool tableBackgroundColor(const Table *t, uint32_t *color);
1921
1927bool tableFrameColor(const Table *t, uint32_t *color);
1928
1932int32_t tableFrameWidth(const Table *t);
1933
1939bool tableBorderColor(const Table *t, uint32_t *color);
1940
1944int32_t tableBorderWidth(const Table *t);
1945
1949bool tableForceOverlay(const Table *t);
1950
1954const TableCell *tableCell(const Table *t, uintptr_t row, uintptr_t col);
1955
1959void tableCellText(const TableCell *c, PineStringRef *value);
1960
1964float tableCellWidth(const TableCell *c);
1965
1969float tableCellHeight(const TableCell *c);
1970
1974bool tableCellTextColor(const TableCell *c, uint32_t *color);
1975
1979HorizontalAlign tableCellTextHalign(const TableCell *c);
1980
1984VerticalAlign tableCellTextValign(const TableCell *c);
1985
1989uint32_t tableCellTextSize(const TableCell *c);
1990
1994bool tableCellBackgroundColor(const TableCell *c, uint32_t *color);
1995
1999bool tableCellTooltip(const TableCell *c, PineStringRef *value);
2000
2004FontFamily tableCellTextFontFamily(const TableCell *c);
2005
2009TextFormatting tableCellTextFormatting(const TableCell *c);
2010
2014uintptr_t tableCellColspan(const TableCell *c);
2015
2019uintptr_t tableCellRowspan(const TableCell *c);
2020
2024int64_t labelX(const Label *label);
2025
2029double labelY(const Label *label);
2030
2034void labelText(const Label *label, PineStringRef *value);
2035
2039XLocation labelXloc(const Label *label);
2040
2044YLocation labelYloc(const Label *label);
2045
2051bool labelColor(const Label *label, uint32_t *color);
2052
2056LabelStyle labelStyle(const Label *label);
2057
2063bool labelTextColor(const Label *label, uint32_t *color);
2064
2068uint32_t labelSize(const Label *label);
2069
2073HorizontalAlign labelTextAlign(const Label *label);
2074
2078bool labelTooltip(const Label *label, PineStringRef *value);
2079
2083FontFamily labelTextFontFamily(const Label *label);
2084
2088bool labelForceOverlay(const Label *label);
2089
2093TextFormatting labelTextFormatting(const Label *label);
2094
2098CSeriesGraphIterator *chartSeriesGraphIterator(const Chart *chart);
2099
2105bool seriesGraphIteratorNext(CSeriesGraphIterator *iter,
2106 int64_t *id,
2107 const SeriesGraph **series_graph);
2108
2112void seriesGraphIteratorDelete(CSeriesGraphIterator *iter);
2113
2117SeriesGraphType seriesGraphType(const SeriesGraph *sg);
2118
2122const Plot *seriesGraphPlot(const SeriesGraph *sg);
2123
2127const BackgroundColors *seriesGraphBackgroundColors(const SeriesGraph *sg);
2128
2132int32_t bgcolorsOffset(const BackgroundColors *bgcolors);
2133
2137bool bgcolorsEditable(const BackgroundColors *bgcolors);
2138
2144bool bgcolorsShowLast(const BackgroundColors *bgcolors, uintptr_t *value);
2145
2150bool bgcolorsTitle(const BackgroundColors *bgcolors, PineStringRef *value);
2151
2155uint32_t bgcolorsDisplay(const BackgroundColors *bgcolors);
2156
2160bool bgcolorsForceOverlay(const BackgroundColors *bgcolors);
2161
2167bool bgcolorsColor(const BackgroundColors *bgcolors, uintptr_t idx, uint32_t *color);
2168
2172const Fill *seriesGraphFill(const SeriesGraph *sg);
2173
2177FillAnchorType fillFromType(const Fill *fill);
2178
2184bool fillFromPlotId(const Fill *fill, int64_t *value);
2185
2191bool fillFromHlineId(const Fill *fill, int64_t *value);
2192
2196FillAnchorType fillToType(const Fill *fill);
2197
2203bool fillToPlotId(const Fill *fill, int64_t *value);
2204
2210bool fillToHlineId(const Fill *fill, int64_t *value);
2211
2215bool fillTitle(const Fill *fill, PineStringRef *value);
2216
2220bool fillEditable(const Fill *fill);
2221
2227bool fillShowLast(const Fill *fill, uintptr_t *value);
2228
2232bool fillFillGaps(const Fill *fill);
2233
2237uint32_t fillDisplay(const Fill *fill);
2238
2244bool fillColorType(const Fill *fill, uintptr_t idx, FillColorType *value);
2245
2251bool fillColorSolid(const Fill *fill, uintptr_t idx, uint32_t *value);
2252
2258bool fillColorGradient(const Fill *fill, uintptr_t idx, FillGradient *value);
2259
2263const PlotArrow *seriesGraphPlotArrow(const SeriesGraph *sg);
2264
2268bool plotArrowTitle(const PlotArrow *plot, PineStringRef *value);
2269
2275bool plotArrowValue(const PlotArrow *plot, uintptr_t idx, double *value);
2276
2282bool plotArrowUpColor(const PlotArrow *plot, uintptr_t idx, uint32_t *color);
2283
2289bool plotArrowDownColor(const PlotArrow *plot, uintptr_t idx, uint32_t *color);
2290
2294int32_t plotArrowOffset(const PlotArrow *plot);
2295
2299uintptr_t plotArrowMinHeight(const PlotArrow *plot);
2300
2304uintptr_t plotArrowMaxHeight(const PlotArrow *plot);
2305
2309bool plotArrowEditable(const PlotArrow *plot);
2310
2316bool plotArrowShowLast(const PlotArrow *plot, uintptr_t *value);
2317
2321uint32_t plotArrowDisplay(const PlotArrow *plot);
2322
2327bool plotArrowFormat(const PlotArrow *plot, PineStringRef *value);
2328
2334bool plotArrowPrecision(const PlotArrow *plot, int32_t *value);
2335
2339bool plotArrowForceOverlay(const PlotArrow *plot);
2340
2344const PlotBar *seriesGraphPlotBar(const SeriesGraph *sg);
2345
2349bool plotBarTitle(const PlotBar *plot, PineStringRef *value);
2350
2356bool plotBarValue(const PlotBar *plot, uintptr_t idx, Bar *value);
2357
2363bool plotBarColor(const PlotBar *plot, uintptr_t idx, uint32_t *color);
2364
2368bool plotBarEditable(const PlotBar *plot);
2369
2375bool plotBarShowLast(const PlotBar *plot, uintptr_t *value);
2376
2380uint32_t plotBarDisplay(const PlotBar *plot);
2381
2386bool plotBarFormat(const PlotBar *plot, PineStringRef *value);
2387
2393bool plotBarPrecision(const PlotBar *plot, int32_t *value);
2394
2398bool plotBarForceOverlay(const PlotBar *plot);
2399
2403const PlotCandle *seriesGraphPlotCandle(const SeriesGraph *sg);
2404
2408bool plotCandleTitle(const PlotCandle *plot, PineStringRef *value);
2409
2415bool plotCandleValue(const PlotCandle *plot, uintptr_t idx, Bar *value);
2416
2422bool plotCandleColor(const PlotCandle *plot, uintptr_t idx, uint32_t *color);
2423
2429bool plotCandleWickColor(const PlotCandle *plot, uintptr_t idx, uint32_t *color);
2430
2436bool plotCandleBorderColor(const PlotCandle *plot, uintptr_t idx, uint32_t *color);
2437
2441bool plotCandleEditable(const PlotCandle *plot);
2442
2448bool plotCandleShowLast(const PlotCandle *plot, uintptr_t *value);
2449
2453uint32_t plotCandleDisplay(const PlotCandle *plot);
2454
2459bool plotCandleFormat(const PlotCandle *plot, PineStringRef *value);
2460
2466bool plotCandlePrecision(const PlotCandle *plot, int32_t *value);
2467
2471bool plotCandleForceOverlay(const PlotCandle *plot);
2472
2476const PlotChar *seriesGraphPlotChar(const SeriesGraph *sg);
2477
2481bool plotCharTitle(const PlotChar *plot, PineStringRef *value);
2482
2488bool plotCharValue(const PlotChar *plot, uintptr_t idx, double *value);
2489
2495bool plotCharBoolValue(const PlotChar *plot, uintptr_t idx, bool *value);
2496
2500uint32_t plotCharChar(const PlotChar *plot);
2501
2505Location plotCharLocation(const PlotChar *plot);
2506
2510bool plotCharColor(const PlotChar *plot, uintptr_t idx, uint32_t *color);
2511
2515int32_t plotCharOffset(const PlotChar *plot);
2516
2520bool plotCharText(const PlotChar *plot, PineStringRef *value);
2521
2525bool plotCharTextColor(const PlotChar *plot, uintptr_t idx, uint32_t *color);
2526
2530bool plotCharEditable(const PlotChar *plot);
2531
2535Size plotCharSize(const PlotChar *plot);
2536
2540bool plotCharShowLast(const PlotChar *plot, uintptr_t *value);
2541
2545uint32_t plotCharDisplay(const PlotChar *plot);
2546
2551bool plotCharFormat(const PlotChar *plot, PineStringRef *value);
2552
2556bool plotCharPrecision(const PlotChar *plot, int32_t *value);
2557
2561bool plotCharForceOverlay(const PlotChar *plot);
2562
2566const PlotShape *seriesGraphPlotShape(const SeriesGraph *sg);
2567
2571bool plotShapeTitle(const PlotShape *plot, PineStringRef *value);
2572
2578bool plotShapeValue(const PlotShape *plot, uintptr_t idx, double *value);
2579
2585bool plotShapeBoolValue(const PlotShape *plot, uintptr_t idx, bool *value);
2586
2590Shape plotShapeStyle(const PlotShape *plot);
2591
2595Location plotShapeLocation(const PlotShape *plot);
2596
2600bool plotShapeColor(const PlotShape *plot, uintptr_t idx, uint32_t *color);
2601
2605int32_t plotShapeOffset(const PlotShape *plot);
2606
2610bool plotShapeText(const PlotShape *plot, PineStringRef *value);
2611
2615bool plotShapeTextColor(const PlotShape *plot, uintptr_t idx, uint32_t *color);
2616
2620bool plotShapeEditable(const PlotShape *plot);
2621
2625Size plotShapeSize(const PlotShape *plot);
2626
2630bool plotShapeShowLast(const PlotShape *plot, uintptr_t *value);
2631
2635uint32_t plotShapeDisplay(const PlotShape *plot);
2636
2641bool plotShapeFormat(const PlotShape *plot, PineStringRef *value);
2642
2646bool plotShapePrecision(const PlotShape *plot, int32_t *value);
2647
2651bool plotShapeForceOverlay(const PlotShape *plot);
2652
2656bool plotTitle(const Plot *plot, PineStringRef *value);
2657
2663bool plotValue(const Plot *plot, uintptr_t idx, double *value);
2664
2670bool plotColor(const Plot *plot, uintptr_t idx, uint32_t *color);
2671
2675int32_t plotLineWidth(const Plot *plot);
2676
2680PlotStyle plotStyle(const Plot *plot);
2681
2685bool plotTrackPrice(const Plot *plot);
2686
2690double plotHistBase(const Plot *plot);
2691
2695int32_t plotOffset(const Plot *plot);
2696
2700bool plotJoin(const Plot *plot);
2701
2705bool plotEditable(const Plot *plot);
2706
2712bool plotShowLast(const Plot *plot, uintptr_t *value);
2713
2717uint32_t plotDisplay(const Plot *plot);
2718
2722bool plotFormat(const Plot *plot, PineStringRef *value);
2723
2729bool plotPrecision(const Plot *plot, int32_t *value);
2730
2734bool plotForceOverlay(const Plot *plot);
2735
2739PlotLineStyle plotLineStyle(const Plot *plot);
2740
2744const BarColors *chartBarColors(const Chart *chart);
2745
2749int32_t barcolorsOffset(const BarColors *barcolors);
2750
2754bool barcolorsEditable(const BarColors *barcolors);
2755
2761bool barcolorsShowLast(const BarColors *barcolors, uintptr_t *value);
2762
2766bool barcolorsTitle(const BarColors *barcolors, PineStringRef *value);
2767
2771uint32_t barcolorsDisplay(const BarColors *barcolors);
2772
2778bool barcolorsColor(const BarColors *barcolors, uintptr_t idx, uint32_t *color);
2779
2780} // extern "C"
2781
2782} // namespace ffi
2783} // namespace openpine
Represents bar-colors settings in a chart.
RAII wrapper around a ffi::CandlestickStream.
Definition instance.hpp:57
Chart data produced by the VM.
Definition chart.hpp:35
Options for creating an Instance.
Definition instance.hpp:184
A single filled order (signal name, price, signed quantity).
Iterator over filled orders (strategy order fills) on a single bar.
Represents a non-series graph in a chart.
Definition graph.hpp:36
Represents a compiled, executable Pine Script instance.
Definition instance.hpp:235
Script metadata (type, overlay, title, inputs, alerts) produced by the VM.
Represents a series graph in a chart.
SourceType
Definition ffi.hpp:169