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: boolDraw orders and their brackets. Hidden orders still identify existing position exits.
show_positions: boolDraw positions. Hidden positions still supply their brackets’ entry price.
extend_lines: boolExtend lines to the left edge instead of starting at their labels.
label_alignment: TradingLabelAlignmentHorizontal placement of order and position labels.
submit: boolTreat the orders as projected, not yet placed: their entry lines are dashed and they offer a Buy or Sell submit button.
modify: boolOrder and bracket lines can be dragged, and brackets removed.
close: boolPosition labels offer a close button, and a reverse button with
reverse.
reverse: boolHovering a position’s label shows its reverse button. Needs close.
take_profit: boolPosition labels offer a TP button, dragged out to place a take profit as a limit order.
stop_loss: boolPosition labels offer an SL button, dragged out to place a stop loss as a stop order.
order_exits: boolLabels 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: f64The profit or loss of one unit moving by one price unit, in the account’s currency.
currency: &'a strThe account’s currency, such as “USD”.
tick_size: f64The positive tick size used to round dragged prices.
Trait Implementations§
Source§impl<'a> Clone for TradingLineOptions<'a>
impl<'a> Clone for TradingLineOptions<'a>
Source§fn clone(&self) -> TradingLineOptions<'a>
fn clone(&self) -> TradingLineOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for TradingLineOptions<'a>
impl<'a> RefUnwindSafe for TradingLineOptions<'a>
impl<'a> Send for TradingLineOptions<'a>
impl<'a> Sync for TradingLineOptions<'a>
impl<'a> Unpin for TradingLineOptions<'a>
impl<'a> UnsafeUnpin for TradingLineOptions<'a>
impl<'a> UnwindSafe for TradingLineOptions<'a>
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,
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