Skip to content

Latest commit

 

History

History
208 lines (141 loc) · 6.19 KB

README.md

File metadata and controls

208 lines (141 loc) · 6.19 KB

Volume Indicators

Volumne indicators measure the strength of a trend based the volume.

NOTE: All configuration objects for all indicators 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.

Accumulation/Distribution (A/D)

The accumulationDistribution is a cumulative indicator that uses volume and price to assess whether a stock is being accumulated or distributed.

The Accumulation/Distribution seeks to identify divergences between the stock price and the volume flow.

MFM = ((Closing - Low) - (High - Closing)) / (High - Low)
MFV = MFM * Period Volume
AD = Previous AD + CMFV
import { ad } from 'indicatorts';

const result = ad(highs, lows, closings, volumes);

// Alternatively:
// const result = accumulationDistribution(highs, lows, closings, volumes);

Based on Accumulation/Distribution Indicator (A/D).

Chaikin Money Flow (CMF)

The chaikinMoneyFlow measures the amount of money flow volume over a given period.

Money Flow Multiplier = ((Closing - Low) - (High - Closing)) / (High - Low)
Money Flow Volume = Money Flow Multiplier * Volume
Chaikin Money Flow = Sum(20, Money Flow Volume) / Sum(20, Volume)
import { cmf } from 'indicatorts';

const defaultConfig = { period: 20 };
const result = cmf(highs, lows, closings, volumes, defaultConfig);

// Alternatively:
// const result = chaikinMoneyFlow(highs, lows, closings, volumes, defaultConfig);

Ease of Movement (EMV)

The easeOfMovement is a volume based oscillator measuring the ease of price movement.

Distance Moved = ((High + Low) / 2) - ((Priod High + Prior Low) /2)
Box Ratio = ((Volume / 100000000) / (High - Low))
EMV(1) = Distance Moved / Box Ratio
EMV(14) = SMA(14, EMV(1))
import { emv } from 'indicatorts';

const defaultConfig = { period: 14 };
const result = emv(highs, lows, volumes, defaultConfig);

// Alternatively:
// const result = easeOfMovement(highs, lows, volumes, defaultConfig);

Force Index (FI)

The forceIndex uses the closing price and the volume to assess the power behind a move and identify turning points.

Force Index = EMA(period, (Current - Previous) * Volume)
import { fi } from 'indicatorts';

const defaultConfig = { period: 13 };
const result = fi(closings, volumes, defaultConfig);

// Alternatively:
// const result = forceIndex(closings, volumes, defaultConfig);

Money Flow Index (MFI)

The moneyFlowIndex function analyzes both the closing price and the volume to measure to identify overbought and oversold states. It is similar to the Relative Strength Index (RSI), but it also uses the volume.

Raw Money Flow = Typical Price * Volume
Money Ratio = Positive Money Flow / Negative Money Flow
Money Flow Index = 100 - (100 / (1 + Money Ratio))
import { mfi } from 'indicatorts';

const defaultConfig = { period: 14 };
const result = mfi(highs, lows, closings, volumes, defaultConfig);

// Alternatively:
// const result = moneyFlowIndex(highs, lows, closings, volumes, defaultConfig);

Negative Volume Index (NVI)

The negativeVolumeIndex function calculates a cumulative indicator using the change in volume to decide when the smart money is active.

If Volume is greather than Previous Volume:

    NVI = Previous NVI

Otherwise:

    NVI = Previous NVI + (((Closing - Previous Closing) / Previous Closing) * Previous NVI)
import { nvi } from 'indicatorts';

const defaultConfig = { start: 1000, period: 255 };
const result = nvi(closings, volumes, defaultConfig);

// Alternatively:
// const result = negativeVolumeIndex(closings, volumes, defaultConfig);

On-Balance Volume (OBV)

The onBalanceVolume function calculates a technical trading momentum indicator that uses volume flow to predict changes in stock price.

                  volume, if Closing > Closing-Prev
OBV = OBV-Prev +       0, if Closing = Closing-Prev
                 -volume, if Closing < Closing-Prev
import {obv} from 'indicatorts';

const result = obv(closings, volumes);

// Alternatively:
// const result = onBalanceVolume(closings, volumes);

Volume Price Trend (VPT)

The volumePriceTrend provides a correlation between the volume and the price.

VPT = Previous VPT + (Volume * (Current Closing - Previous Closing) / Previous Closing)
import { vpt } from 'indicatorts';

const result = vpt(closings, volumes);

// Alternatively:
// const result = volumePriceTrend(closings, volumes);

Volume Weighted Average Price (VWAP)

The volumeWeightedAveragePrice provides the average price the asset has traded.

VWAP = Sum(Closing * Volume) / Sum(Volume)
import { vwap } from 'indicatorts';

const defaultConfig = { period: 14 };
const result = vwap(closings, volumes, defaultConfig);

// Alternatively:
// const result = volumeWeightedAveragePrice(closings, volumes, 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.