Deal

Struct Deal 

Source
pub struct Deal {
Show 53 fields pub id: usize, pub bot_id: usize, pub max_safety_orders: usize, pub deal_has_error: bool, pub account_id: usize, pub active_safety_orders_count: usize, pub created_at: DateTime<Utc>, pub updated_at: Option<DateTime<Utc>>, pub closed_at: Option<DateTime<Utc>>, pub is_finished: bool, pub current_active_safety_orders_count: usize, pub completed_safety_orders_count: usize, pub completed_manual_safety_orders_count: usize, pub pair: Pair, pub status: DealStatus, pub take_profit: Decimal, pub base_order_volume: Decimal, pub safety_order_volume: Decimal, pub safety_order_step_percentage: Decimal, pub bought_amount: Option<Decimal>, pub bought_volume: Option<Decimal>, pub bought_average_price: Option<Decimal>, pub sold_amount: Option<Decimal>, pub sold_volume: Option<Decimal>, pub sold_average_price: Option<Decimal>, pub take_profit_type: TakeProfitType, pub final_profit: Decimal, pub martingale_coefficient: Decimal, pub martingale_volume_coefficient: Decimal, pub martingale_step_coefficient: Decimal, pub profit_currency: ProfitCurrency, pub stop_loss_type: StopLossType, pub safety_order_volume_type: VolumeType, pub base_order_volume_type: VolumeType, pub from_currency: SmolStr, pub to_currency: SmolStr, pub current_price: Decimal, pub take_profit_price: Option<Decimal>, pub stop_loss_price: Option<Decimal>, pub final_profit_percentage: Decimal, pub actual_profit_percentage: Decimal, pub bot_name: String, pub account_name: String, pub usd_final_profit: Decimal, pub actual_profit: Decimal, pub actual_usd_profit: Decimal, pub failed_message: Option<String>, pub reserved_base_coin: Decimal, pub reserved_second_coin: Decimal, pub trailing_deviation: Decimal, pub trailing_max_price: Option<Decimal>, pub tsl_max_price: Option<Decimal>, pub strategy: Strategy,
}

Fields§

§id: usize§bot_id: usize§max_safety_orders: usize§deal_has_error: bool§account_id: usize§active_safety_orders_count: usize§created_at: DateTime<Utc>§updated_at: Option<DateTime<Utc>>§closed_at: Option<DateTime<Utc>>§is_finished: bool§current_active_safety_orders_count: usize§completed_safety_orders_count: usize

completed safeties (not including manual)

§completed_manual_safety_orders_count: usize

completed manual safeties

§pair: Pair§status: DealStatus§take_profit: Decimal§base_order_volume: Decimal§safety_order_volume: Decimal§safety_order_step_percentage: Decimal§bought_amount: Option<Decimal>§bought_volume: Option<Decimal>§bought_average_price: Option<Decimal>§sold_amount: Option<Decimal>§sold_volume: Option<Decimal>§sold_average_price: Option<Decimal>§take_profit_type: TakeProfitType§final_profit: Decimal§martingale_coefficient: Decimal§martingale_volume_coefficient: Decimal§martingale_step_coefficient: Decimal§profit_currency: ProfitCurrency§stop_loss_type: StopLossType§safety_order_volume_type: VolumeType§base_order_volume_type: VolumeType§from_currency: SmolStr§to_currency: SmolStr§current_price: Decimal§take_profit_price: Option<Decimal>§stop_loss_price: Option<Decimal>§final_profit_percentage: Decimal§actual_profit_percentage: Decimal§bot_name: String§account_name: String§usd_final_profit: Decimal§actual_profit: Decimal§actual_usd_profit: Decimal§failed_message: Option<String>§reserved_base_coin: Decimal§reserved_second_coin: Decimal§trailing_deviation: Decimal§trailing_max_price: Option<Decimal>

Highest price met in case of long deal, lowest price otherwise

§tsl_max_price: Option<Decimal>

Highest price met in TSL in case of long deal, lowest price otherwise

§strategy: Strategy

Implementations§

Source§

impl Deal

Source

pub fn id(&self) -> usize

Source

pub fn account_id(&self) -> usize

Source

pub fn bot_id(&self) -> usize

Source

pub fn created_at(&self) -> DateTime<Utc>

Source

pub fn status(&self) -> DealStatus

Source

pub fn is_finished(&self) -> bool

Source

pub fn is_active(&self) -> bool

Source

pub fn pair(&self) -> &Pair

Source

pub fn strategy(&self) -> Strategy

Source

pub fn max_safety_orders(&self) -> usize

Source

pub fn completed_safety_orders_count(&self) -> usize

Source

pub fn completed_manual_safety_orders_count(&self) -> usize

Source

pub fn bought_volume(&self) -> Option<Decimal>

Source

pub fn reserved_base_coin(&self) -> Decimal

Source

pub fn actual_profit(&self) -> Decimal

Source

pub fn actual_usd_profit(&self) -> Decimal

Trait Implementations§

Source§

impl Clone for Deal

Source§

fn clone(&self) -> Deal

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Deal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Deal

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Freeze for Deal

§

impl RefUnwindSafe for Deal

§

impl Send for Deal

§

impl Sync for Deal

§

impl Unpin for Deal

§

impl UnwindSafe for Deal

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,