Skip to main content

pine_core/
syminfo.rs

1/// Symbol information the host supplies for a script run.
2///
3/// Mirrors PineScript's `syminfo.*` namespace: the instrument's identity and
4/// trading conventions. A script may read any of these; the host fills in what
5/// it knows and leaves the rest at their defaults.
6#[derive(Clone, Debug, Default)]
7pub struct SymInfo {
8    /// Symbol without exchange prefix, e.g. `"AAPL"` (`syminfo.ticker`).
9    pub ticker: String,
10    /// Fully qualified symbol including exchange, e.g. `"NASDAQ:AAPL"`
11    /// (`syminfo.tickerid`).
12    pub tickerid: String,
13    /// Human-readable description of the symbol (`syminfo.description`).
14    pub description: String,
15    /// Exchange/data-source prefix, e.g. `"NASDAQ"` (`syminfo.prefix`).
16    pub prefix: String,
17    /// Currency the symbol is quoted in, e.g. `"USD"` (`syminfo.currency`).
18    pub currency: String,
19    /// Base currency for forex pairs, e.g. `"EUR"` in `EURUSD`
20    /// (`syminfo.basecurrency`).
21    pub basecurrency: String,
22    /// Instrument type, e.g. `"stock"`, `"forex"`, `"crypto"` (`syminfo.type`).
23    pub type_: String,
24    /// Smallest price increment, e.g. `0.01` (`syminfo.mintick`).
25    pub mintick: f64,
26    /// Currency value of one point of price movement (`syminfo.pointvalue`).
27    pub pointvalue: f64,
28    /// Exchange timezone, e.g. `"America/New_York"` (`syminfo.timezone`).
29    pub timezone: String,
30    /// Trading session specification (`syminfo.session`).
31    pub session: String,
32}