Skip to main content

TradingSettings

Struct TradingSettings 

Source
pub struct TradingSettings {
Show 18 fields pub instant_orders: bool, pub bid_ask_labels: bool, pub play_execution_sound: bool, pub execution_sound: String, pub execution_sound_volume: f32, pub notifications: TradingNotifications, pub show_positions: bool, pub position_pnl: bool, pub position_pnl_unit: PnlUnit, pub reverse_button: bool, pub extend_lines: bool, pub label_alignment: TradingLabelAlignment, pub include_in_image: bool, pub show_orders: bool, pub bracket_pnl: bool, pub bracket_pnl_unit: PnlUnit, pub show_executions: bool, pub show_execution_labels: bool,
}
Expand description

Trading tab settings: the Buy and Sell buttons’ behaviour, notifications and the layers ui::trading::Trading::show draws through Trading::display with the ui feature. The Buy and Sell buttons themselves are StatusLineOptions::show_quote_boxes. Saved settings without a field take its default, unless the field says otherwise.

Fields§

§instant_orders: bool

Buy and Sell place a market order of the order quantity at once instead of opening the order ticket.

§bid_ask_labels: bool

Show current Bid and Ask tags supplied by the quote source.

§play_execution_sound: bool

Ask the host to play execution_sound for every fill, through ui::trading::Trading::take_execution_sound with the ui feature.

§execution_sound: String

The name of the sound the host plays for fills, one of the SettingsDialog::execution_sounds with the ui feature; empty for the host’s first.

§execution_sound_volume: f32

Local execution sound gain, from zero (muted) to one.

§notifications: TradingNotifications

Which trading events raise a notification.

§show_positions: bool

Draw the open positions.

§position_pnl: bool

Give each position’s profit or loss on its label.

§position_pnl_unit: PnlUnit

The unit of the positions’ profit or loss.

§reverse_button: bool

Show a position’s reverse button while its label is hovered.

§extend_lines: bool

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

§label_alignment: TradingLabelAlignment

Horizontal placement of order and position labels.

§include_in_image: bool

Include the visible trading overlays in images exported through ui::trading::Trading.

§show_orders: bool

Draw the working orders and their brackets.

§bracket_pnl: bool

Give on each take profit and stop loss the profit or loss of reaching it.

§bracket_pnl_unit: PnlUnit

The unit of the brackets’ profit or loss.

§show_executions: bool

Draw the fills on their bars.

§show_execution_labels: bool

Write the side and total quantity beside each fill’s mark. On for new settings; settings saved without this field keep labels off, as they were drawn when saved.

Trait Implementations§

Source§

impl Clone for TradingSettings

Source§

fn clone(&self) -> TradingSettings

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

impl Debug for TradingSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TradingSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TradingSettings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TradingSettings

Source§

fn eq(&self, other: &TradingSettings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for TradingSettings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TradingSettings

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.