Notice!
This is documentation for kScript v1.0, which may not include the latest features. For up-to-date documentation, see the latest version.

Overview

Money Flow Index (MFI)

Volume-weighted RSI that measures buying and selling pressure using both price and volume data to identify overbought/oversold conditions.

• Volume-weighted momentum • Overbought: > 80 • Oversold: < 20

On-Balance Volume (OBV)

Cumulative volume indicator that adds volume on up days and subtracts volume on down days to show the flow of volume in relation to price.

• Cumulative volume flow • Trend confirmation • Divergence analysis

Functions Reference

_mfi - Money Flow Index measures volume-weighted momentum

_mfi(barIndex: number, series: TimeSeries, period?: number = 14): number

Parameters:

  • barIndex (number) - Current bar index
  • series (TimeSeries) - Source data series with volume
  • period (number) - Number of periods (default: 14)

Returns:

number (MFI value 0-100)

Code Example:

_obv - On-Balance Volume shows cumulative volume flow

_obv(barIndex: number, series: TimeSeries): number

Parameters:

  • barIndex (number) - Current bar index
  • series (TimeSeries) - Source data series with volume

Returns:

number (OBV value)

Code Example:

Common Usage Patterns

Volume-Price Confirmation

Use volume indicators to confirm price movements and identify divergences

Best Practices

💰

Volume Quality

High volume during breakouts confirms the move. Low volume breakouts are often false signals that reverse quickly.

📈

Divergence Analysis

Watch for divergences between price and volume indicators. When price makes new highs but volume indicators don't, be cautious.

📖
Introduction
Overview of kScript language
🚀
Quick Start
Get started with kScript basics
📋
Function Reference
Complete API reference guide
🔧
Core Concepts
Variables, data types & data sources
🔗
Script Definition
Defining inputs and metadata
TimeSeries Management
Working with time-aligned data
🎯
Utility Functions
Helper functions and calculations
📈
Moving Averages
SMA, EMA and trend-following indicators
📊
Oscillators
RSI, Stochastic and momentum indicators
📈
Trend Indicators
Trend direction and strength analysis
📉
Volume Indicators
Volume-based analysis tools
📦
Orderbook Functions
Market depth analysis tools
🎨
Plotting & Visualization
Chart rendering and styling
🌈
Color Functions
Color manipulation and styling
🏠
Go Home
Return to main landing page