pub struct Trade {Show 14 fields
pub trade_id: u32,
pub symbol: Option<String>,
pub side: i8,
pub entry_ts: DateTime<Utc>,
pub entry_price: f64,
pub entry_fill_price: f64,
pub exit_ts: Option<DateTime<Utc>>,
pub exit_price: Option<f64>,
pub exit_fill_price: Option<f64>,
pub pnl_gross: f64,
pub costs: f64,
pub pnl_net: f64,
pub quantity: f64,
pub entry_metadata: Option<HashMap<String, f64>>,
}Expand description
A completed (or open) trade record. Rich enough for later PA metadata.
Fields§
§trade_id: u32§symbol: Option<String>§side: i8§entry_ts: DateTime<Utc>§entry_price: f64§entry_fill_price: f64§exit_ts: Option<DateTime<Utc>>§exit_price: Option<f64>§exit_fill_price: Option<f64>§pnl_gross: f64§costs: f64§pnl_net: f64§quantity: f64Quantity (exposure) entered for this trade. Supports variable sizing from rich PA (pole_height) or feature signals (was hardcoded 1.0 pre-ug9t).
entry_metadata: Option<HashMap<String, f64>>Rich signal metadata at entry (e.g. pole_height from PA struct, regime,
cycle_momentum). Populated in streaming Next
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trade
impl<'de> Deserialize<'de> for Trade
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 Trade
impl RefUnwindSafe for Trade
impl Send for Trade
impl Sync for Trade
impl Unpin for Trade
impl UnsafeUnpin for Trade
impl UnwindSafe for Trade
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.