ScriptsFAQ
ChartScript, the editor, Verify, errors and limits. 23 answers, updated Oct 2026.
Scripting
23Log in to TradingCharts and open the chart terminal. You'll find the ChartScript editor icon in the bottom-right corner of the screen. Click it and the editor opens next to your chart, so you can write a script and see it on the chart straight away.
ChartScript is the scripting language built into TradingCharts. You use it to write your own indicators and trading strategies, then add them to any chart with one click. It's compatible with all major trading scripting languages, so if you've written scripts before, the syntax will feel familiar.
Not to get started. A simple indicator is only a few lines, like calculating two moving averages and plotting them. If you'd rather not write code at all, the AI Assistant can build indicators and strategies from a plain-English description, and the Indicator Marketplace has ready-made ones.
Yes. ChartScript is compatible with all major trading scripting languages, so you can import scripts you've already written and add them straight to your chart. Complex scripts may need small changes, but most work as they are.
Two things: indicators and strategies. An indicator calculates and plots something on the chart, like a custom moving average or a signal line. A strategy goes further and includes entry and exit rules, so you can backtest it and see how it would have traded.
An indicator script only draws on the chart: lines, histograms, labels or signals. A strategy script also tells TradingCharts when to buy and when to exit, using entry and close commands. Only strategy scripts can be backtested.
Open the ChartScript editor from the icon in the bottom-right corner of the chart terminal, start a new indicator and give it a name. Define your inputs, like an EMA length of 9, calculate your values, then plot them. Click Add to Chart and it appears on your chart. Change an input and the chart updates.
Start a new strategy, calculate whatever your rules depend on, then add entry and exit conditions. For example, enter long when the 9 EMA crosses above the 21 EMA and close the trade when it crosses back below. Add it to the chart and you'll see each trade marked on the candles.
Yes. Define inputs in your script, like a length, a price source or a colour, and they show up in the indicator's settings panel. That way you, or anyone you share it with, can tweak the values without touching the code.
ChartScript comes with a library of common technical analysis functions, such as EMA, SMA, RSI, crossover and crossunder, along with tools for inputs, plotting, colours and strategy orders. You don't have to write the maths for standard indicators yourself.
Yes. Once your strategy is on the chart, click Backtest Strategy. You'll see how it performed over the last 90 days, with every trade it took, net P&L, win rate, largest profit and loss, expectancy and other trading stats.
It shows each trade the strategy took on historical data, plus net P&L, number of winning and losing trades, win rate, largest profit, largest loss, expectancy and a returns distribution. Together they tell you whether a strategy actually has an edge or just looked good on a few trades.
The backtest runs over the last 90 days of historical data. That's long enough to see how a strategy handles different market conditions, from trending days to choppy ones.
Yes. Describe what you want in plain English, like a moving average crossover strategy or an intraday setup for gold and silver, and the AI Assistant writes the ChartScript for you. You can add it to your chart as it is, or open the code and edit it.
Open Indicators from the top toolbar and go to My scripts. Every indicator and strategy you've written or imported is saved there, ready to add to any chart.
Yes. Once a script is saved, you can add it to any symbol and any timeframe, the same way you add a built-in indicator. Write it once and use it across every chart.
Yes. Your scripts stay private unless you choose to share them. Creators can also publish private indicators and decide exactly which users get access to them.
Yes. With private indicators, you choose which users can use your script. You can give access to selected traders and remove it whenever you need to, and they can use the indicator without seeing your code.
Yes. If you've built an indicator or strategy that works, you can sell it on the Indicator Marketplace by collaborating with the TradingCharts team. Get in touch through the Creator page to get started.
Yes. Share your idea with us through the Creator page and we can work with you to build it. You can also try describing it to the AI Assistant, which can turn a plain-English idea into a working script.
Usually it's one of three things: the script doesn't call plot, the values are on a very different scale from price, or it needs more candles than the chart has loaded. Check for error messages in the editor first, then try adding the script to a longer timeframe.
Yes, scripts run on all 22 chart types. On Heikin Ashi, Renko and other price-based charts, though, the script calculates from those adjusted prices, so run and backtest strategies on regular candles if you want realistic results.
Yes. Writing, saving, adding and backtesting your own indicators and strategies is free on TradingCharts.