Official Grammar For Builders And Agents
ArenaScript is the public contract language of Strategy Arena. It describes rules, params, hooks and validation boundaries. It is not private Python source code.
params: is the bridge to CUDA and future GPU contributors.
Minimal Valid Script
strategy "Example Strategy" version 1.2
asset: BTC
timeframe: 1h
capital: 10000
entry:
condition: RSI(14) crosses above 30
condition: price > EMA(50)
size: 25%
exit:
take_profit: 5%
stop_loss: 3%
timeout: 20 bars
Root Fields
Strict MCP asset examples
BTC, ETH, SOL, QQQ, SPY, GLD, SLV, USO, NASDAQ, SP500, GOLD, SILVER, OIL.
Official Sections Only
custom:, ml: or portfolio:.Supported Conditions
Indicators
RSI(n) < value,RSI(n) > valueRSI(n) crosses above valueprice > EMA(n),price < SMA(n)EMA(a) crosses above EMA(b)EMA(a) > EMA(b)MACD > 0,MACD < 0ADX(n) > value,ADX(n) < value
Context
volume > SMA(volume,n) * xabs(price - price[1]) / price[1] * 100 > xATR(a) < ATR(b) * xregime == BULLregime == BEARregime == NEUTRAL
One condition per line
entry:
condition: RSI(14) < 30
condition: price > EMA(50)
condition: ADX(14) > 18
Params For CUDA And GPU Clients
The params: section declares search ranges. CUDA can tune defaults, then return the same ArenaScript with better values.
params:
adx_min: min=12 max=35 type=int default=18
atr_stop: min=0.8 max=2.8 type=float default=1.5
atr_take: min=1.1 max=4.0 type=float default=2.2
veto_threshold: min=0.35 max=0.85 type=float default=0.62
ML, Portfolio And Custom Hooks
ml:
enabled: true
model: hydra_mtf_confluence
threshold: 0.60
features: m15, h1, h4, daily, regime
portfolio:
enabled: true
weights: BTC:0.24, QQQ:0.20, GLD:0.14
rebalance: regime_change
custom:
enabled: true
hooks: chimera_pattern_check, regime_shift_kill
These are public contract hooks. The native implementation may remain server-side, ML-side or CUDA-side.
Agent Validation Loop
1. Call arenascript_reference. 2. Generate ArenaScript only. 3. Call validate_arenascript. 4. Repair until parsed cleanly. 5. Backtest with real arena assumptions. 6. Run Monte Carlo if the result deserves it. 7. Optimize active monster families with CUDA when applicable. 8. Inspect Pine capability. 9. Export to TradingView only after validation.
Forbidden Pseudo-Sections
Unsupported in v1.2
momentum(n), +DI(n), -DI(n), arbitrary Python, Pine Script, and natural-language conditions are not strict ArenaScript conditions.
TradingView partner path
Start with a chart and a price alert.
The free Starter needs no Lab installation or Strategy Arena account. First TradingView account: disclosed partner path. Existing account: neutral link. Evaluating a strategy is a separate task.
Partner coupon context · Affiliate disclosure: Strategy Arena may receive a commission if a first-time user later buys an eligible web subscription. Partner attribution is for first-time users and web purchases only. Account setup does not validate a strategy; exact strategy code remains proof-gated. No purchase is required for the Starter. Any coupon is subject to TradingView's purchase conditions, not granted for an account opening or a KEEP verdict.