pub struct ProtoOaSpotEvent {
pub payload_type: Option<i32>,
pub ctid_trader_account_id: i64,
pub symbol_id: i64,
pub bid: Option<u64>,
pub ask: Option<u64>,
pub trendbar: Vec<ProtoOaTrendbar>,
pub session_close: Option<u64>,
pub timestamp: Option<i64>,
}Expand description
- Event that is sent when a new spot event is generated on the server side. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq. First event, received after subscription will contain latest spot prices even if market is closed.
Fields§
§payload_type: Option<i32>§ctid_trader_account_id: i64Unique identifier of the trader’s account. Used to match responses to trader’s accounts.
symbol_id: i64Unique identifier of the Symbol in cTrader platform.
bid: Option<u64>Bid price. Specified in 1/100000 of unit of a price. (e.g. 123000 in protocol means 1.23, 53423782 means 534.23782)
ask: Option<u64>Ask price. Specified in 1/100000 of unit of a price. (e.g. 123000 in protocol means 1.23, 53423782 means 534.23782)
trendbar: Vec<ProtoOaTrendbar>Returns live trend bar. Requires subscription on the trend bars.
session_close: Option<u64>Last session close. Specified in 1/100000 of unit of a price. (e.g. 123000 in protocol means 1.23, 53423782 means 534.23782)
timestamp: Option<i64>The Unix time for spot.
Implementations§
Source§impl ProtoOaSpotEvent
impl ProtoOaSpotEvent
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 session_close(&self) -> u64
pub fn session_close(&self) -> u64
Returns the value of session_close, or the default value if session_close is unset.
Trait Implementations§
Source§impl Clone for ProtoOaSpotEvent
impl Clone for ProtoOaSpotEvent
Source§fn clone(&self) -> ProtoOaSpotEvent
fn clone(&self) -> ProtoOaSpotEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtoOaSpotEvent
impl Debug for ProtoOaSpotEvent
Source§impl Default for ProtoOaSpotEvent
impl Default for ProtoOaSpotEvent
Source§impl<'de> Deserialize<'de> for ProtoOaSpotEvent
impl<'de> Deserialize<'de> for ProtoOaSpotEvent
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 ProtoOaSpotEvent
impl Message for ProtoOaSpotEvent
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.