openpine_vm/visuals/
plotcandle.rs1use openpine_compiler::instructions::Color;
2use serde::{Deserialize, Serialize};
3
4use crate::{
5 series::Series,
6 visuals::{Bar, PlotDisplay, PlotFormat},
7};
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct PlotCandle {
12 pub title: Option<String>,
14 pub series: Series<Option<Bar>>,
16 pub colors: Series<Option<Color>>,
18 pub wick_colors: Series<Option<Color>>,
20 pub border_colors: Series<Option<Color>>,
22 pub editable: bool,
24 pub show_last: Option<usize>,
26 pub display: PlotDisplay,
28 pub format: Option<PlotFormat>,
30 pub precision: Option<i32>,
32 pub force_overlay: bool,
34}
35
36impl PlotCandle {
37 pub(crate) fn append_new(&mut self) {
38 self.series.append_new();
39 self.colors.append_new();
40 self.wick_colors.append_new();
41 self.border_colors.append_new();
42 }
43}