Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 2.8 KB

README.md

File metadata and controls

64 lines (41 loc) · 2.8 KB

Volatility Strategies

Volatility strategies generate signals based on a volatility 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.

Acceleration Bands Strategy

The accelerationBandsStrategy uses the upperBand, and lowerBand values that are generated by the Acceleration Bands indicator function to provide a BUY action when closing is greather than or equals to upperBand, a SELL action otherwise.

import { abStrategy } from 'indicatorts';

const defaultConfig = { period: 20, multiplier: 4 };
const actions = abStrategy(asset, defaultConfig);

// Alternatively:
// const actions = accelerationBandsStrategy(asset, defaultConfig);

Bollinger Bands Strategy

The bollingerBandsStrategy uses the upperBand, and lowerBand values that are generated by the Bollinger Bands indicator function to provide a SELL action when the asset's closing is above the upperBand, and a BUY action when the asset's closing is below the lowerBand values, a HOLD action otherwise.

import { bbStrategy } from 'indicatorts';

const defaultConfig = { period: 20 };
const actions = bbStrategy(asset, defaultConfig);

// Alternatively:
// const actions = bollingerBandsStrategy(asset, defaultConfig);

Projection Oscillator Strategy

The projectionOscillatorStrategy uses po and spo values that are generated by the Projection Oscillator (PO) indicator function to provide a BUY action when po is above spo, and SELL action when po is below spo.

import { poStrategy } from 'indicatorts';

const defaultConfig = { period: 14, smooth: 3 };
const actions = poStrategy(asset, defaultConfig);

// Alternatively:
// const actions = projectionOscillatorStrategy(asset, defaultConfig);

Disclaimer

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.

License

Copyright (c) 2022 Onur Cinar. All Rights Reserved.

The source code is provided under MIT License.