pub struct TradeMatch {Show 19 fields
pub match_created_at: DateTime<Utc>,
pub position_id: Uuid,
pub position_opened_at: DateTime<Utc>,
pub opening_trade_id: Uuid,
pub opening_trade_event_at: DateTime<Utc>,
pub closing_trade_id: Uuid,
pub closing_trade_event_at: DateTime<Utc>,
pub matched_amount: Decimal,
pub entry_price: Decimal,
pub exit_price: Decimal,
pub pnl: Decimal,
pub pnl_usd: Decimal,
pub roi: Option<Decimal>,
pub holding_duration: Option<Duration>,
pub id: Uuid,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub created_by: Option<String>,
pub updated_by: Option<String>,
}Expand description
Model representing a realized PnL event from matching trades.
Fields§
§match_created_at: DateTime<Utc>§position_id: Uuid§position_opened_at: DateTime<Utc>§opening_trade_id: Uuid§opening_trade_event_at: DateTime<Utc>§closing_trade_id: Uuid§closing_trade_event_at: DateTime<Utc>§matched_amount: Decimal§entry_price: Decimal§exit_price: Decimal§pnl: Decimal§pnl_usd: Decimal§roi: Option<Decimal>§holding_duration: Option<Duration>§id: Uuid§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§created_by: Option<String>§updated_by: Option<String>Implementations§
Source§impl TradeMatch
impl TradeMatch
Sourcepub fn new(
match_created_at: DateTime<Utc>,
position_id: Uuid,
position_opened_at: DateTime<Utc>,
opening_trade_id: Uuid,
opening_trade_event_at: DateTime<Utc>,
closing_trade_id: Uuid,
closing_trade_event_at: DateTime<Utc>,
matched_amount: Decimal,
entry_price: Decimal,
exit_price: Decimal,
pnl: Decimal,
pnl_usd: Decimal,
roi: Decimal,
holding_duration: Duration,
id: Uuid,
created_at: DateTime<Utc>,
updated_at: DateTime<Utc>,
created_by: String,
updated_by: String,
) -> Self
pub fn new( match_created_at: DateTime<Utc>, position_id: Uuid, position_opened_at: DateTime<Utc>, opening_trade_id: Uuid, opening_trade_event_at: DateTime<Utc>, closing_trade_id: Uuid, closing_trade_event_at: DateTime<Utc>, matched_amount: Decimal, entry_price: Decimal, exit_price: Decimal, pnl: Decimal, pnl_usd: Decimal, roi: Decimal, holding_duration: Duration, id: Uuid, created_at: DateTime<Utc>, updated_at: DateTime<Utc>, created_by: String, updated_by: String, ) -> Self
Create a new TradeMatch.
Trait Implementations§
Source§impl Clone for TradeMatch
impl Clone for TradeMatch
Source§fn clone(&self) -> TradeMatch
fn clone(&self) -> TradeMatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TradeMatch
impl Debug for TradeMatch
Source§impl<'de> Deserialize<'de> for TradeMatch
impl<'de> Deserialize<'de> for TradeMatch
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 TradeMatch
impl RefUnwindSafe for TradeMatch
impl Send for TradeMatch
impl Sync for TradeMatch
impl Unpin for TradeMatch
impl UnwindSafe for TradeMatch
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