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(source: TimeSeries, period?: number = 14): number

Parameters:

  • source (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(source: TimeSeries): number

Parameters:

  • source (TimeSeries) - Source data series with volume

Returns:

number (OBV value)

Code Example:

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
🔍
Overview
Complete technical documentation
🚀
Quick Start
Get started with kScript basics
📋
Function Reference
Complete API reference guide
📚
Type System
Understanding kScript data types
General FAQ
Frequently asked questions about kScript
Best Practices
Guidelines for writing efficient kScript code
⚠️
Limitations
Known constraints and workarounds
🆕
Updates
v1 vs v2 differences and improvements
🔧
Core Concepts
Variables, data types & data sources
⚙️
Execution Model
Per-bar execution lifecycle and phases
🏷️
Keyword Arguments
Named parameters for clear function calls
🔗
Field Accessors
Dot notation for timeseries field access
🛠️
User-Defined Functions
Create custom reusable functions
🔗
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
📊
Data Subscriptions
Subscribe to OHLCV, trades, and orderbook data
🔄
Loops
For loops and while loops for iteration
🧮
Math Functions
Mathematical functions and constants
🏠
Go Home
Return to main landing page