Turn your trading idea into an indicator.
In minutes.
WealthScript is WealthCharts' built-in language for custom indicators and strategies. Write it yourself, or describe it in plain English, typed or spoken aloud where your AI assistant supports voice, and let the AI write it. Then backtest it on real history before you risk a dollar.
One language, one editor, every chart. Everything below is in the reference today.
Your indicators move with you.
Spent years building indicators somewhere else? Don't start over. Paste your existing script into ChatGPT, Claude or any AI assistant along with our official WealthScript reference, and it rewrites it in WealthScript, the advanced WealthCharts language. Same logic, same signals, on your new charts.
- 01Copy your indicator's source code.
- 02Hand your AI assistant the WealthScript reference and ask it to convert the script for you.
- 03Paste the result into the Code Editor, compile it, and apply it to any chart you trade on.
1//@version=52indicator("Fast/Slow MA Cross", overlay=true)3fastLen = input.int(10, "Fast")4slowLen = input.int(30, "Slow")5fastMA = ta.sma(close, fastLen)6slowMA = ta.sma(close, slowLen)7plot(fastMA, "fast MA")8plot(slowMA, "slow MA")9barcolor(fastMA > slowMA ? color.green : na)10if ta.cross(fastMA, slowMA)11 alert("Fast/slow MA cross")
“Plot a fast and a slow moving averageon the price chart,colour the bar when the fast averageis above the slow one,and raise an alert on the barwhere the two averages cross.
Say what you want. Get the script.
Never written a line of code? Tell your AI assistant what the indicator should do, in plain English. Type it, or just say it out loud where your assistant supports voice to text. Hand it our WealthScript reference and it writes the whole script. The example here is the exact request from our tutorial and the exact script that came back, compiled and applied unedited.
- 01Describe the indicator in a sentence or two.
- 02Hand your AI assistant the WealthScript reference and ask it to write the whole script for you.
- 03Paste the result into the Code Editor, compile it, and apply it to any chart you trade on.
Idea to backtest in four steps.
Copy one. Paste it. Trade in five minutes.
Four small scripts written straight from the reference. Copy, paste into the Code Editor, compile, and change the inputs from the chart dialog.
1[Name = "RSI Zones"]2[PlotSubchart(1, 1)]3[PlotSubchart(2, 1)]4[PlotSubchart(3, 1)]5input Len(14);6input Overbought(70);7input Oversold(30);8let rsiVal = RSI(close, Len);9plot1(rsiVal, "RSI");10plot2(Overbought, "overbought", Red);11plot3(Oversold, "oversold", Green);12if rsiVal > Overbought then13 ColorBar(Red);14elseif rsiVal < Oversold then15 ColorBar(Green);16end;
RSI in its own pane with overbought and oversold levels, and the bar painted when price is stretched.
1[Name = "Breakout Alert"]2input Len(20);3let hiBand = Highest(high, Len);4let loBand = Lowest(low, Len);5plot1(hiBand[1], "breakout high", Green);6plot2(loBand[1], "breakout low", Red);7if close > hiBand[1] and CheckAlert() then8 Alert("Breakout above the range high");9end;10if close < loBand[1] and CheckAlert() then11 Alert("Breakdown below the range low");12end;
Draws the prior N-bar high and low on price and alerts once when a close breaks either side.
1[Name = "Bollinger Bands"]2input Len(20);3input Dev(2);4let upperBand = BollingerBand(close, Len, Dev);5let lowerBand = BollingerBand(close, Len, -Dev);6plot1(upperBand, "upper");7plot2(lowerBand, "lower");8plot3(Average(close, Len), "basis", DarkGray);9if close > upperBand then10 ColorBar(Green);11elseif close < lowerBand then12 ColorBar(Red);13end;
Upper and lower bands around a moving average, with the bar painted on a close outside them.
1[Name = "MA Cross Strategy"]2input FastLen(10);3input SlowLen(50);4input StopPct(2);5let quick = Average(close, FastLen);6let slowly = Average(close, SlowLen);7if CrossOver(quick, slowly) then8 buy("Long") 1 contracts next bar at market;9end;10if CrossUnder(quick, slowly) then11 sell("Flat") all next bar at market;12end;13if MarketPosition() != 0 then14 SetStopPercent(StopPct, false);15end;16plot1(quick, "fast");17plot2(slowly, "slow");
Goes long on a fast-over-slow cross, flattens on the cross back, with a percent stop. Built for the Strategy Tester.
Quick answers.
One subscription. Every tool.
Stop trading someone else's indicator.
Build your own edge with WealthScript.
Included with every WealthCharts membership. Code it, AI it, backtest it, trade it.