pub struct LedgerTrade {Show 14 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 exit_reason: String,
pub rule: Option<String>,
pub signal: Option<f64>,
pub regime: Option<String>,
pub asked: Option<f64>,
}Expand description
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
One trade in a ledger: a round trip, or a position still open at the end
(empty closed, no exit).
Fields§
§instrument: StringSYMBOL.VENUE; empty when it is the experiment’s own instrument.
opened: String§closed: String§direction: String“long” or “short”; empty means long.
quantity: f64§entry: f64§exit: Option<f64>§pnl: f64§commission: f64§exit_reason: String“signal”, “stop”, “halted”, “expired” or “still_open”; empty means signal.
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§
Trait Implementations§
Source§impl Clone for LedgerTrade
impl Clone for LedgerTrade
Source§impl Debug for LedgerTrade
impl Debug for LedgerTrade
Source§impl Default for LedgerTrade
impl Default for LedgerTrade
Source§impl<'de> Deserialize<'de> for LedgerTrade
impl<'de> Deserialize<'de> for LedgerTrade
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 LedgerTrade
impl Message for LedgerTrade
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.Source§impl PartialEq for LedgerTrade
impl PartialEq for LedgerTrade
Source§impl Serialize for LedgerTrade
impl Serialize for LedgerTrade
impl StructuralPartialEq for LedgerTrade
Auto Trait Implementations§
impl Freeze for LedgerTrade
impl RefUnwindSafe for LedgerTrade
impl Send for LedgerTrade
impl Sync for LedgerTrade
impl Unpin for LedgerTrade
impl UnsafeUnpin for LedgerTrade
impl UnwindSafe for LedgerTrade
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