Skip to main content

to_range_bars_from_ohlc

Function to_range_bars_from_ohlc 

Source
pub fn to_range_bars_from_ohlc(
    data: &[Bar],
    config: &RangeBarConfig,
) -> Vec<RangeBar>
Expand description

Convert OHLC bars to range bars (approximation). A bar’s volume that would make its range bar’s volume overflow is left out.

Returns no bars when the range size is not a positive finite number.

§Safety Limits

  • When the bars move by more than two million range sizes, the range bars are built from the latest bar after which they move at most that much
  • At most the newest 5,000 range bars