rule-based level study

Support and Resistance Indicator for thinkorswim

Support and resistance are labels for a method, not one fixed formula. A script must define how levels are selected, confirmed, extended, merged, and invalidated.

Source review completed

Prompt brief

ThinkScript · one source file

Review in thinkorswim

Example request

Create a thinkorswim upper study with prior-day high and low plus confirmed swing levels using three bars on each side. Label each source, retain the last four swings, and alert once on a completed-bar close through a level.

Editable sourceFocused revisionsNative editor check

Direct answer

A 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.

What to know first

  • Each line should have a named source and calculation.
  • Confirmed swing levels appear after their right-side bars exist.
  • A touch, close-through, and retest are separate events.

Reference points

Keep the calculation explicit

Prior-period level
A high, low, open, or close from a specified completed session or aggregation.
Pivot formula
A fixed calculation from prior-period prices, with the formula family named explicitly.
Rolling channel
The highest high and lowest low over a selected bar lookback.
Swing level
A confirmed local high or low with a stated left and right strength.

Choose one level family first

Prior-day levels are known at the start of the next session. Pivot formulas transform prior-period prices. Rolling channels update as the window moves. Swing levels require later bars for confirmation. Their timing and interpretation differ.

Name and color each family separately if more than one is shown. This preserves the reason a level exists.

Define level events without hindsight

A close above a level, an intrabar touch, and a retest after a break require different conditions. For confirmed pivots, trigger from the confirmation bar onward instead of pretending the level was known on the pivot bar.

Pineify can generate the plots, labels, inputs, and alerts from these rules. Review the first valid level after each session boundary and every replacement event.

  • State the session and timezone for prior-period levels.
  • Define tolerance in price units, ticks, or percent.
  • Set a maximum number or age for retained levels.

Pineify thinkScript workflow

Turn the specification into editable thinkScript

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 the thinkScript agent

Sources and scope

Last 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.

Frequently asked questions

What is the best support and resistance indicator on thinkorswim?

There is no single formula. Choose prior-period levels, a named pivot formula, rolling channels, or confirmed swing points according to the decision you need to make.

Do pivot support levels repaint?

Fixed prior-period pivot formulas do not need future bars after their source period closes. Swing-pivot levels require right-side bars for confirmation, so their availability is delayed.

Can Pineify create support and resistance alerts?

Yes. Define the level source, touch or close rule, tolerance, confirmation, and repetition. Then verify the generated alert on known chart examples.

Continue in the thinkScript coding workspace

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.