pub struct ProtoOaAmendPositionSltpReq {
pub payload_type: Option<i32>,
pub ctid_trader_account_id: i64,
pub position_id: i64,
pub stop_loss: Option<f64>,
pub take_profit: Option<f64>,
pub guaranteed_stop_loss: Option<bool>,
pub trailing_stop_loss: Option<bool>,
pub stop_loss_trigger_method: Option<i32>,
}Expand description
- Request for amending StopLoss and TakeProfit of existing position. Allowed only if the accessToken has “trade” permissions for the trading account.
Fields§
§payload_type: Option<i32>§ctid_trader_account_id: i64Unique identifier of the trader’s account. Used to match responses to trader’s accounts.
position_id: i64The unique ID of the position to amend.
stop_loss: Option<f64>Absolute Stop Loss price (1.23456 for example).
take_profit: Option<f64>Absolute Take Profit price (1.26543 for example).
guaranteed_stop_loss: Option<bool>If TRUE then the Stop Loss is guaranteed. Available for the French Risk or the Guaranteed Stop Loss Accounts.
trailing_stop_loss: Option<bool>If TRUE then the Trailing Stop Loss is applied.
stop_loss_trigger_method: Option<i32>The Stop trigger method for the Stop Loss/Take Profit order.
Implementations§
Source§impl ProtoOaAmendPositionSltpReq
impl ProtoOaAmendPositionSltpReq
Sourcepub fn payload_type(&self) -> ProtoOaPayloadType
pub fn payload_type(&self) -> ProtoOaPayloadType
Returns the enum value of payload_type, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_payload_type(&mut self, value: ProtoOaPayloadType)
pub fn set_payload_type(&mut self, value: ProtoOaPayloadType)
Sets payload_type to the provided enum value.
Sourcepub fn stop_loss(&self) -> f64
pub fn stop_loss(&self) -> f64
Returns the value of stop_loss, or the default value if stop_loss is unset.
Sourcepub fn take_profit(&self) -> f64
pub fn take_profit(&self) -> f64
Returns the value of take_profit, or the default value if take_profit is unset.
Sourcepub fn guaranteed_stop_loss(&self) -> bool
pub fn guaranteed_stop_loss(&self) -> bool
Returns the value of guaranteed_stop_loss, or the default value if guaranteed_stop_loss is unset.
Sourcepub fn trailing_stop_loss(&self) -> bool
pub fn trailing_stop_loss(&self) -> bool
Returns the value of trailing_stop_loss, or the default value if trailing_stop_loss is unset.
Sourcepub fn stop_loss_trigger_method(&self) -> ProtoOaOrderTriggerMethod
pub fn stop_loss_trigger_method(&self) -> ProtoOaOrderTriggerMethod
Returns the enum value of stop_loss_trigger_method, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_stop_loss_trigger_method(&mut self, value: ProtoOaOrderTriggerMethod)
pub fn set_stop_loss_trigger_method(&mut self, value: ProtoOaOrderTriggerMethod)
Sets stop_loss_trigger_method to the provided enum value.
Trait Implementations§
Source§impl Clone for ProtoOaAmendPositionSltpReq
impl Clone for ProtoOaAmendPositionSltpReq
Source§fn clone(&self) -> ProtoOaAmendPositionSltpReq
fn clone(&self) -> ProtoOaAmendPositionSltpReq
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtoOaAmendPositionSltpReq
impl Debug for ProtoOaAmendPositionSltpReq
Source§impl<'de> Deserialize<'de> for ProtoOaAmendPositionSltpReq
impl<'de> Deserialize<'de> for ProtoOaAmendPositionSltpReq
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for ProtoOaAmendPositionSltpReq
impl Message for ProtoOaAmendPositionSltpReq
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.