Skip to content
TradequixDocsOpen the terminal
OverviewStart here, search, progress
  • Introduction
  • Quickstart
  • How a script runs
  • Types and qualifiers
  • Operators, conditionals and loops
  • Functions and methods
  • Objects and enums
  • Arrays, matrices and maps
  • Strings and colours
  • Time and sessions
  • Bar states
  • Plotting
  • Inputs
  • Technical analysis
  • Drawings and tables
  • Multiple timeframes
  • Strategies
  • Alerts in scripts
  • Repainting
  • The Pine editor
  • Indicator settings
  • Coming from TradingView
  • The data
  • Publish and sell
  • Catalogue and community
  • Your dashboard and earnings
  • Errors and debugging
  • Limits
  • Coverage
  • Built-in catalogue
  • Cookbook
  • Write Pine with AI
  • FAQ
  • Glossary
  • Cheat sheet
  • Function reference
  • Will it run here?
  • Error index

Write

Alerts in scripts

What alert() and alertcondition() do on Tradequix today, and how they differ from the server price alerts that fire with the tab closed.

View as MarkdownOpen in ClaudeOpen in ChatGPT

There are two different things called alerts on Tradequix. Knowing which is which saves confusion.

Script alertsPrice alerts
Created byalert() / alertcondition() in PineThe alert button on the chart
EvaluatedWhere the script runs, while the chart is openOn the server, all the time
You see themIn the Pine editor's consoleAs a notification and an email
Fire with the tab closedNoYes

Script alerts#

alert(message) emits an event when it is called. alertcondition(condition, title, message) declares a condition that can be alerted on. Both run and are captured; the events appear in the console of the Pine editor, so you can see exactly when your logic would have fired.

RunnableBreakout alert
1//@version=62indicator("Breakout alert", overlay = true)3hi = ta.highest(high, 20)[1]4plot(hi, "20-bar high", color = color.orange, style = plot.style_stepline)5breakout = ta.crossover(close, hi)6plotshape(breakout, "Breakout", style = shape.arrowup, location = location.belowbar, color = color.teal, size = size.small)7alertcondition(breakout, "Breakout", "Close broke the 20-bar high")8if breakout9 alert("Breakout at " + str.tostring(close, format.mintick), alert.freq_once_per_bar_close)

Use them to check your signal logic while building a script.

Watch out

Script alerts are not yet a background service. They do not notify you when the chart is closed, and they are not sent by email or push. For that, use a price alert.

Price alerts#

Price alerts are set from the chart's alert button on a level: crossing, greater than, less than, entering or leaving a range, and more. They are checked by the server on every bar, so they fire whether or not your chart is open, and reach you as an in-app notification and an email. Conditions based on an indicator's value are not available yet.

PreviousStrategiesNext Repainting

On this page

  • Script alerts
  • Price alerts

Use with AI

View as MarkdownOpen in ClaudeOpen in ChatGPT