pub struct Trade {
pub entry_time: i64,
pub exit_time: i64,
pub entry_price: f64,
pub exit_price: f64,
pub qty: f64,
pub pnl: f64,
pub return_pct: f64,
pub reason: String,
}Expand description
A completed round-trip trade.
Fields§
§entry_time: i64Entry bar time.
exit_time: i64Exit bar time.
entry_price: f64Entry fill price.
exit_price: f64Exit fill price.
qty: f64Position quantity.
pnl: f64Realised PnL net of fees.
return_pct: f64Return on the entry notional, in percent.
reason: StringWhy the position was closed (signal / stop_loss / take_profit / end).
Trait Implementations§
impl StructuralPartialEq for Trade
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,
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 more