Skip to content

Latest commit

 

History

History
109 lines (71 loc) · 4.8 KB

README.md

File metadata and controls

109 lines (71 loc) · 4.8 KB

Volume Strategies

Momentum strategies generate signals based on a momentum 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.

Chaikin Money Flow Strategy

The chaikinMoneyFlowStrategy uses the cmf values that are generated by the Chaikin Money Flow (CMF) indicator function to provide a BUY action when cmf is less than zero, a SELL action when cmf is greather than zero, a HOLD action otherwise.

import { cmfStrategy } from 'indicatorts';

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

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

Ease of Movement Strategy

The easeOfMovementStrategy uses the emv values that are generated by the Ease of Movement (EMV) indicator function to provide a BUY action when emv is greather than zero, and a SELL action when emv is less than zero, a HOLD action otherwise.

import { emvStrategy } from 'indicatorts';

const defaultConfig = { period: 14 };
const actions = emvStrategy(asset, defaultConfig);

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

Force Index Strategy

The forceIndexStrategy uses the fi values that are generated by the Force Index (FI) indicator function to provide a BUY action when fi is greather than zero, and a SELL action when fi is less than zero, a HOLD action otherwise.

import { fiStrategy } from 'indicatorts';

const defaultConfig = { period: 13 };
const actions = fiStrategy(asset, defaultConfig);

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

Money Flow Index Strategy

The moneyFlowIndexStrategy uses the mfi values that are generated by the Money Flow Index (MFI) indicator function to provide a SELL action when mfi is greather than or equal to 80, and a BUY action when mfi is less than or equal to 20.

import { mfiStrategy } from 'indicatorts';

const defaultConfig = { period: 14 };
const actions = mfiStrategy(asset, defaultConfig);

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

Negative Volume Index Strategy

The negativeVolumeIndexStrategy uses the nvi values that are generated by the Negative Volume Index (NVI) indicator function to provide a BUY action when nvi is less than its 255-period EMA, and a SELL action when it is greather than its 255-period EMA, otherwise a HOLD action.

import { nviStrategy } from 'indicatorts';

const defaultConfig = { start: 1000, period: 255 };
const actions = nviStrategy(asset, defaultConfig);

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

Volume Weighted Average Price Strategy

The volumeWeightedAveragePriceStrategy uses the values that are generated by the Volume Weighted Average Price (VWAP) indicator function to provide a BUY action when the closing is below the VWAP, and a SELL action when the closing is below the VWAP, a HOLD action otherwise.

import { vwapStrategy } from 'indicatorts';

const defaultConfig = { period: 14 };
const actions = vwapStrategy(asset, defaultConfig);

// Alternatively:
// const actions = volumeWeightedAveragePriceStrategy(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.