Prompt brief
ThinkScript · one source file
Example request
Write a lower thinkScript study that plots a 20-bar relative volume ratio, colors values above 1.5 blue, and exposes the lookback and threshold as inputs.
thinkScript language guide
thinkScript is thinkorswim code for chart studies, simulated strategies, watchlist columns, alerts, and scan conditions. The output is evaluated as a time series across chart bars.
Source review completed
Prompt brief
ThinkScript · one source file
Example request
Write a lower thinkScript study that plots a 20-bar relative volume ratio, colors values above 1.5 blue, and exposes the lookback and threshold as inputs.
A thinkorswim script is source code written in thinkScript. Most chart scripts are studies that calculate plots, labels, colors, or alerts, or strategies that add simulated orders for historical analysis. Pineify can generate and revise one editable study or strategy file from a plain-English specification.
Reference points
The thinkorswim coding language is designed around market data series. A reference such as close represents the current bar and its history, while close[1] refers to the prior bar. This makes many indicator formulas concise, but it also means aggregation, offsets, and missing values affect the result.
A script usually declares inputs, defines intermediate series, and produces one or more plots or strategy orders. It does not run as a standalone program outside thinkorswim.
Start with a testable specification: define every input, formula, visual output, alert condition, and strategy rule. Generate the first source, then inspect names, offsets, defaults, and conditions before opening it in the platform editor.
After thinkorswim accepts the code, compare its output with a small set of bars you can calculate or inspect manually. This catches logic errors that a parser cannot detect.
Pineify thinkScript workflow
Give the Coding Agent the formula, inputs, plots, alerts, and edge cases. It returns one editable study or strategy file and keeps focused revisions in the same code artifact.
Open Charts, select Studies, then Edit Studies. Choose Create for a study, or open the Strategies tab and create a strategy. Paste the thinkScript source into the editor, give it a unique name, save it, and add it to the chart. A .ts file can also be imported through the editor. Fix every parser error before treating the script as installed.
Read guidethinkorswim includes a studies library for common indicators and a thinkScript editor for custom studies. There is no universal best indicator for day trading. Select a study by its calculation, inputs, chart context, and failure modes, then test whether its signal adds information beyond price alone.
Read guideThe thinkScript Alert function accepts a condition, message, alert type, and sound. Put it in a study when the trigger depends on custom calculations. Use a crossing condition when you want one event at a transition rather than an alert on every bar where a state remains true.
Read guideLast verified:
Pineify provides information and code-generation assistance, not investment advice. Generated scripts, strategy reports, simulations, and historical examples cannot predict prices or guarantee returns. Review every script and test it in thinkorswim before relying on its output.
thinkorswim scripts use thinkScript, a domain-specific language for chart calculations, studies, strategies, alerts, watchlist columns, and scan conditions.
The AddOrder function adds simulated orders to a strategy for analysis. It does not submit a live broker order. Keep live execution claims separate from chart strategy behavior.
Yes. Provide the current single-file study or strategy and describe the change. Review the revised source and verify it in the thinkScript Editor afterward.
Generate one editable thinkScript study or strategy, inspect the source, request focused changes, and complete the final check in thinkorswim.
Pineify generates source code. thinkorswim remains the platform authority for parsing and chart behavior.