Trend strategies generate signals based on a trend indicator.
NOTE: All configuration objects for all strategies are optional. If no configuration object is passed, the default configuration will be used. Likewise, you may also partially pass a configuration object, and the default values will be used for the missing properties.
The absolutePriceOscillatorStrategy uses the values that are generated by the Absolute Price Oscillator (APO) indicator to provide a BUY action when the AO is greather than zero, and SELL action when AO is less than zero, otherwise HOLD action.
import { apoStrategy } from 'indicatorts';
const defaultConfig = { fast: 14, slow: 30 };
const actions = apoStrategy(asset, defaultConfig);
// Alternatively:
// const actions = absolutePriceOscillatorStrategy(asset, defaultConfig);
The aroonStrategy uses the values that are generated by the Aroon Indicator to provide a BUY action when the up is greather than down, and SELL action when up is less than down, otherwise HOLD action.
import { aroonStrategy } from 'indicatorts';
const defaultConfig = { period: 25 };
const actions = aroonStrategy(asset, defaultConfig);
The balanceOfPowerStrategy uses the values that are generated by the Balance of Power (BOP) indicator to provide a BUY action when the BOP is greather than zero, and SELL action when BOP is less than zero, otherwise HOLD action.
import { bopStrategy } from 'indicatorts';
const actions = bopStrategy(asset);
// Alternatively:
// const actions = balanceOfPowerStrategy(asset);
The chandeForecastOscillatorStrategy uses cfo values that are generated by the Chande Forecast Oscillator (CFO) indicator function to provide a BUY action when cfo is below zero, and SELL action when cfo is above zero.
import { cfoStrategy } from 'indicatorts';
const actions = cfoStrategy(asset);
// Alternatively:
// const actions = chandeForecastOscillatorStrategy(asset);
The kdjStrategy function uses the k, d, j values that are generated by the Random Index (KDJ) indicator function to provide a BUY action when k crosses above d and j. It is stronger when below 20%. Also the SELL action is when k crosses below d and j. It is strong when above 80%.
import { kdjStrategy } from 'indicatorts';
const defaultConfig = { rPeriod: 9, kPeriod: 3, dPeriod: 3 };
const actions = kdjStrategy(asset, defaultConfig);
The macdStrategy uses the macd, and signal values that are generated by the Moving Average Convergence Divergence (MACD) indicator function to provide a BUY action when macd crosses above signal, and SELL action when macd crosses below signal.
import { macdStrategy } from 'indicatorts';
const defaultConfig = { fast: 12, slow: 26, signal: 9 };
const actions = macdStrategy(asset, defaultConfig);
// Alternatively:
// const actions = movingAverageConvergenceDivergenceStrategy(asset, defaultConfig);
The parabolicSARStrategy uses the values that are generated by the Parabolic SAR indicator function to provide a BUY action when the trend is FALLING, and SELL action when the trend is RISING, and HOLD action when the trend is STABLE.
import { psarStrategy } from 'indicatorts';
const defaultConfig = { step: 0.02, max: 0.2 };
const actions = psarStrategy(asset, defaultConfig);
// Alternatively:
// const actions = parabolicSARStrategy(asset, defaultConfig);
The typicalPriceStrategy uses the values that are generated by the Typical Price indicator function to provide a BUY action when the value is greather than the previous value, and SELL action when the value is less than the previous value, and HOLD action when value is equal to the previous value.
import { typpriceStrategy } from 'indicatorts';
const actions = typpriceStrategy(asset);
// Alternatively:
// const actions = typicalPriceStrategy(asset);
The vwmaStrategy function uses SMA and VWMA indicators to provide a BUY action when VWMA is above SMA, and a SELL signal when VWMA is below SMA, a HOLD signal otherwse.
import { vwmaStrategy } from 'indicatorts';
const defaultConfig = { period: 20 };
const actions = vwmaStrategy(asset, defaultConfig);
// Alternatively:
// const actions = volumeWeightedMovingAverageStrategy(asset, defaultConfig);
The vortexStrategy uses the values that are generated by the Vortex Indicator indicator function to provide a BUY action when the plusVi is greather than the minusVi, and SELL action when the plusVi is less than the minusVi, and HOLD action when the plusVi is equal to the minusVi.
import { vortexStrategy } from 'indicatorts';
const defaultConfig = { period: 14 };
const actions = vortexStrategy(asset, defaultConfig);
The information provided on this project is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.
Copyright (c) 2022 Onur Cinar. All Rights Reserved.
The source code is provided under MIT License.