Migration Guide
This guide maps the older $... forms to the current syntax.
Core Mapping
| Legacy | Current |
|---|---|
$script({ is_price_study: true }) |
`script({ type: 'indicator' |
$symbols([...]) |
symbols([...]) |
$input({ name, type, defval }) |
input.integer(...), input.float(...), or input.bool(...) |
$symbol.close[index].get(offset) |
symbol.close[index].get(offset) |
$talib.* |
ta.* |
What To Change First
- replace legacy input declarations with
input.* - replace basket declarations with
symbols([...]) - rename
$symbolaccess tosymbol - keep
strategy.entry({ ... })andstrategy.exit({ ... })in object form
Example Migration
Legacy style:
$script({ is_price_study: true });
$symbols(['BTCUSDT:BINANCE:FUTURE:DEFAULT']);
let length = $input({ name: 'Length', type: 'integer', defval: 14 });
let closeValue = $symbol.close[0].get(0);
Current style:
script({ type: 'strategy', priceStudy: true });
symbols(['BTCUSDT:BINANCE:FUTURE:DEFAULT']);
const length = input.integer('Length', 14);
const closeValue = symbol.close[0].get(0);
Migration Rules
- keep the symbol order stable
- keep the trade ids stable
- do not mix old and new input forms in the same script
- re-test the script after each conversion step