pub struct TradeRow {Show 15 fields
pub instrument: String,
pub opened: String,
pub closed: String,
pub direction: String,
pub quantity: f64,
pub entry: f64,
pub exit: Option<f64>,
pub pnl: f64,
pub commission: f64,
pub held_days: Option<f64>,
pub exit_reason: String,
pub rule: Option<String>,
pub signal: Option<f64>,
pub regime: Option<String>,
pub asked: Option<f64>,
}Expand description
One round trip, as a trades table shows it and a CSV export writes it.
Fields§
§instrument: StringWhich instrument the round trip was in. Empty on an ordinary study, whose subject line already says; on a book it is the difference between a usable export and trades from three instruments with no way to tell them apart.
opened: String§closed: String§direction: String§quantity: f64§entry: f64§exit: Option<f64>§pnl: f64§commission: f64§held_days: Option<f64>§exit_reason: String§rule: Option<String>What the rule saw at entry (#190): the condition that fired, the value it was judged on, the regime it saw, and the quantity it asked the gate for. Absent on a trade recorded before the journal or opened by no rule.
signal: Option<f64>§regime: Option<String>§asked: Option<f64>Implementations§
Source§impl TradeRow
impl TradeRow
Sourcepub fn held_days(&self) -> f64
pub fn held_days(&self) -> f64
Returns the value of held_days, or the default value if held_days is unset.
Sourcepub fn signal(&self) -> f64
pub fn signal(&self) -> f64
Returns the value of signal, or the default value if signal is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TradeRow
impl<'de> Deserialize<'de> for TradeRow
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 Message for TradeRow
impl Message for TradeRow
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for TradeRow
Auto Trait Implementations§
impl Freeze for TradeRow
impl RefUnwindSafe for TradeRow
impl Send for TradeRow
impl Sync for TradeRow
impl Unpin for TradeRow
impl UnsafeUnpin for TradeRow
impl UnwindSafe for TradeRow
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