openpine_vm/visuals/
xylocation.rs

1use openpine_macros::Enum;
2use serde::{Deserialize, Serialize};
3
4/// X-axis coordinate system used by some drawing primitives.
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Enum, Serialize, Deserialize)]
6pub enum XLocation {
7    /// Interpret x-values as bar indices.
8    #[openpine(name = "bi")]
9    Index,
10    /// Interpret x-values as bar timestamps.
11    #[openpine(name = "bt")]
12    Time,
13}
14
15/// Y-axis coordinate system used by some drawing primitives.
16#[derive(Debug, Clone, Copy, PartialEq, Eq, Enum, Serialize, Deserialize)]
17#[openpine(rename_all = "lowercase")]
18pub enum YLocation {
19    /// Interpret y-values as price.
20    Price,
21    /// Place the object above the bar.
22    AboveBar,
23    /// Place the object below the bar.
24    BelowBar,
25}