trend-remover
v0.0.11
Published
remove simple linear trend from OHLC candles and 1D data series
Downloads
5
Readme
trend-remover
remove trends from OHLC candles and 1D data series using a rolling window or start/end prices.
Installation
npm i trend-remover
Usage
//note - for rolling window size N, first N values get "truncated" / clamped to first value
// var candles = [{open, high, low, close}...]
// candles = tr.removeTrendCandlesRolling(candles, days=14) //show changes relative to 14 unit rolling window
// candles = tr.removeTrendCandles(candles, multiplierDown=1) //linearly skew to remove trend so the first and last closing price are the same
// [if multiplierDown > 1 then slope is negative]
// var data = [1,2,3,4...]
// data = tr.removeTrend(data, multiplierDown=1)
// data = tr.removeTrendRolling(data, days=14)