Agent skill

Openscript

by marketcalls in marketcalls/openalgo

Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles.

AGPL-3.0Auto-check: notesBusiness, Finance & HR

Install Openscript

skills CLI
$ npx skills add marketcalls/openalgo --skill openscript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install marketcalls/openalgo openscript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/marketcalls/openalgo.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/openscript .claude/skills/openscript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openscript
GitHub stars
2.8k
Token cost
~2.3k tokens
SKILL.md length
1,197 words
Files
16
Skills in repo
8
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles.

  • Asked to create
  • SKILL.md covers The one rule, What a pass means, Read these before writing and Porting from another chart…, plus 2 more sections
  • Runs JavaScript scripts from its folder; calls node
  • Debug an OpenScript indicator

What it does

Openscript is an agent skill from marketcalls/openalgo. Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles. Use when asked to create, port or debug an OpenScript indicator, study, strategy, backtest script or .oscript file, including porting a study or strategy written for another charting platform, or a JavaScript chart indicator (an openalgo-charts descriptor) into a study that computes the same values. This is the OpenScript path, not the JavaScript chart-indicator path and not the Python…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files (for example `reference/library.md`, `reference/pitfalls.md` and `reference/porting-from-javascript.md`).

It sits in Business, Finance & HR, covering Trading and backtesting. It works with Python and JavaScript. The repository describes itself as: Open Source Algo Trading Platform for Everyone. The licence is AGPL-3.0.

When your agent uses it

  • Asked to create
  • Debug an OpenScript indicator
  • Backtest script
  • Including porting a study

Example prompts

  • “/openscript”

Requirements

  • Python 3
  • Node.js
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep

What it can do on your machine

Read from SKILL.md and the folder at commit 6a6f201. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Openscript loads about 2.3k tokens when it runs. Until then it costs about 134 tokens; SKILL.md has 1,197 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~134
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from marketcalls/openalgo at commit 6a6f201, republished under its AGPL-3.0 licence (© marketcalls). 1,197 words, ~2,311 tokens.

Download SKILL.mdSave it as .claude/skills/openscript/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
name
openscript
description
Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles. Use when asked to create, port or debug an OpenScript indicator, study, strategy, backtest script or .oscript file, including porting a study or strategy written for another charting platform, or a JavaScript chart indicator (an openalgo-charts descriptor) into a study that computes the same values. This is the OpenScript path, not the JavaScript chart-indicator path and not the Python openalgo.ta path.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep
argument-hint
[what the study or strategy should do]

OpenScript studies and strategies

Write a .oscript file and install it into strategies/openscript/, where it becomes a study or a strategy a trader can open in the editor, backtest on /trading, and deploy on an instrument.

Which path is this. Three unrelated things in this repository are called indicators, and they share nothing but the word:

  • OpenScript (this skill) is a language, compiled to a program. Files are .oscript, and they can both draw and place orders.
  • chart-indicator is a plain JavaScript descriptor on openalgo-charts, drawing only, loaded by the browser at runtime.
  • openalgo.ta is a Python library used from the Python strategy host, scanners and backtests.

If the request names a .oscript file, the OpenScript editor, or a strategy to deploy on /trading, it is this one. If it is "add an indicator to my chart" with no more said, it is probably chart-indicator.

The one rule

Never write into strategies/openscript/ by hand. That folder holds two files per script, <name>.oscript and <name>.oscript.program.json, and the runner reads only the program. It never opens the source.

That makes two silent failures possible, and both matter more than a compile error:

  • A source with no program is a strategy that cannot run. It saves, it opens in the editor, it appears in the list, and starting it is refused a minute later in a log nobody is reading.
  • A program built from different text is worse. A run executes one script while a trader reads another.

So the two files are written together, from one compile, or neither is:

bash
# 1. draft to a scratch file (never the openscript folder)
#    e.g. <scratchpad>/my_strategy.oscript

# 2. compile it the way the browser will
node .claude/skills/openscript/validate.mjs <scratch>/my_strategy.oscript

# 3. only on PASSED, install both files
node .claude/skills/openscript/validate.mjs <scratch>/my_strategy.oscript --install

#    with a different installed name:
node .claude/skills/openscript/validate.mjs <scratch>/draft.oscript --install --as mean-reversion.oscript

--install writes both files only when there are zero errors, and exits 1 otherwise. Before writing either, it checks that the hash the compiled program records matches the source it is about to write beside it, which is the same check the platform's own save route makes. A mismatched pair is refused and nothing is written, so the failure cannot be half-applied.

What a pass means

The compiler accepted the text: the names resolve, the types agree, the calls exist, the limits hold. Nothing here runs a single bar. It does not mean the strategy is any good, that its numbers are right, or that it will make money.

Some refusals wait for a bar, and a pass rules out none of them: a cell written outside its grid is OS4008 on the bar that writes it. OS6025, a bar handed over with no time, is the platform's data and not the script: report the instrument and timeframe rather than changing the script.

reference/strategies.md ends with the four steps between a compile and money, and they are not optional.

Read these before writing

PageWhat it is for
reference/library.mdevery one of the 350 names, with what it answers and its warmup. Generated from the installed compiler.
reference/pitfalls.mdwhat goes wrong, with the diagnostic code you will actually see. Every code on it is proved against the compiler.
reference/strategies.mdthe shapes a strategy takes, and which example answers which ask.
reference/porting-from-javascript.mdporting a JavaScript chart indicator into a study that computes the same values: the chart helpers whose OpenScript twin differs, absent values, fn scope, markers, tables, inputs, and how to check parity.
examples/*.oscriptsix worked files, all of which compile. The reasoning is in the comments.

Look a name up rather than recalling it. 350 names is more than anyone holds, and the dangerous failure is not reaching for a name that does not exist: it is reaching for a neighbour that computes something else, which compiles and reports a different strategy than the one that was meant.

Porting from another chart language

The installed compiler carries an importer for the widely used chart language whose scripts open with //@version=5 or //@version=6. Each statement comes across with its original meaning, or with a warning stating the difference, or as a comment with an error, all in the range OS9001 to OS9012, and what it hands back has been compiled. Save the original as <scratch>/original.txt, then from the repository root (the file is an argument, not standard input):

bash
node --input-type=module -e "import { importScript } from './frontend/node_modules/openalgo-script/dist/core/index.js'; import { readFileSync } from 'node:fs'; const r = importScript(readFileSync(process.argv[1], 'utf8')); process.stdout.write(r.source); for (const f of r.findings) console.error(f.code, f.message)" <scratch>/original.txt > <scratch>/ported.oscript

The output is a draft, not a port. Read every finding: a warning marks a place where the numbers can differ from the original, and a line kept as a comment is behaviour that did not come across. Then take it through validate.mjs like any other draft.

To port a JavaScript chart indicator (an openalgo-charts descriptor handed to registerIndicator, with calc(bars, settings)) into a study, read reference/porting-from-javascript.md first: there is no importer for that direction, and several chart helpers share a name with a built-in that computes something else.

Show full SKILL.md (432 more words)Show less

Three things that cost the most time

Ninety five of the 350 names are planned and not implemented in this version. The library describes a name whether or not a version implements it, so a name resolving is not a promise that it compiles. Reaching for one is OS2020. They are marked in reference/library.md. order.qtyForRisk is the one most likely to be reached for by accident, because it reads exactly like the call you want; whole families are planned, including all of leg.* and all of book.*.

buy and sell move a position by an amount; they do not set it to a side. sell(qty = lots) while long one lot leaves the position flat, not short. Nothing refuses it. It is the first entry in reference/pitfalls.md and the reason examples/stop-and-reverse.oscript exists.

A value that is absent is not zero. Every stateful call has a warmup, and arithmetic on an absent value is absent rather than zero, which is what keeps a signal from firing before its average exists. A script that substitutes a number during warmup, with orElse or otherwise, is quietly wrong for its first stretch of bars and looks like it works.

Keeping the skill honest

The generator and two checks, all three of which the CI job runs:

bash
node .claude/skills/openscript/generate-reference.mjs   # rewrites reference/library.md
node .claude/skills/openscript/coverage.mjs             # must print COVERAGE COMPLETE
node .claude/skills/openscript/check-pitfalls.mjs       # must print PITFALLS VERIFIED

coverage.mjs holds the reference to the compiler in both directions (a name the compiler has and the page lacks fails, and so does a name the page teaches that the compiler does not have), checks that every planned name is marked, and checks that each shape an author asks for is demonstrated in an example that compiles, with the kind read from the compiled program rather than from the text.

check-pitfalls.mjs compiles both halves of every entry in reference/pitfalls.md: the wrong spelling must still produce the code named, and the fix offered must still come out clean. It also checks that the page and the script name the same set of codes, so neither can drift alone. Two claims on the first draft of that page were wrong, and this is what found them.

This skill describes openalgo-script 0.8.1, the compiler /trading pins, with the server engine openscript at the same version. OpenScript 0.9.0, with fixes to the backtest engine, is coming; when the pin moves to it, read its changelog for anything a backtest now reports differently and say so here.

Bumping openalgo-script means updating this skill in the same change, the way a chart bump does. Run the generator, run both checks, then update the prose by hand: the generator owns the name table and nothing generates the teaching.

© marketcalls, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 15 other files in .claude/skills/openscript of marketcalls/openalgo.

  • SKILL.md
  • .gitignore
  • check-pitfalls.mjs
  • coverage.mjs
  • examples/intraday-session.oscript
  • examples/long-only.oscript
  • examples/short-only.oscript
  • examples/stop-and-reverse.oscript
  • examples/stop-and-target.oscript
  • examples/study-bands.oscript
  • generate-reference.mjs
  • reference/library.md
  • reference/pitfalls.md
  • reference/porting-from-javascript.md
  • reference/strategies.md
  • validate.mjs

Open the folder on GitHubat commit 6a6f201

Compare with similar skills

Openscript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openscript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openscript this skillmarketcalls/openalgo2.8k—~2.3kAutomated safety check: NotesAGPL-3.0
CCXT Crypto Exchange Library2025Emma/vibe-coding-cn23k2 repos~4.4kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3192 repos~2.3kAutomated safety check: PassNone
Kalshi Traderyanfrigo/kalshi-ai-trading-bot612—~3.4kAutomated safety check: PassMIT
Polymarket Tennislivetennisapi/livetennisapi-mcp152—~3kAutomated safety check: PassMIT
Quant Backtestjoemccann/market-data-warehouse183—~2.1kAutomated safety check: PassNone

Similar skills

  • CCXT Crypto Exchange Library

    2025Emma/vibe-coding-cn

    Reference help for the CCXT library covering crypto exchange APIs, market data, trading and order management across 150+ exchanges in JavaScript, Python and PHP.

    23k GitHub starsUsed in 2 repos~4.4k tokens
    Business, Finance & HRAuto-check passed
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    319 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Kalshi Trade

    ryanfrigo/kalshi-ai-trading-bot

    The disciplined process for autonomously and profitably trading the live Kalshi account on each /loop tick, with Claude as the decision-maker.

    612 GitHub stars~3.4k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Polymarket Tennis

    livetennisapi/livetennisapi-mcp

    Build observe-only Polymarket and Kalshi tennis market tooling on the polymarket-tennis Python package (MIT) plus the Live Tennis API free tier.

    152 GitHub stars~3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Quant Backtest

    joemccann/market-data-warehouse

    Institutional-grade Python backtesting framework builder for Codex.

    183 GitHub stars~2.1k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • Qmt Inner Backtest

    dfkai/xtquantai

    根据策略描述、研报 PDF 或截图,解读因子/选股逻辑,基于 scripts/daily-factors-backtest.py 框架生成 QMT 内置日频因子回测脚本。用户提到 QMT 内置回测、因子选股回测、截面因子、 研报复现、handlebar 回测、afterinit 预计算信号时使用。

    164 GitHub stars~1.8k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed

More from marketcalls/openalgo

All 8 skills in this repo
  • Broker Integration

    marketcalls/openalgo

    Integrate a new Indian broker into OpenAlgo, or modify an existing broker plugin.

    2.8k GitHub stars~4.7k tokensUpdated today
    Auto-check: notes
  • Fd Audit

    marketcalls/openalgo

    Audit a change for resource leaks in OpenAlgo — file descriptors AND unbounded memory growth.

    2.8k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Flow Builder

    marketcalls/openalgo

    Build, edit or debug an OpenAlgo Flow workflow - the no-code node graph at /flow.

    2.8k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Security Audit

    marketcalls/openalgo

    Run OpenAlgo's periodic security audit across backend, frontend, database, cache, routes and dependencies, producing a dated xlsx report.

    2.8k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Verify

    marketcalls/openalgo

    Verify a claim before stating it, and verify a test before trusting it.

    2.8k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Version Bump

    marketcalls/openalgo

    Bump a version in the OpenAlgo repo. An agent skill from marketcalls/openalgo.

    2.8k GitHub stars~1.8k tokensUpdated today
    Auto-check passed

Questions about Openscript

What does Openscript do?

Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles. Openscript is an agent skill from marketcalls/openalgo. Write an OpenScript study or strategy for OpenAlgo, and install it into strategies/openscript/ only after it compiles.

When should I use Openscript?

Openscript fits situations like: asked to create; debug an OpenScript indicator; backtest script; including porting a study.

How do I install Openscript in Claude Code?

Run `npx skills add marketcalls/openalgo --skill openscript -a claude-code`. Or copy the skill folder (.claude/skills/openscript in marketcalls/openalgo) into .claude/skills/openscript in your project. Claude Code loads it when a task matches its description.

How do I install Openscript in Codex?

Run `npx skills add marketcalls/openalgo --skill openscript -a codex`. Or copy the skill folder (.claude/skills/openscript in marketcalls/openalgo) into .agents/skills/openscript in your project. Codex loads it when a task matches its description.

Can I use Openscript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add marketcalls/openalgo --skill openscript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openscript, .gemini/skills/openscript, .github/skills/openscript and .opencode/skills/openscript in your project.

What does Openscript need to run?

Going by SKILL.md and its folder, Openscript needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep.

Does Openscript access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Openscript safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Openscript use?

Openscript is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openscript use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Openscript?

Skills that share tags, products or a category with Openscript: CCXT Crypto Exchange Library (2025Emma/vibe-coding-cn, 23k stars), Tushare Data (zillionare/zillionare, 319 stars), Kalshi Trade (ryanfrigo/kalshi-ai-trading-bot, 612 stars) and Polymarket Tennis (livetennisapi/livetennisapi-mcp, 152 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openscript?

marketcalls (a GitHub user) maintains it in marketcalls/openalgo, which has 2,797 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 8, 2026.

Source: marketcalls/openalgo on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.