Skip to main content

interval_label

Function interval_label 

Source
pub fn interval_label(tf: Timeframe) -> Option<&'static str>
Expand description

The interval word of the API for a timeframe, None for a timeframe the exchange has no candles for (10 minutes).

§Examples

use brokapi_bybit::util::interval_label;
use brokapi_core::Timeframe;

assert_eq!(interval_label(Timeframe::H4), Some("240"));
assert_eq!(interval_label(Timeframe::D1), Some("D"));
assert_eq!(interval_label(Timeframe::M10), None);