pub struct GTT {
pub id: u32,
pub user_id: String,
pub parent_trigger: Option<u32>,
pub gtt_type: GTTTriggerType,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub expires_at: Option<DateTime<Utc>>,
pub status: GttStatus,
pub condition: GTTCondition,
pub orders: Vec<GTTOrderParams>,
pub meta: Option<Value>,
}
Expand description
GTT data structure
Fields§
§id: u32
GTT ID
user_id: String
User ID
parent_trigger: Option<u32>
Parent trigger (if this is part of a multi-leg GTT)
gtt_type: GTTTriggerType
GTT type
created_at: DateTime<Utc>
Created timestamp
updated_at: DateTime<Utc>
Updated timestamp
expires_at: Option<DateTime<Utc>>
Expires at (optional expiry)
status: GttStatus
GTT status
condition: GTTCondition
Condition
orders: Vec<GTTOrderParams>
Orders to be placed when triggered
meta: Option<Value>
Metadata
Implementations§
Source§impl GTT
impl GTT
Sourcepub fn is_triggered(&self) -> bool
pub fn is_triggered(&self) -> bool
Check if GTT is triggered
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if GTT is disabled
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if GTT is expired
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if GTT is cancelled
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Check if GTT is rejected
Sourcepub fn has_time_expired(&self) -> bool
pub fn has_time_expired(&self) -> bool
Check if GTT has expired based on expiry time
Sourcepub fn time_to_expiry(&self) -> Option<Duration>
pub fn time_to_expiry(&self) -> Option<Duration>
Get time remaining until expiry
Sourcepub fn is_single_trigger(&self) -> bool
pub fn is_single_trigger(&self) -> bool
Check if this is a single trigger GTT
Sourcepub fn is_two_leg(&self) -> bool
pub fn is_two_leg(&self) -> bool
Check if this is a two-leg (OCO) GTT
Sourcepub fn trigger_values(&self) -> &[f64]
pub fn trigger_values(&self) -> &[f64]
Get all trigger values
Sourcepub fn would_trigger(&self, current_price: f64) -> bool
pub fn would_trigger(&self, current_price: f64) -> bool
Check if current price would trigger the GTT
Sourcepub fn order_count(&self) -> usize
pub fn order_count(&self) -> usize
Get the number of orders to be executed
Sourcepub fn has_successful_orders(&self) -> bool
pub fn has_successful_orders(&self) -> bool
Check if any orders were successfully placed
Sourcepub fn successful_order_ids(&self) -> Vec<&str>
pub fn successful_order_ids(&self) -> Vec<&str>
Get successful order IDs
Sourcepub fn failed_orders(&self) -> Vec<(>TOrderParams, &str)>
pub fn failed_orders(&self) -> Vec<(>TOrderParams, &str)>
Get failed orders with rejection reasons
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GTT
impl<'de> Deserialize<'de> for GTT
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 GTT
impl RefUnwindSafe for GTT
impl Send for GTT
impl Sync for GTT
impl Unpin for GTT
impl UnwindSafe for GTT
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more