#![allow(clippy::too_many_arguments, unused_imports, non_camel_case_types)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum TradeDirection {
#[serde(rename = "open_long")]
OPEN_LONG,
#[serde(rename = "open_short")]
OPEN_SHORT,
#[serde(rename = "close_long")]
CLOSE_LONG,
#[serde(rename = "close_short")]
CLOSE_SHORT,
#[serde(rename = "long_to_short")]
LONG_TO_SHORT,
#[serde(rename = "short_to_long")]
SHORT_TO_LONG,
}
impl TradeDirection {
pub fn as_str(&self) -> &'static str {
match self {
TradeDirection::OPEN_LONG => "open_long",
TradeDirection::OPEN_SHORT => "open_short",
TradeDirection::CLOSE_LONG => "close_long",
TradeDirection::CLOSE_SHORT => "close_short",
TradeDirection::LONG_TO_SHORT => "long_to_short",
TradeDirection::SHORT_TO_LONG => "short_to_long",
}
}
}