Sliding Features

Modular, chainable sliding window with various signal processing functions and technical indicators including normalization. Values in window are updated with each call to update. A View defines the function which processes the incoming values and provides an output value. Views can easily be added by implementing the View Trait which requires two functions: - update(&mut self, val: f64): Call whenever you have a new value with which to update the View - last(&self) -> f64: Retrieve the last value from the View

There are two ways of creating a new View: - new(view: Box, windowlen: usize): Use if you want to chain another view to be calculated first - newfinal(windowlen: usize): Use if this View will be the last in the chain The last View which in each chain is always Echo, as this just echos the current value. Some Views have additional parameters such as ALMA. They can be created using the newcustom() function.

A SlidingWindow can be used to hold multiple chained views, which hast the following function: - new(): Create a new SlidingWindow - register_view(&mut self, view: Box): add a chainable View - update(&mut self, val: f64): Update all Views with a new value - last(&self) -> Vec: Get all the latest values from each View

This struct allows you to manage a bunch of Views at once and conveniently update them all.

Usage

In your Cargo.toml add the crate: toml sliding_features = "0.7.0"

See examples folder for some code ideas shell cargo run --release --example basic_multiple_views cargo run --release --example basic_single_view cargo run --release --example basic_chainable_view

Views

A View defines the function which processes value updates. They currently include: * Echo * Technical Indicators * Center of Gravity * Cyber Cycle * Laguerre RSI * Laguerre Filter * ReFlex * TrendFlex * ROC * RSI * MyRSI (RSI in range [-1.0, 1.0]) * NET (John Ehlers noise elimination technology using kendall correlation) * Correlation Trend Indicator (CTI) * Polarized Fractal Efficiency * Ehlers Fisher Transform * Normalization / variance / mean standardization * HLNormalizer, a sliding high-low normalizer * Variance Stabilizing Transform (VST) * Variance Stabilizing Centering Transform (VSCT) * Moving Averages * ALMA (Arnaux Legoux Moving Average) * SMA (Simple Moving Average) * EMA (Exponential Moving Average) * Standard deviation sliding window estimation using WelfordOnlineSliding * Multiplier * Cumulative * Entropy (acts on a bit stream, thus does not impl View trait)

Images

Underlying data synthetically generated by MathisWellmann/timeseriesgenerator-rs using a standard normal (gaussian) process. Note that each run uses common test data from test_data.rs for consistency.

TODOs:

Feel free to implement the following and create a PR for some easy open-source contributions: - Roofing Filter - FRAMA - MAMA - FAMA - Stochastic - Super Smoother - Zero Lag - gaussian filter - correlation cycle indicator - some indicators can be built with const sized arrays, for better performance - add Default impl for all - and so much more...

Contributing

If you have a sliding window function or indicator which you would like to integrate, feel free to create a pull request. Any help is highly appreciated. Let's build the greatest sliding window library together :handshake:

Donations :moneybag: :moneywithwings:

I you would like to support the development of this crate, feel free to send over a donation:

Monero (XMR) address: plain 47xMvxNKsCKMt2owkDuN1Bci2KMiqGrAFCQFSLijWLs49ua67222Wu3LZryyopDVPYgYmAnYkSZSz9ZW2buaDwdyKTWGwwb

monero

License

Copyright (C) 2020

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

GNU AGPLv3