Skip to main content

Strategy Arena › ArenaScript

ArenaScript: describe a trading rule in a few lines, search it on CPU or GPU, take it back to Pine

ArenaScript is a short declarative language for trading rules. The Strategy Arena engine (Rust, on your CPU or an NVIDIA GPU with CUDA) sweeps its parameter ranges, counts every attempt and gives one verdict on a period kept sealed during the search. When you are done, it exports Pine v5 for TradingView, marked EXACT or PARTIAL.

strategy "EMA cross with ATR stop" version 1.2
asset: BTC
timeframe: 4h
capital: 10000
entry:
  condition: EMA(12) crosses above EMA(26)
  size: 50%
exit:
  condition: EMA(12) crosses below EMA(26)
  stop_loss: 2 x ATR(14)
params:
  fast: min=5 max=20 type=int default=12
  slow: min=21 max=60 type=int default=26

Buy when the 12 EMA crosses above the 26 EMA, sell on the opposite cross or at a stop two ATRs below the entry. The params: lines ask the Lab to search fast periods between 5 and 20 and slow periods between 21 and 60. This script passes validate_arenascript on the public MCP server (checked 23 November 2026).

Already write Pine? Keep it.

Keep Pine Script and TradingView for charts, drawings and alerts. To test a strategy on data it has not seen, paste your Pine in the free online judge: no account, the end of the history stays sealed. ArenaScript is the next step, for when you want to declare parameter ranges, run large sweeps, or let an AI write and repair the rule.

What ArenaScript does well for research

What ArenaScript does not do

How it fits with TradingView

1. The idea and the chart: in TradingView, as usual.
2. The test: your Pine in the judge, or the rule in ArenaScript in the Lab, with ranges and a sealed period.
3. The export: Pine v5 back to TradingView, status EXACT or PARTIAL stated.
4. With an AI: the same steps over MCP, the engine checking each line.
Get the free Lab (Windows, Linux)Pine Script vs ArenaScript, side by side

Questions

Is ArenaScript a replacement for Pine Script?

No. Pine Script runs inside TradingView with charts, drawings, alerts and a large community. ArenaScript v1.2 has a fixed set of indicators and no chart. It is a research language: you describe a rule, the Strategy Arena engine searches its parameter ranges and judges it on a sealed period, then you can export Pine v5 back to TradingView.

I already have a Pine strategy. Do I need to rewrite it?

No. The free online judge and the Lab read supported Pine v5 directly, with the same engine that runs ArenaScript. Rewrite a rule in ArenaScript only when you want to declare parameter ranges, let an AI edit it over MCP, or keep a short readable version of it.

Do I need a graphics card?

No. The Lab sweeps parameter ranges on the CPU. With an NVIDIA card, it can also use CUDA for large sweeps. The verdict is the same kind either way: one judgement on a sealed period, with every attempt counted.

Is this investment advice?

No. ArenaScript and the Lab are for research on past data. No order is sent to any broker, and no result is a promise of gain.

See also: ArenaScript v1.2 grammar and execution rules · Pine Script alternatives compared · MCP server for AI assistants. Research on past data, never advice.