Exciting Update: Version 1.0.1 is now available, introducing the high-performance BacktestX Custom Script Editor. Read more
Live Interactive Script Simulator

Create Trading Indicators with JavaScript

Write raw JavaScript indicator algorithms that execute directly on the chart canvas. Utilize real-time price bars and full coordinate translations in our instant simulator environment below.

Open Documentation Explore API Reference
BacktestX Script Editor Preview

Features Designed for Algorithmic Success

Take complete control over your technical charting analysis using BacktestX script editor tools.

Zero Compile Latency

Your scripts run directly in the Canvas rendering loop. Experience instant updates as price data moves or when zoom level changes.

Full HTML5 Canvas Context

Gain direct access to the canvas drawing API. Write custom fill regions, polygons, custom alerts, or specialized patterns with ease.

Pine Script Converter

Directly convert legacy Pinescript indicators to lightweight Javascript scripts compatible with BacktestX custom chart interfaces.

Canvas API Reference Guide

Integrate your indicator algorithms using the core data structure exposed to Javascript execution hooks.

Context Data API
ctx.bars Array<Bar>
Contains historical bars. Each bar exposes close, open, high, low, volume, and time properties.
ctx.bounds Object
Exposes active viewport metrics: startIndex, endIndex, numVisible, and candleSlot width.
More Data APIs →
Pixel Translation API
ctx.priceToY(price) Number
Translates double-precision price values to pixel Y coordinates corresponding to the active chart window.
ctx.barToX(index) Number
Translates individual bar indices (from 0 to bars.length - 1) to direct pixel X coordinates.
More Coordinate APIs →
Plotting & Rendering API
ctx.plot(dataArray, options) Method
Renders a continuous line series of values dynamically. Options: color, width, style.
ctx.plotchar(dataArray, options) Method
Plots marker shapes or unicode characters above or below price bars dynamically.
More Plotting APIs →
Drawing & Color API
color.new(colorStr, transparency) Function
Generates a transparent color with alpha scaling from 0 (opaque) to 100 (transparent).
box.new(left, top, right, bottom, bgcolor, border_c, border_w) Constructor
Declares a floating viewport zone rectangle spanning specific bar indices and price boundaries.
More Drawing APIs →

Take Your Backtesting to the Next Level

Save custom JavaScript indicators inside the premium platform and validate strategies against decades of ticks.

Get Started Free