Abstractions for stream aggregation, we call them Indicator
s.
Add indicator
as a dependency of your project.
toml
[dependencies]
indicator = "0.4"
rust_decimal = "1.17.0"
rust_decimal_macros = "1.17.0"
time = { version = "0.3", default-features = false, features = ["macros"] }
And then, you can try these codes.
```rust use arrayvec::ArrayVec; use indicator::*; use rustdecimal::Decimal; use rustdecimal_macros::dec; use time::macros::{datetime, offset};
/// Return an indicator that calculate hl2
and ohlc4
simultaneously.
fn hl2ohlc4(period: Period) -> impl Operator