Skip to main content

ProtoOaTrader

Struct ProtoOaTrader 

Source
pub struct ProtoOaTrader {
Show 22 fields pub ctid_trader_account_id: i64, pub balance: i64, pub balance_version: Option<i64>, pub manager_bonus: Option<i64>, pub ib_bonus: Option<i64>, pub non_withdrawable_bonus: Option<i64>, pub access_rights: Option<i32>, pub deposit_asset_id: i64, pub swap_free: Option<bool>, pub leverage_in_cents: Option<u32>, pub total_margin_calculation_type: Option<i32>, pub max_leverage: Option<u32>, pub french_risk: Option<bool>, pub trader_login: Option<i64>, pub account_type: Option<i32>, pub broker_name: Option<String>, pub registration_timestamp: Option<i64>, pub is_limited_risk: Option<bool>, pub limited_risk_margin_calculation_strategy: Option<i32>, pub money_digits: Option<u32>, pub fair_stop_out: Option<bool>, pub stop_out_strategy: Option<i32>,
}
Expand description
  • Trading account entity.

Fields§

§ctid_trader_account_id: i64

The unique Trader’s Account ID used to match the responses to the Trader’s Account.

§balance: i64

Current account balance.

§balance_version: Option<i64>

Balance version used to identify the final balance. Increments each time when the trader’s account balance is changed.

§manager_bonus: Option<i64>

Amount of broker’s bonus allocated to the account.

§ib_bonus: Option<i64>

Amount of introducing broker bonus allocated to the account.

§non_withdrawable_bonus: Option<i64>

Broker’s bonus that cannot be withdrew from the account as cash.

§access_rights: Option<i32>

Access rights that an owner has to the account in cTrader platform. See ProtoOAAccessRights for details.

§deposit_asset_id: i64

Deposit currency of the account.

§swap_free: Option<bool>

If TRUE then account is Shariah compliant.

§leverage_in_cents: Option<u32>

Account leverage (e.g. If leverage = 1:50 then value = 5000).

§total_margin_calculation_type: Option<i32>

Margin computation type for the account (MAX, SUM, NET).

§max_leverage: Option<u32>

Maximum allowed leverage for the account. Used as validation when a Trader can change leverage value.

§french_risk: Option<bool>
👎Deprecated

If TRUE then account is AMF compliant. Use isLimitedRisk and limitedRiskMarginCalculationStrategy.

§trader_login: Option<i64>

ID of the account that is unique per server (Broker).

§account_type: Option<i32>

Account type: HEDGED, NETTED, etc.

§broker_name: Option<String>

Some whitelabel assigned to trader by broker at the moment of account creation.

§registration_timestamp: Option<i64>

The Unix timestamp in milliseconds of the account registration. Should be used as minimal date in historical data requests.

§is_limited_risk: Option<bool>

If TRUE then account is compliant to use specific margin calculation strategy. Such accounts are require to have guaranteed stop loss on all positions.

§limited_risk_margin_calculation_strategy: Option<i32>

Special strategy used in margin calculations for this account (if account isLimitedRisk).

§money_digits: Option<u32>

Specifies the exponent of the monetary values. E.g. moneyDigits = 8 must be interpret as business value multiplied by 10^8, then real balance would be 10053099944 / 10^8 = 100.53099944. Affects balance, managerBonus, ibBonus, nonWithdrawableBonus.

§fair_stop_out: Option<bool>

If TRUE - Position is fully closed on Stop Out, if FALSE - smart (partial closing) Stop Out is applied, if unspecified - Stop Out format is determined by Broker.

§stop_out_strategy: Option<i32>

The Stop Out strategy that is used for this Trader. The Trader can change the value in the cTrader UI if this option is not disabled by the Broker

Implementations§

Source§

impl ProtoOaTrader

Source

pub fn balance_version(&self) -> i64

Returns the value of balance_version, or the default value if balance_version is unset.

Source

pub fn manager_bonus(&self) -> i64

Returns the value of manager_bonus, or the default value if manager_bonus is unset.

Source

pub fn ib_bonus(&self) -> i64

Returns the value of ib_bonus, or the default value if ib_bonus is unset.

Source

pub fn non_withdrawable_bonus(&self) -> i64

Returns the value of non_withdrawable_bonus, or the default value if non_withdrawable_bonus is unset.

Source

pub fn access_rights(&self) -> ProtoOaAccessRights

Returns the enum value of access_rights, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_access_rights(&mut self, value: ProtoOaAccessRights)

Sets access_rights to the provided enum value.

Source

pub fn swap_free(&self) -> bool

Returns the value of swap_free, or the default value if swap_free is unset.

Source

pub fn leverage_in_cents(&self) -> u32

Returns the value of leverage_in_cents, or the default value if leverage_in_cents is unset.

Source

pub fn total_margin_calculation_type(&self) -> ProtoOaTotalMarginCalculationType

Returns the enum value of total_margin_calculation_type, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_total_margin_calculation_type( &mut self, value: ProtoOaTotalMarginCalculationType, )

Sets total_margin_calculation_type to the provided enum value.

Source

pub fn max_leverage(&self) -> u32

Returns the value of max_leverage, or the default value if max_leverage is unset.

Source

pub fn french_risk(&self) -> bool

Returns the value of french_risk, or the default value if french_risk is unset.

Source

pub fn trader_login(&self) -> i64

Returns the value of trader_login, or the default value if trader_login is unset.

Source

pub fn account_type(&self) -> ProtoOaAccountType

Returns the enum value of account_type, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_account_type(&mut self, value: ProtoOaAccountType)

Sets account_type to the provided enum value.

Source

pub fn broker_name(&self) -> &str

Returns the value of broker_name, or the default value if broker_name is unset.

Source

pub fn registration_timestamp(&self) -> i64

Returns the value of registration_timestamp, or the default value if registration_timestamp is unset.

Source

pub fn is_limited_risk(&self) -> bool

Returns the value of is_limited_risk, or the default value if is_limited_risk is unset.

Source

pub fn limited_risk_margin_calculation_strategy( &self, ) -> ProtoOaLimitedRiskMarginCalculationStrategy

Returns the enum value of limited_risk_margin_calculation_strategy, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_limited_risk_margin_calculation_strategy( &mut self, value: ProtoOaLimitedRiskMarginCalculationStrategy, )

Sets limited_risk_margin_calculation_strategy to the provided enum value.

Source

pub fn money_digits(&self) -> u32

Returns the value of money_digits, or the default value if money_digits is unset.

Source

pub fn fair_stop_out(&self) -> bool

Returns the value of fair_stop_out, or the default value if fair_stop_out is unset.

Source

pub fn stop_out_strategy(&self) -> ProtoOaStopOutStrategy

Returns the enum value of stop_out_strategy, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_stop_out_strategy(&mut self, value: ProtoOaStopOutStrategy)

Sets stop_out_strategy to the provided enum value.

Trait Implementations§

Source§

impl Clone for ProtoOaTrader

Source§

fn clone(&self) -> ProtoOaTrader

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtoOaTrader

Source§

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

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

impl Default for ProtoOaTrader

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ProtoOaTrader

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 Hash for ProtoOaTrader

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for ProtoOaTrader

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for ProtoOaTrader

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ProtoOaTrader

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 Eq for ProtoOaTrader

Source§

impl StructuralPartialEq for ProtoOaTrader

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
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,