bybit_rust_api/rest/enums/
tick_direction.rs

1use std::fmt::{Display, Formatter, Result};
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Serialize, Deserialize, PartialEq)]
6pub enum TickDirection {
7    // https://bybit-exchange.github.io/docs/v5/enum#tickdirection
8    #[serde(rename = "PlusTick")]
9    PlusTick, // price rise
10    #[serde(rename = "ZeroPlusTick")]
11    ZeroPlusTick, // trade occurs at the same price as the previous trade, which occurred at a price higher than that for the trade preceding it
12    #[serde(rename = "MinusTick")]
13    MinusTick, // price drop
14    #[serde(rename = "ZeroMinusTick")]
15    ZeroMinusTick, // trade occurs at the same price as the previous trade, which occurred at a price lower than that for the trade preceding it
16}
17
18impl Display for TickDirection {
19    fn fmt(&self, f: &mut Formatter) -> Result {
20        match self {
21            TickDirection::PlusTick => write!(f, "PlusTick"),
22            TickDirection::ZeroPlusTick => write!(f, "ZeroPlusTick"),
23            TickDirection::MinusTick => write!(f, "MinusTick"),
24            TickDirection::ZeroMinusTick => write!(f, "ZeroMinusTick"),
25        }
26    }
27}