Skip to main content

TradingLineOptions

Struct TradingLineOptions 

Source
pub struct TradingLineOptions<'a> {
Show 17 fields pub show_orders: bool, pub show_positions: bool, pub extend_lines: bool, pub label_alignment: TradingLabelAlignment, pub submit: bool, pub modify: bool, pub close: bool, pub reverse: bool, pub take_profit: bool, pub stop_loss: bool, pub order_exits: bool, pub pnl: Option<PnlUnit>, pub bracket_pnl: Option<PnlUnit>, pub last_price: Option<f64>, pub point_value: f64, pub currency: &'a str, pub tick_size: f64,
}
Expand description

What render_trading_lines draws and offers.

Fields§

§show_orders: bool

Draw orders and their brackets. Hidden orders still identify existing position exits.

§show_positions: bool

Draw positions. Hidden positions still supply their brackets’ entry price.

§extend_lines: bool

Extend lines to the left edge instead of starting at their labels.

§label_alignment: TradingLabelAlignment

Horizontal placement of order and position labels.

§submit: bool

Treat the orders as projected, not yet placed: their entry lines are dashed and they offer a Buy or Sell submit button.

§modify: bool

Order and bracket lines can be dragged, and brackets removed.

§close: bool

Position labels offer a close button, and a reverse button with reverse.

§reverse: bool

Hovering a position’s label shows its reverse button. Needs close.

§take_profit: bool

Position labels offer a TP button, dragged out to place a take profit as a limit order.

§stop_loss: bool

Position labels offer an SL button, dragged out to place a stop loss as a stop order.

§order_exits: bool

Labels of orders with an entry price and no position bracket offer a TP button while the order has no take profit, and an SL button while it has no stop loss. Dragging one out places that exit at the pointer’s price and asks for it as a TradingLineAction::Modify.

§pnl: Option<PnlUnit>

A position’s label gives its profit or loss in this unit, or none.

§bracket_pnl: Option<PnlUnit>

A take profit or stop loss gives, in this unit, the profit or loss its order makes if the price reaches it, or none.

§last_price: Option<f64>

The last price, for a position’s profit or loss when the broker reports none.

§point_value: f64

The profit or loss of one unit moving by one price unit, in the account’s currency.

§currency: &'a str

The account’s currency, such as “USD”.

§tick_size: f64

The positive tick size used to round dragged prices.

Trait Implementations§

Source§

impl<'a> Clone for TradingLineOptions<'a>

Source§

fn clone(&self) -> TradingLineOptions<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.