pub struct PositionReport {
pub pos_req_id: String,
pub symbol: String,
pub position_qty: Option<f64>,
pub average_price: Option<f64>,
pub unrealized_pnl: Option<f64>,
pub realized_pnl: Option<f64>,
pub position_date: Option<String>,
pub last_update_time: Option<DateTime<Utc>>,
}Expand description
Position Report message (MsgType = “AP”)
Fields§
§pos_req_id: StringPosition Request ID (710)
symbol: StringSymbol (55)
position_qty: Option<f64>Position Quantity (703)
average_price: Option<f64>Average Price (6)
unrealized_pnl: Option<f64>Unrealized PnL (1247)
realized_pnl: Option<f64>Realized PnL (1248)
position_date: Option<String>Position date (704) - optional
last_update_time: Option<DateTime<Utc>>Last update time
Implementations§
Source§impl PositionReport
impl PositionReport
Sourcepub fn with_position_qty(self, position_qty: f64) -> Self
pub fn with_position_qty(self, position_qty: f64) -> Self
Set position quantity
Sourcepub fn with_average_price(self, average_price: f64) -> Self
pub fn with_average_price(self, average_price: f64) -> Self
Set average price
Sourcepub fn with_unrealized_pnl(self, unrealized_pnl: f64) -> Self
pub fn with_unrealized_pnl(self, unrealized_pnl: f64) -> Self
Set unrealized PnL
Sourcepub fn with_realized_pnl(self, realized_pnl: f64) -> Self
pub fn with_realized_pnl(self, realized_pnl: f64) -> Self
Set realized PnL
Sourcepub fn with_position_date(self, position_date: String) -> Self
pub fn with_position_date(self, position_date: String) -> Self
Set position date
Sourcepub fn from_fix_message(message: &FixMessage) -> DeribitFixResult<Self>
pub fn from_fix_message(message: &FixMessage) -> DeribitFixResult<Self>
Parse from FIX message
Sourcepub fn to_fix_message(
&self,
sender_comp_id: String,
target_comp_id: String,
msg_seq_num: u32,
) -> DeribitFixResult<FixMessage>
pub fn to_fix_message( &self, sender_comp_id: String, target_comp_id: String, msg_seq_num: u32, ) -> DeribitFixResult<FixMessage>
Convert to FIX message for emission
Sourcepub fn to_position(&self) -> Position
pub fn to_position(&self) -> Position
Convert to deribit_base Position
Trait Implementations§
Source§impl Clone for PositionReport
impl Clone for PositionReport
Source§fn clone(&self) -> PositionReport
fn clone(&self) -> PositionReport
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 PositionReport
impl Debug for PositionReport
Source§impl<'de> Deserialize<'de> for PositionReport
impl<'de> Deserialize<'de> for PositionReport
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
Source§impl PartialEq for PositionReport
impl PartialEq for PositionReport
Source§impl Serialize for PositionReport
impl Serialize for PositionReport
impl StructuralPartialEq for PositionReport
Auto Trait Implementations§
impl Freeze for PositionReport
impl RefUnwindSafe for PositionReport
impl Send for PositionReport
impl Sync for PositionReport
impl Unpin for PositionReport
impl UnwindSafe for PositionReport
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