Prompt brief
ThinkScript · one source file
Example request
Create a thinkorswim Donchian upper study with configurable entry and exit lengths, prior-bar breakout markers, a midpoint, and alerts that fire only on new completed-bar breakouts.
price-channel guide
A Donchian channel tracks the highest high and lowest low over stated lookbacks. The key strategy decision is whether a breakout compares with a channel that includes the current bar or with the completed prior channel.
Source review completed
Prompt brief
ThinkScript · one source file
Example request
Create a thinkorswim Donchian upper study with configurable entry and exit lengths, prior-bar breakout markers, a midpoint, and alerts that fire only on new completed-bar breakouts.
For a basic thinkorswim Donchian channel, plot Highest(high, length) and Lowest(low, length), with an optional midpoint. For breakout logic, compare the current bar with the prior channel value so the current high or low does not move the threshold at the same time. Use separate entry and exit lengths if that is part of the rule.
Reference points
A PriceChannel-style study displays recent high and low bounds. A Donchian strategy adds rules for simulated entries and exits, and may use different lengths depending on position state.
Do not assume the visual channel’s current value is automatically the correct strategy threshold. Write the order condition with its intended offset.
Choose a visible bar where price exceeds the preceding lookback high. Confirm the previous upper channel, current high or close used by the rule, and the exact bar on which the marker or simulated order appears.
Pineify can build either a study or strategy, but the requested type, offset, order behavior, and exit rules must be explicit.
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.
To run a thinkorswim backtest, express the rules as a strategy that uses AddOrder, add it to a chart, set the symbol, aggregation, date range, order size, commission, and slippage assumptions, then inspect the strategy report. Treat the result as a conditional simulation rather than a forecast.
Read guideA reviewable thinkorswim Supertrend study needs a stated price basis, ATR length, ATR smoothing method, multiplier, final-band rules, and state transition condition. thinkScript provides true-range and moving-average building blocks, but the exact Supertrend formula should be written down rather than inferred from the name.
Read guideA thinkorswim support and resistance indicator can use prior session highs and lows, pivot formulas, rolling channels, or confirmed swing points. Choose one method and define its parameters. Combining every method without labels creates ambiguous levels and makes the result difficult to test.
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.
The Learning Center documents PriceChannel as a channel study and Donchian as a strategy. Custom thinkScript can also plot highest-high and lowest-low channels with stated rules.
If the current bar is included, its own high or low can move the threshold being tested. Referencing the prior completed channel keeps the trigger based on information available before the breakout bar.
Yes. Define entry and exit lengths, price comparisons, order direction, repeated-entry behavior, and any filters. Run the result as a simulated strategy in thinkorswim.
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.