Expand description
Inter-bar microstructure features computed from lookback trade windows
GitHub Issue: https://github.com/terrylica/opendeviationbar-py/issues/59
This module provides features computed from trades that occurred BEFORE each bar opened, enabling enrichment of larger open deviation bars (e.g., 1000 dbps) with finer-grained microstructure signals without lookahead bias.
§Temporal Integrity
All features are computed from trades with timestamps strictly BEFORE the current bar’s
open_time. This ensures no lookahead bias in ML applications.
§Feature Tiers
- Tier 1: Core features (7) - low complexity, high value
- Tier 2: Statistical features (5) - medium complexity
- Tier 3: Advanced features (4) - higher complexity, from trading-fitness patterns
§Academic References
| Feature | Reference |
|---|---|
| OFI | Chordia et al. (2002) - Order imbalance |
| Kyle’s Lambda | Kyle (1985) - Continuous auctions and insider trading |
| Burstiness | Goh & Barabási (2008) - Burstiness and memory in complex systems |
| Kaufman ER | Kaufman (1995) - Smarter Trading |
| Garman-Klass | Garman & Klass (1980) - On the Estimation of Security Price Volatilities |
| Hurst (DFA) | Peng et al. (1994) - Mosaic organization of DNA nucleotides |
| Permutation Entropy | Bandt & Pompe (2002) - Permutation Entropy: A Natural Complexity Measure |
Structs§
- Inter
BarConfig - Configuration for inter-bar feature computation
- Inter
BarFeatures - Inter-bar features computed from lookback window
- Trade
History - Trade history ring buffer for inter-bar feature computation
- Trade
Snapshot - Lightweight snapshot of trade for history buffer
Enums§
- Lookback
Mode - Lookback mode for trade history