Skip to content
API status
User guide

Custom indicators

Write, test, protect, import, and run Koneth Script indicators in the desktop terminal.

Custom indicators run only inside Koneth Terminal on web, macOS, and Windows. The terminal calculates them from local chart data and converts their output into controlled plots and drawing instructions.

  1. Open a chart.
  2. Select Indicators.
  3. Use Favourite, My scripts, Built in, or KS editor.

Favourite opens first. Select the star beside a custom indicator to include it there. Select Add to chart in My scripts or Favourite to calculate it against the current chart.

Open KS editor, select New script, and enter:

indicator("My Moving Average", {
overlay: true
});
const period = input.int("Period", 20);
const average = sma(close, period);
plot(average, {
title: "MA",
color: "#4e8ff3"
});

Select Check, then Save to My scripts. Return to My scripts and select Add to chart.

Set overlay: true to draw over candles. Set overlay: false to open a separate indicator subwindow with its own value scale.

Every script receives these read-only series:

Series Value
open Candle opening prices
high Candle high prices
low Candle low prices
close Candle closing prices
volume Candle volumes
time Candle times as Unix epoch milliseconds

Use these calculation functions:

Function Purpose
sma(series, period) Simple moving average
ema(series, period) Exponential moving average
rsi(series, period) Relative strength index
atr(period) Average true range
highest(series, period) Highest value in a rolling period
lowest(series, period) Lowest value in a rolling period
cross(a, b) Either-direction cross
crossover(a, b) Upward cross
crossunder(a, b) Downward cross
last(series) Latest finite value
at(series, barsAgo) Historical value by bars ago

Input declarations support input.int(), input.float(), and input.bool().

Scripts can emit these standard outputs:

  • plot(series, options)
  • plotShape(condition, options)
  • hline(value, options)
  • fill(firstSeries, secondSeries, options)
  • barColor(condition, options)

Common options include title, color, width, position, and text.

Drawing functions accept market-time and price pairs. They return declarative instructions to the terminal renderer and never receive the chart controller or drawing canvas.

indicator("Trend structure", { overlay: true });
const fromTime = at(time, 20);
const fromPrice = at(low, 20);
const toTime = last(time);
const toPrice = last(high);
line(fromTime, fromPrice, toTime, toPrice, {
color: "#4e8ff3",
width: 2
});
box(fromTime, fromPrice, toTime, toPrice, {
color: "#f59e0b"
});
label(toTime, toPrice, {
text: "Latest structure"
});
Function Points
line(), extendedLine(), ray(), infoLine() 2
verticalLine(), crossLine() 1
fibRetracement(), fibTimeZone(), fibSpeedFan() 2
fibExtension(), fibChannel(), fibTrendTime() 3
Function Points
abcd() 4
xabcd(), cypher(), headAndShoulders() 5
trianglePattern() 3
threeDrives() 6
longPosition(), shortPosition() 3
Function Points
box() 2
rotatedBox() 3
path() 2 or more
circle(), ellipse() 2
triangle() 3
arrow() 2
arrowMarker(), arrowUp(), arrowDown() 1
label(), note() 1

Each point is two arguments in time, price order. For example, a three-point function receives six numeric arguments before its options object.

Koneth supports two indicator formats:

  • .ks contains editable Koneth Script source.
  • .kic contains a protected, checksummed execution plan without editable source.

Use Import to stage either format in the editor. Koneth does not run an imported file immediately. Inspect an editable .ks file, select Save to My scripts, and then add it to a chart.

To move editable source between devices, select Export. To distribute a protected package, open an editable script and select Build protected .kic. Packaging happens locally in the terminal, including on the web.

An imported .kic file shows its package details without exposing source. Save it to My scripts, then select Add to chart.

  • On macOS and Windows, Koneth stores scripts and metadata under the application support data directory in Koneth/indicators/.
  • On the web, Koneth stores scripts and metadata in IndexedDB for the current browser profile.

Back up or export scripts before clearing application data or browser site storage.

Koneth Script does not expose:

  • Filesystem or application directories
  • Network, HTTP, or WebSocket access
  • Shell commands or process execution
  • Browser document or storage APIs
  • Trading passwords, account credentials, or terminal secrets
  • Flutter widgets, canvases, chart controllers, or chart repositories

The terminal enforces limits for script size, loaded history, execution time, plots, drawings, and drawing points. Native desktop calculations run outside the Flutter UI isolate. Current-candle and new-candle updates use a bounded runtime session so an indicator cannot block chart interaction.