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.
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.
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>,
Source§impl Message for LedgerTrade
impl Message for LedgerTrade
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
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,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
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,
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,
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,
self.