custom alert guide

thinkorswim Alerts: Define and Script a Clear Trigger

A useful thinkorswim alert begins with a Boolean condition and an event rule: decide what must be true, whether the alert fires on the first crossing or throughout the state, and how often it may repeat.

Source review completed

Prompt brief

ThinkScript · one source file

Review in thinkorswim

Example request

Add an alert to this thinkorswim study when close crosses above VWAP after 9:45 a.m. The alert should fire only on the new cross and include the symbol and condition in the message.

Editable sourceFocused revisionsNative editor check

Direct answer

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

What to know first

  • Condition and repetition behavior are separate decisions.
  • A chart study alert is evaluated in the chart and platform context where it runs.
  • Test both a true case and a false case before relying on a notification.

Practical workflow

Follow the steps in order

  1. 01

    Write the condition in plain language

    Name the series, comparison, aggregation, session, and exact transition. Avoid phrases such as strong momentum unless they have a numeric definition.

  2. 02

    Choose the event behavior

    Decide whether the alert should fire once, once per bar, or according to another supported alert type. Use a cross when the transition itself is the event.

  3. 03

    Add a message and sound

    Write a message that identifies the condition and chart context. Select a supported sound or use the default that fits your setup.

  4. 04

    Force a controlled test

    Use a temporary threshold that you can trigger safely, confirm the message and repetition behavior, then restore the intended input and retest the false state.

State alerts and event alerts behave differently

The condition close > average describes a state that may remain true across many bars. The condition that close crosses above average describes a transition. If the goal is a single notice when the state begins, the transition is usually the clearer specification.

Document intrabar versus completed-bar expectations as well. A condition evaluated while a bar is changing can appear and disappear before the bar closes.

What Pineify can generate

Pineify can add an Alert call to a single-file chart study, expose thresholds as inputs, and revise the condition or message. It does not deliver the notification outside the thinkorswim alert system.

After generation, save the study in the thinkScript Editor and test it on the intended chart. Confirm the condition on visible bars before enabling a real notification workflow.

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

Can thinkScript create alerts?

Yes. The Alert function can trigger from a Boolean condition and includes a message, alert type, and sound.

Why does my thinkorswim alert repeat?

The condition may describe a state that remains true, or the selected alert type may permit repeated evaluation. Use an explicit crossing event and review the alert-type setting when you need a single transition notice.

Can Pineify test whether a thinkorswim alert was delivered?

No. Pineify can generate the condition and Alert call. Notification delivery and platform settings must be tested inside thinkorswim.

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.