| Crates.io | rangebar-providers |
| lib.rs | rangebar-providers |
| version | 6.1.1 |
| created_at | 2025-11-12 05:52:08.931056+00 |
| updated_at | 2026-01-10 12:42:19.613077+00 |
| description | Data providers for rangebar: Binance, Exness |
| homepage | https://github.com/terrylica/rangebar |
| repository | https://github.com/terrylica/rangebar |
| max_upload_size | |
| id | 1928851 |
| size | 140,037 |
Non-lookahead range bar construction for cryptocurrency and forex trading.
This crate provides algorithms for constructing range bars from tick data with temporal integrity guarantees, ensuring no lookahead bias in financial backtesting.
Add to your Cargo.toml:
[dependencies]
rangebar = "6.1"
This is a meta-crate that re-exports all rangebar sub-crates for backward compatibility with v4.0.0. New code should depend on specific sub-crates directly:
rangebar-core - Core algorithm and typesrangebar-providers - Data providers (Binance, Exness)rangebar-config - Configuration managementrangebar-io - I/O operations and Polars integrationrangebar-streaming - Real-time streaming processorrangebar-batch - Batch analytics enginerangebar-cli - Command-line toolscore - Core algorithm (always enabled)providers - Data providers (Binance, Exness)config - Configuration managementio - I/O operations and Polars integrationstreaming - Real-time streaming processorbatch - Batch analytics enginefull - Enable all featuresuse rangebar::{RangeBarProcessor, AggTrade, FixedPoint};
// Create processor with 25 basis points threshold (0.25%)
let mut processor = RangeBarProcessor::new(250).unwrap();
// Create sample aggTrade
let trade = AggTrade {
agg_trade_id: 1,
price: FixedPoint::from_str("50000.0").unwrap(),
volume: FixedPoint::from_str("1.0").unwrap(),
first_trade_id: 1,
last_trade_id: 1,
timestamp: 1609459200000,
is_buyer_maker: false,
is_best_match: None,
};
// Process aggTrade records into range bars
let agg_trade_records = vec![trade];
let bars = processor.process_agg_trade_records(&agg_trade_records).unwrap();
use rangebar::streaming::StreamingProcessor;
let threshold_decimal_bps = 250; // 25 bps = 0.25% range bars
let processor = StreamingProcessor::new(threshold_decimal_bps);
// Real-time processing with bounded memory
use rangebar::batch::BatchAnalysisEngine;
use rangebar::core::types::RangeBar;
let range_bars: Vec<RangeBar> = vec![]; // Your range bar data
let engine = BatchAnalysisEngine::new();
// let result = engine.analyze_single_symbol(&range_bars, "BTCUSDT").unwrap();
MIT license. See LICENSE for details.