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

Variables & Constants

Core variables, data types, and constants available in kScript for market data access and styling.

Core Data Variables

4 items
currentSymbolstring

The current trading symbol (e.g., 'BTCUSDT')

currentSymbol // Returns 'BTCUSDT'
currentExchangestring

The current exchange being used for trading (e.g., 'BINANCE', 'COINBASE')

currentExchange // Returns 'BINANCE'
colorcolor

The color to use for plotting (e.g., 'red', 'blue')

plotLine(ema20, ["blue"], 2);
color[]color[]

Storing an array of color

let colors = ["red", "green", "blue"];

Color Constants

17 items
yellowcolor

Yellow color (#FFFF00)

orangecolor

Orange color (#FFA500)

purplecolor

Purple color (#800080)

graycolor

Gray color (#808080)

blackcolor

Black color (#000000)

whitecolor

White color (#FFFFFF)

Data Types

2 items
timeseriesTimeSeries

This represents time-aligned numerical data. Only timeseries data can be passed into plot().

ShapeTypeShapeType

Defines the type of shape to render when using plotShape function. Currently supports 'circle' with more shapes potentially available.

plotShape(signals, "circle", ["red"], 2, true);

Data Sources

6 items
buy_sell_volumeDataSource

Buy/sell volume from trade data

timeseries buySellData = source("buy_sell_volume", currentSymbol, currentExchange); timeseries buyVolume = buySellData.buy; timeseries sellVolume = buySellData.sell;
funding_rateDataSource

Funding rate aggregation data from derivatives markets

timeseries fundingData = source("funding_rate", currentSymbol, currentExchange); // Single value data source
liquidationsDataSource

Liquidation aggregation data from derivatives markets

timeseries liquidationData = source("liquidations", currentSymbol, currentExchange); timeseries buyLiquidations = liquidationData.buy; timeseries sellLiquidations = liquidationData.sell;
ohlcvDataSource

Open, High, Low, Close, Volume data from trade aggregations

timeseries ohlcv = source("ohlcv", currentSymbol, currentExchange); timeseries close = ohlcv.close; timeseries volume = ohlcv.volume; timeseries high = ohlcv.high;
open_interestDataSource

Open interest aggregation data from derivatives markets

timeseries openInterestData = source("open_interest", currentSymbol, currentExchange); timeseries oiClose = openInterestData.close; timeseries oiHigh = openInterestData.high;
orderbookDataSource

Orderbook heatmap snapshot aggregation data

timeseries orderbookData = source("orderbook", currentSymbol, currentExchange); // Use with orderbook functions like sumBids(), sumAsks()

Function Categories

Explore technical indicators, mathematical functions, and utilities organized by category.

📖
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