#[repr(C)]pub struct OhlcvMsg {
pub hd: RecordHeader,
pub open: i64,
pub high: i64,
pub low: i64,
pub close: i64,
pub volume: u64,
}Expand description
Fields§
§hd: RecordHeaderThe common header.
open: i64The open price for the bar where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
See Prices.
high: i64The high price for the bar where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
See Prices.
low: i64The low price for the bar where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
See Prices.
close: i64The close price for the bar where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
See Prices.
volume: u64The total volume traded during the aggregation period.
Implementations§
Source§impl OhlcvMsg
impl OhlcvMsg
Sourcepub fn default_for_schema(schema: Schema) -> Self
pub fn default_for_schema(schema: Schema) -> Self
Creates a new default OhlcvMsg for the given schema.
Source§impl OhlcvMsg
impl OhlcvMsg
Sourcepub fn open_f64(&self) -> f64
pub fn open_f64(&self) -> f64
Converts the open price to a floating point.
UNDEF_PRICE will be converted to NaN.
This may introduce floating-point error.
Sourcepub fn high_f64(&self) -> f64
pub fn high_f64(&self) -> f64
Converts the high price to a floating point.
UNDEF_PRICE will be converted to NaN.
This may introduce floating-point error.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OhlcvMsg
impl<'de> Deserialize<'de> for OhlcvMsg
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a OhlcvMsg> for RecordRefEnum<'a>
impl<'a> From<&'a OhlcvMsg> for RecordRefEnum<'a>
Source§impl From<OhlcvMsg> for RecordEnum
impl From<OhlcvMsg> for RecordEnum
Source§impl<'py> IntoPyObject<'py> for OhlcvMsg
impl<'py> IntoPyObject<'py> for OhlcvMsg
Source§type Output = Bound<'py, <OhlcvMsg as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <OhlcvMsg as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PartialOrd for OhlcvMsg
impl PartialOrd for OhlcvMsg
Source§impl PyClassImpl for OhlcvMsg
impl PyClassImpl for OhlcvMsg
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = /// Open, high, low, close, and volume. The record of the following schemas:
/// - [`Ohlcv1S`](crate::enums::Schema::Ohlcv1S)
/// - [`Ohlcv1M`](crate::enums::Schema::Ohlcv1M)
/// - [`Ohlcv1H`](crate::enums::Schema::Ohlcv1H)
/// - [`Ohlcv1D`](crate::enums::Schema::Ohlcv1D)
/// - [`OhlcvEod`](crate::enums::Schema::OhlcvEod)
const RAW_DOC: &'static CStr = /// Open, high, low, close, and volume. The record of the following schemas: /// - [`Ohlcv1S`](crate::enums::Schema::Ohlcv1S) /// - [`Ohlcv1M`](crate::enums::Schema::Ohlcv1M) /// - [`Ohlcv1H`](crate::enums::Schema::Ohlcv1H) /// - [`Ohlcv1D`](crate::enums::Schema::Ohlcv1D) /// - [`OhlcvEod`](crate::enums::Schema::OhlcvEod)
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<OhlcvMsg>
type ThreadChecker = SendablePyClass<OhlcvMsg>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn dict_offset() -> Option<Py_ssize_t>
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for OhlcvMsg
Available on crate feature python only.
impl PyClassNewTextSignature for OhlcvMsg
Available on crate feature
python only.const TEXT_SIGNATURE: &'static str = "(rtype, publisher_id, instrument_id, ts_event, open, high, low, close, volume)"
Source§impl PyMethods<OhlcvMsg> for PyClassImplCollector<OhlcvMsg>
Available on crate feature python only.
impl PyMethods<OhlcvMsg> for PyClassImplCollector<OhlcvMsg>
Available on crate feature
python only.fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for OhlcvMsg
impl PyTypeInfo for OhlcvMsg
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Source§impl Record for OhlcvMsg
impl Record for OhlcvMsg
Source§fn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
Returns a reference to the
RecordHeader that comes at the beginning of all
record types.Source§fn record_size(&self) -> usize
fn record_size(&self) -> usize
Returns the size of the record in bytes.
Source§fn rtype(&self) -> Result<RType>
fn rtype(&self) -> Result<RType>
Tries to convert the raw record type into an enum which is useful for exhaustive
pattern matching. Read more
Source§fn publisher(&self) -> Result<Publisher>
fn publisher(&self) -> Result<Publisher>
Tries to convert the raw
publisher_id into an enum which is useful for
exhaustive pattern matching. Read moreSource§fn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
Returns the raw primary timestamp for the record. Read more
Source§fn index_ts(&self) -> Option<OffsetDateTime>
fn index_ts(&self) -> Option<OffsetDateTime>
Returns the primary timestamp for the record. Returns
None if the primary
timestamp contains the sentinel value for a null timestamp. Read moreSource§fn index_date(&self) -> Option<Date>
fn index_date(&self) -> Option<Date>
Returns the primary date for the record; the date component of the primary
timestamp (
index_ts()). Returns None if the primary timestamp contains the
sentinel value for a null timestamp.Source§impl RecordMut for OhlcvMsg
impl RecordMut for OhlcvMsg
Source§fn header_mut(&mut self) -> &mut RecordHeader
fn header_mut(&mut self) -> &mut RecordHeader
Returns a mutable reference to the
RecordHeader that comes at the beginning of
all record types.Source§impl WritePyRepr for OhlcvMsg
Available on crate feature python only.
impl WritePyRepr for OhlcvMsg
Available on crate feature
python only.Source§fn write_py_repr(&self, s: &mut String) -> Result
fn write_py_repr(&self, s: &mut String) -> Result
Writes a Python-style string representation to
s. Read moreSource§const SHOULD_FLATTEN: bool = false
const SHOULD_FLATTEN: bool = false
Whether this type’s fields should be flattened into the parent repr.
impl Copy for OhlcvMsg
impl DerefToPyAny for OhlcvMsg
impl Eq for OhlcvMsg
impl ExtractPyClassWithClone for OhlcvMsg
impl StructuralPartialEq for OhlcvMsg
Auto Trait Implementations§
impl Freeze for OhlcvMsg
impl RefUnwindSafe for OhlcvMsg
impl Send for OhlcvMsg
impl Sync for OhlcvMsg
impl Unpin for OhlcvMsg
impl UnwindSafe for OhlcvMsg
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
👎Deprecated since 0.27.0: Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.