Live in MillionChart

A language for market logic.

Cuprel is a programming language for your own indicators on market data. Cuprel is live in MillionChart for every signed-in member. Visitors who are not signed in do not have the editor.

  • EditorScripts are written in the chart under Indicators, On chart, My scripts: New script opens the editor, Save keeps the script with your account, and Add to chart runs it on the chart.
  • PrivateScripts are private to your account and, in this release, run in your browser only. Sharing is not available.
  • OffScript alerts on your own scripts are not switched on for members in this release.
  • TradingNo live trading and no broker connection.

Where the work stands

64 items are tracked in the internal capability register.

VERIFIED
21 items. Built, and covered by passing internal tests and checks.
IMPLEMENTED
16 items. Built in the engine. The full set of checks is not complete yet.
PLANNED
18 items. Designed or intended, not built. Never shown as available.
OUTSIDE
9 items. Not part of the first edition. Listed so that nobody mistakes a non-goal for a plan.
Counts from the register as last scored on , before the release to members. They describe internal checks of design items, not what members can use: see the status page.

Learn Cuprel

Your first script in a few minutes

  1. Open the editor and write your first script: Indicators, On chart, My scripts, New script.
  2. Paste a sample program, press Save and then Add to chart.
  3. Follow the course in the MillionChart wiki, lesson by lesson, in English or Persian.

All the documentation: Documentation.

What it is for

Indicators, alerts and simulated strategy tests

Indicators

Plots, marks, drawings and tables computed bar by bar from market data. This is what members write in the chart today.

Alerts

Conditions that raise a message when they become true on a closed bar. Not switched on for members yet.

Simulated strategy tests

Orders are simulated against stored history with stated costs and assumptions. Nothing is sent to a broker. Members run them in the chart's Strategy Lab.

Edition 1 provides indicators, alerts, deterministic replay and simulated strategy testing only. It has no broker connectivity and cannot place real-money orders. Live execution is a separate future product capability requiring its own broker state machine, permissions, risk controls, secrets handling, audit model and operational safety review. Script alerts on your own scripts are not switched on for members in this release.

How it is built

A small pipeline with a bounded end

A script is read, checked, reduced to a small core form, compiled to closures and run bar by bar inside limits on steps, memory and time.

The pipeline of a Cuprel scriptSource, lex and parse, check, lower, compile, run in a bounded sandbox, and output. The run stage is drawn inside a dashed frame that stands for the limits on steps, memory and time. bounded sandboxSourceA script is textLex and parseText becomes atreeCheckNames, types,effectsLowerOne small coreformCompileClosures, nogenerated codeRunBar by bar,boundedOutputMarks, alerts,simulated tradesThe pipeline of a Cuprel scriptSource, lex and parse, check, lower, compile, run in a bounded sandbox, and output, from top to bottom. The run stage is drawn inside a dashed frame that stands for the limits on steps, memory and time. SourceA script is textLex and parseText becomes a treeCheckNames, types, effectsLowerOne small core formCompileClosures, no generated codeRunBar by bar, boundedOutputMarks, alerts, simulated trades
The pipeline of the engine. Read how each stage works.

Bounded runs

Every run is held to budgets and stops with a named error when one is spent. The limits are listed on Resources.

Replay by design

Cuprel is designed for deterministic replay: the same data and the same settings are meant to give the same results when a run is repeated. What that means.

Stable error codes

The engine defines 273 diagnostics. Each has a permanent code and a page in the index.

Published and not published

What this site covers

Published now

Elsewhere and not yet

  • The scripting guide of the MillionChart wiki: tutorials, the language, sample programs and limits
  • A playground: not published
  • Community code and shared libraries: not open

Ecosystem

Part of Million Global

Cuprel stands on its own as a language and belongs to the Million Global family of financial-markets technology, alongside MillionChart and MillionAlgo.

Progress is announced on the Telegram channel.