Cookbook

Cookbook

Complete, working kScript v3 recipes you can copy, run, and adapt. From a volume-spike detector to a four-venue aggregated CVD.

Recipes Copy & run

Copy a recipe, run it, make it yours.

Every page here is a full indicator, not a snippet. Paste one into the editor, hit run, and it works. Then read the "How it works" section to understand the moving parts, and the "Customize it" section to change the inputs, thresholds, venues, and colors to fit what you trade.

The recipes are ordered easy to advanced. The first one is a clean introduction to the loop: load a series, compute a number, draw it. By the last one you're holding state in typed structs and managing chart drawings that clean up after themselves. Each recipe links to the concept pages behind it, so you can go deeper wherever something catches your eye.

Recipes

RecipeWhat it doesConcepts it uses
Volume spike detectorFlags bars whose volume blows past its trailing average, scored as a z-score.Series functions, Typed inputs, Plotting
Anchored VWAPWeekly and daily VWAP that reset on real UTC session boundaries, with bands and a stretch readout.Special indicators, Plotting
Regime filterA no-repaint 4h trend gate that tints candles and only marks entries when the higher timeframe agrees.Multi-timeframe, Plotting
Aggregated CVDOne cumulative volume-delta line summed across four exchanges, with volatility bands and a live venue count.Multi-source, Data sources
Zone trackerSupply and demand zones as typed structs, drawn as boxes that delete themselves when price mitigates them.User-defined types, Collections, Drawing objects

How to use a recipe

  1. Open the editor and paste the whole script. Every recipe is self-contained.
  2. Run it on a liquid symbol. The multi-venue and order-flow recipes want a major pair (BTC, ETH) where every exchange has data.
  3. Open the settings panel. Every tunable value is an input(), so you can change lookbacks, thresholds, and colors without touching code.
  4. Read "How it works" to understand why the script is shaped the way it is, then "Customize it" for the variations worth trying.

A few recipes lean on render channels that your chart needs to support to show everything: Regime filter tints candles with barcolor, and Zone tracker paints box drawings. The notes on those pages call out exactly what shows up where.