It reads itself back
The compiler writes out what the script does in plain English.
Convert · thinkScript
You have spent years on your thinkScript scripts. You should not have to start again. Paste one in, and AlgoBarsX rewrites it and tells you what it did to every line.
This is a real run of the importer. The result compiles. It read 8 lines: 7 carried over exactly, 1 were adapted, and 0 came back as choices for you.
input fastLength = 20;input slowLength = 50;def fast = ExpAverage(close, fastLength);def slow = ExpAverage(close, slowLength);plot FastLine = fast;plot SlowLine = slow;AddOrder(OrderType.BUY_TO_OPEN, fast crosses above slow);AddOrder(OrderType.SELL_TO_CLOSE, fast crosses below slow);strategy "Imported study"market: EURUSDbars: 1hinput risk = 1%input fastLength = 20input slowLength = 50fast = ema(close, fastLength)slow = ema(close, slowLength)when crosses_above(fast, slow):buy risk: risk, stop: atr(14) * 2, target: 2Rwhen crosses_below(fast, slow):close_all side: longplot fast as FastLineplot slow as SlowLine| Status | Your line | What happened |
|---|---|---|
| Exact | input fastLength = 20 | the input fastLength carried over |
| Exact | input slowLength = 50 | the input slowLength carried over |
| Exact | def fast = ExpAverage(close, fastLength) | fast carried over |
| Exact | def slow = ExpAverage(close, slowLength) | slow carried over |
| Exact | plot FastLine = fast | the plot FastLine carried over |
| Exact | plot SlowLine = slow | the plot SlowLine carried over |
| Adapted | AddOrder(OrderType.BUY_TO_OPEN, fast crosses above slow) | thinkorswim sizes an order by the chart settings, so this one risks a set share of the balance with an ATR stop: set the size you want |
| Exact | AddOrder(OrderType.SELL_TO_CLOSE, fast crosses below slow) | a closing order carried over |
| In thinkScript | In AlgoBarsX |
|---|---|
input fastLength = 20; | input fastLength = 20 |
def fast = ExpAverage(close, fastLength); | fast = ema(close, fastLength) |
plot FastLine = fast; | plot fast as FastLine |
fast crosses above slow | crosses_above(fast, slow) |
AddOrder(OrderType.BUY_TO_OPEN, cond) | when cond: with buy under it |
AddOrder(OrderType.SELL_TO_CLOSE, cond) | when cond: with close_all side: long under it |
yes, no | true, false |
BarNumber() | bar.index |
thinkScript orders carry no stop or size, so the import adds a risk input with a stop of two ATRs and a 2R target. Check those three numbers before anything else.
Open the Terminal, choose Import, and paste your code or pick the file.
Each line is marked exact, adapted, or your call. Settle every “your call” before you go on.
Check the plain-English description against what your old script did. Then run a test.
The compiler writes out what the script does in plain English.
Percent, pips, R and money are types. Mix-ups are caught before anything runs.
The same file draws, tests, alerts and trades.
No. Simple, common shapes convert best. An import that does not compile says so, and every changed line carries a note. Always read the result.
No. Your old script is untouched. Lines that needed a choice keep the original as a comment.
AlgoBars is $0 a month with no card. Credits pay for AI, tests and auto trades.
Pick a small one. Paste it in. Read what comes back.
Create my free account$0 a month · No card needed · Not a trial
Trading is risky. You can lose money. It is not right for everyone.