rangebar
Non-lookahead range bar construction for cryptocurrency trading with temporal integrity guarantees.
Quick Start
Add this to your Cargo.toml:
[]
= "0.5"
Usage
use ;
// Create processor with 0.25% threshold (250 basis points)
let mut processor = new;
// Create sample trade
let trade = AggTrade ;
// Process trades into range bars
let trades = vec!;
let bars = processor.process_trades.unwrap;
for bar in bars
Algorithm
Range bars close when price moves ±threshold% from the bar's opening price:
- Non-lookahead bias: Thresholds computed only from bar open price
- Breach inclusion: Breaching trade included in closing bar
- Fixed thresholds: Never recalculated during bar lifetime
Features
- Non-lookahead bias range bar construction
- Fixed-point arithmetic for precision
- Streaming and batch processing modes
- Tier-1 cryptocurrency symbol discovery
License
MIT license. See LICENSE for details.