#[non_exhaustive]pub struct StrategyTrade {
pub side: OrderSide,
pub quantity: f64,
pub entry_time: DateTime<Utc>,
pub entry_price: f64,
pub exit: Option<StrategyExit>,
pub fees: f64,
pub label: Option<String>,
}Expand description
One round trip. A host that scales out reports each partial exit as its own trade with its share of the entry.
A trade is valid when quantity is finite and positive, entry_price and fees are finite, and,
if closed, the exit price and profit are finite and the exit is not before the entry. Prices may
be zero or negative. Invalid trades are left out of the metrics and the CSV, and counted in
StrategyPerformance::skipped_trades.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.side: OrderSideLong or short.
quantity: f64Size of the position: positive and finite.
entry_time: DateTime<Utc>When the position was opened.
entry_price: f64Average fill price of the entry.
exit: Option<StrategyExit>None while the trade is open.
fees: f64Commission and other costs of entry and exit, in the report’s currency. Already included in the exit’s profit.
label: Option<String>The host’s name for the entry, such as the rule that opened it. Display only.
Implementations§
Trait Implementations§
Source§impl Clone for StrategyTrade
impl Clone for StrategyTrade
Source§fn clone(&self) -> StrategyTrade
fn clone(&self) -> StrategyTrade
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StrategyTrade
impl Debug for StrategyTrade
Source§impl<'de> Deserialize<'de> for StrategyTrade
impl<'de> Deserialize<'de> for StrategyTrade
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 PartialEq for StrategyTrade
impl PartialEq for StrategyTrade
Source§impl Serialize for StrategyTrade
impl Serialize for StrategyTrade
impl StructuralPartialEq for StrategyTrade
Auto Trait Implementations§
impl Freeze for StrategyTrade
impl RefUnwindSafe for StrategyTrade
impl Send for StrategyTrade
impl Sync for StrategyTrade
impl Unpin for StrategyTrade
impl UnsafeUnpin for StrategyTrade
impl UnwindSafe for StrategyTrade
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 more