pub struct OhlcvParams {
pub timeframe: Timeframe,
pub since: Option<i64>,
pub limit: Option<u32>,
pub until: Option<i64>,
pub price: Option<PriceType>,
}Expand description
Parameters for fetching OHLCV (candlestick) data.
Uses the builder pattern for ergonomic parameter construction.
§Example
use ccxt_core::types::params::{OhlcvParams, PriceType};
use ccxt_core::types::Timeframe;
let params = OhlcvParams::new(Timeframe::H1)
.since(1609459200000)
.limit(100)
.until(1609545600000)
.price(PriceType::Mark);Fields§
§timeframe: TimeframeTimeframe for the candlesticks.
since: Option<i64>Start timestamp in milliseconds.
limit: Option<u32>Maximum number of candles to return.
until: Option<i64>End timestamp in milliseconds.
price: Option<PriceType>Price type (mark, index, premiumIndex for futures).
Implementations§
Source§impl OhlcvParams
impl OhlcvParams
Sourcepub fn new(timeframe: Timeframe) -> OhlcvParams
pub fn new(timeframe: Timeframe) -> OhlcvParams
Create new OHLCV parameters with the specified timeframe.
Sourcepub fn since(self, ts: i64) -> OhlcvParams
pub fn since(self, ts: i64) -> OhlcvParams
Set the start timestamp.
Sourcepub fn limit(self, n: u32) -> OhlcvParams
pub fn limit(self, n: u32) -> OhlcvParams
Set the maximum number of candles.
Sourcepub fn until(self, ts: i64) -> OhlcvParams
pub fn until(self, ts: i64) -> OhlcvParams
Set the end timestamp.
Sourcepub fn price(self, p: PriceType) -> OhlcvParams
pub fn price(self, p: PriceType) -> OhlcvParams
Set the price type (for futures).
Trait Implementations§
Source§impl Clone for OhlcvParams
impl Clone for OhlcvParams
Source§fn clone(&self) -> OhlcvParams
fn clone(&self) -> OhlcvParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OhlcvParams
impl Debug for OhlcvParams
Source§impl Default for OhlcvParams
impl Default for OhlcvParams
Source§fn default() -> OhlcvParams
fn default() -> OhlcvParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OhlcvParams
impl RefUnwindSafe for OhlcvParams
impl Send for OhlcvParams
impl Sync for OhlcvParams
impl Unpin for OhlcvParams
impl UnwindSafe for OhlcvParams
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