Overview

Keyword arguments (kwargs) allow you to pass parameters to functions by name rather than position. This makes function calls more readable, reduces errors, and allows for flexible parameter ordering.

All
Function Support
Any
Parameter Order
Self
Documenting

Basic Syntax

Keyword Argument Format

Use the parameterName=value syntax to pass arguments by name. You can mix positional and keyword arguments, but positional arguments must come first.

Keyword Arguments Syntax
📖

Self-Documenting

Parameter names make function calls self-explanatory.

🔀

Flexible Order

Parameters can be specified in any order.

🎯

Selective Parameters

Easily specify only the parameters you need.

Practical Examples

Technical Indicators

Using kwargs makes indicator parameters crystal clear:

Technical Indicator Examples

Data Sources

Specify exactly which data you need:

Data Source Examples

Plotting & Visualization

Create clear, customized charts:

Plotting Examples
📖
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