fbpx
Tickerly Trading bot service logo

BLOG

Strategy Alerts vs Study Alerts in TradingView: Which to Automate

by

A strategy alert fires when TradingView’s broker emulator fills a simulated order. A study alert (an alert on an indicator) fires when a condition you coded in the indicator becomes true. If you want a bot to place trades, a strategy alert is usually the closer match, because it reports the orders your strategy logic decides to make. A study alert is the better tool when you only need a signal condition, such as a crossover or a level break. Either way, the details of when each one fires decide whether your live orders match what you saw on the chart.

This guide explains both types for traders who connect TradingView to a bot: what triggers them, how bar-close and realtime behavior differ, and what to check before you send anything to an exchange.

Tickerly
tickerly.net
Turn TradingView Alerts Into Trades
Tickerly automates TradingView strategies into trading bots, connecting to exchange platforms to execute trades from your strategy alerts.

Try for free

Key Takeaways

  • Strategy alerts track order-fill events from the broker emulator. Study alerts track conditions in an indicator, through alert() or alertcondition().
  • Alerts only trigger in realtime. Nothing fires on historical bars, so the backtest and the live alert are never the same event stream.
  • Strategies calculate on bar close by default. Intrabar alert frequency is something you choose in code, and it changes how early a signal arrives and whether it can later disappear.
  • A strategy alert runs from a server-side copy. Editing the chart version does not change a running alert until you delete and recreate it.
  • Script alerts that fire more than 15 times in three minutes are stopped automatically, which matters for high-frequency logic.

Table of Contents

What each alert type actually reports

TradingView lets you create alerts on data series, indicator plots, strategy orders and drawings, according to its alert setup guide. The two that matter for bots are alerts on scripts, split into indicators (studies) and strategies.

Study (indicator) alerts

An indicator script can trigger an alert in two ways. The first is alertcondition(condition, title, message). TradingView’s Pine Script alerts documentation describes it as an indicator-only function: the condition is a required boolean series, the title is an optional constant string shown in the Create Alert dialog, and the message is an optional constant string that can hold placeholders but cannot change from bar to bar. The same page notes that alertcondition() calls must start at column zero of a line, so you cannot place them inside an if block.

The second way is alert(), which an indicator can call from inside conditional logic, so the message can be built dynamically. For alerts based on alert() calls, TradingView’s support page says the frequency and message come from the calls in your code, not from the settings in the Create Alert dialog.

In practice: study alerts say “this condition is true now.” They know nothing about positions, fills or whether you are already long.

Strategy alerts

A strategy alert is different because a strategy has a simulated account. The Pine documentation states that a strategy script alert can trigger on broker-emulator order-fill events, in addition to alert() calls. The Strategies FAQ explains that an order fill event occurs when the broker emulator executes a simulated order in realtime.

When you create the alert, TradingView’s documentation on alert() in strategies lists three condition options:

  1. Order fills and alert() function calls
  2. Order fills only
  3. alert() function calls only, which behaves like a script alert on a standard indicator

So a strategy can behave like either type, depending on the option you choose. That flexibility is useful, and it is also where mistakes happen: pick the wrong option and you either get no message when an order fills or a stream of extra messages you did not plan for.

Side by side

Study (indicator) alert Strategy alert
Fires on alertcondition() or alert() conditions Emulator order fills, alert() calls, or both
Knows your position No Yes, through the strategy’s simulated account
Message set by The script code (and the dialog for alertcondition()) Order commands and alert() calls in the script
Runs from Server-side copy of the script Server-side copy of the strategy
Typical use Signals, crossovers, level breaks Entries, exits and reversals with position logic

Which one should feed a bot?

If your logic includes entries, exits, reversals or “only enter if flat” rules, a strategy alert carries that logic with it. The order the strategy decides to place is the event that fires. A study alert can reproduce this, but you have to code the position state yourself and keep it consistent across alerts.

Study and strategy alert capabilities compared

If you built an indicator and only need “long” and “short” conditions, study alerts are simpler and fully workable. Many Pine Script developers run both: an indicator for signal conditions and a strategy for position-aware order flow.

One caution applies to strategy alerts. TradingView’s Strategies FAQ and its support pages describe order-fill alerts as events from the emulator, which simulates fills inside TradingView. That is the signal your bot acts on. The fill price on your exchange can differ, because the exchange fills your real order in its own order book.

Close-bar vs realtime: when does the alert fire?

This is the second half of the question most traders really have. The answer depends on the script type and your settings.

Strategies: bar close by default

The Strategies FAQ states that strategies execute at the close of realtime bars by default, to stay consistent with historical bars. The next possible order fill is then at the beginning of the next bar, unless you set process_orders_on_close = true or use the immediately parameter. So, by default, a strategy alert arrives when a bar has closed, and the signal is final.

Indicators and alert(): you choose the frequency

The alerts documentation explains the two ends of the range. With alert.freq_once_per_bar_close, the alert triggers only when the realtime bar closes and an alert() call ran during that script iteration. With alert.freq_all, every call during the realtime bar can trigger an alert.

Here is what that means for a moving average cross:

  • Close-bar: you get one confirmation after the bar closes. The cross is settled. You enter later, but the signal cannot be withdrawn.
  • Realtime (every call): you hear about the cross the moment it appears, but price can move back before the bar closes. The condition that triggered the alert may no longer be true at the close.

Neither is correct in general. Close-bar suits swing and slower strategies where a confirmed signal matters more than a few seconds. Realtime suits setups where the entry window is short and you have designed for the signal reversing.

Why “it looked fine on the chart” happens

TradingView’s support page on strategy alerts says the server-side strategy calculates on historical data first, then moves to realtime calculation. Notifications are sent only for orders executed in realtime, and none are sent for historical bars. The alerts documentation likewise says alerts only trigger in realtime.

That means the markers you see on past bars never produced an alert. They are a calculation. Live alerts begin at the point where the alert was created and the script reached the realtime bar.

The Strategies FAQ also warns about one specific trap: if you process orders on bar close and an alert occurs at the close of the session’s last bar, the real order can only execute on the next trading day, while the emulator simulates the fill at the previous day’s close. This gap can lead to repainting, where the simulation on historical bars differs from live behavior. If you want to dig into why simulated results diverge from live trading, our guide to Pine Script strategy tester limitations covers the common causes, and our piece on multi-symbol strategies and repainting shows how it plays out across several markets.

Execution settings also change how simulated and live results line up. The article on live trade management rules discusses how managing a trade live differs from what a simulation assumes, which is worth reading before you rely on emulator fills.

Why "it looked fine on the chart" happens

Setup checks before you connect an alert to a bot

A short routine prevents most surprises. These checks apply to any TradingView alert you plan to automate.

  1. Confirm the chart interval. The setup guide says alerts for studies, strategies and drawings depend on the chart interval, since it is used when indicators are calculated. An alert created on a 5-minute chart is a 5-minute alert.
  2. Pick the right strategy condition. Choose order fills, alert() calls, or both, on purpose. Do not leave it on a default you have not read.
  3. Decide the frequency in code for alert(). Since the code controls the frequency and message, check the alert() calls rather than the dialog.
  4. Remember the server-side copy. The support page explains that creating a strategy alert makes a server-side copy that runs independently of the chart copy. If you change inputs or code on the chart, the running alert keeps the old version until you delete it and create a new one. This is the most common reason a live alert behaves differently from the chart in front of you.
  5. Watch the trigger limit. Multiple notifications can be issued in the same bar, but TradingView stops a script alert automatically if it triggers more than 15 times in three minutes. The support documentation treats this as spam prevention that also covers strategy order-fill alerts, so a very high-frequency strategy can lose its alert.
  6. Test on a demo account. Connect the alert to your exchange’s demo account first and compare the demo fills with the emulator’s. That shows you the real gap between simulated and exchange fills before real funds are involved.

Position sizing, stops and risk rules belong in your TradingView strategy, so confirm them there before you create the alert.

A worked example

Suppose you have an EMA crossover on a 15-minute chart.

As a study alert with alertcondition(), you create “Fast EMA crosses above slow EMA.” You pick the frequency in the dialog. Each time the cross is true, you get one message. If you run it on realtime bars, the cross can flicker during the bar. Your bot receives a long message each time.

As a strategy alert, the same cross calls an entry order in the strategy. By default, the strategy evaluates when the bar closes, and the emulator fills at the next bar’s open. The alert fires on that fill event. The message says what the strategy did, and the strategy knows if it was already long.

Same idea, two different event streams. The first reacts to a condition; the second reports a decision made inside a simulated account. For automation that involves reversals and flat-versus-long logic, the second is usually cleaner. For a simple one-direction signal, the first is enough.

From alert to live order with Tickerly

Tickerly works from the alerts you create in TradingView. Our platform turns your TradingView strategy alerts into trading bots for crypto, forex, stocks, futures and prop firm markets, with no code, and no VPS for direct exchange connections. You can run 20 active strategies on Level 2 and unlimited strategies from Level 3, with 100 to 2,500 alerts a day depending on your plan, and connect them to supported exchanges through their APIs. MetaTrader 4 and 5 connect differently: the Tickerly TV Connector EA runs inside your own MetaTrader terminal, with no API keys, and that terminal must stay running, which usually means a VPS.

The step-by-step path is in our setup guide for automated trading from TradingView, and the overview TradingView strategy automation shows the full route from alert to live order. If you want to understand what happens after the alert fires, real-time trade execution walks through how an order moves from signal to fill.

Why the choice matters when you scale

Once you run several strategies, the differences compound. Each strategy alert has its own server-side copy, each with its own frequency rules, and each counted against your TradingView alert allowance. If alert limits are what is holding you back, see how to double your usable TradingView alerts. Running many strategies across symbols and platforms is the setup Tickerly was built for, and the TradingView alerts to exchange page explains how those alerts reach live orders.

Our view

We see the strategy-versus-study question as a question about where your logic lives. If it lives in a strategy, with entries, exits and position state, the alert should report the strategy’s orders. If it lives in an indicator, the alert should report a condition, and you should be deliberate about whether it fires at bar close or intrabar.

Whichever you choose, the discipline is the same: know when the alert fires, know that the running alert is a server-side copy, and test against your exchange’s demo account before real funds. Automation removes the manual click, and it also removes the chance to catch a mismatch by eye, so the setup deserves care.

That is why we built Tickerly around the TradingView alert you already trust. You keep your strategy and your rules in TradingView, and we turn the alerts into orders on your connected exchange, for as many strategies as your plan allows, with a 30-day free trial to get it right.

Jay

Start automating your alerts

Tickerly plans start at $19 per month for Level 2, with Level 3 at $29 per month and Level 4 at $39 per month. Level 4 Ultra is also available for heavier use. Every plan begins with a 30-day free trial. Compare them on the Tickerly plans page.

Tickerly

You can connect a TradingView alert to a demo account on a supported exchange first, then move to live trading when the fills match what you expect.

FAQ

Do strategy alerts and study alerts both work with a trading bot?

Yes. Both are TradingView alerts, and a bot acts on the message an alert sends. A strategy alert reports order fills or alert() calls from the strategy. A study alert reports a condition from an indicator. Choose the one that matches where your logic lives.

Does a close-bar alert fire later than a realtime alert?

Yes. A close-bar alert, such as one using alert.freq_once_per_bar_close, waits for the realtime bar to close. An alert using alert.freq_all can fire on any call during the bar. The close-bar signal is later but settled, while the realtime one is earlier but can reverse before the bar ends.

Why did my strategy alert not fire on past signals?

Alerts only trigger in realtime, and TradingView sends no notifications for orders on historical bars. The markers on past bars come from calculation, not from alert events. Your alert starts reporting once the strategy reaches the realtime bar.

Why does my live alert differ from my chart after I edited the script?

A strategy alert runs from a server-side copy created when you made the alert. Changes on the chart do not affect it. Delete the alert and create a new one so it picks up your edits.

Is there a limit on how often an alert can fire?

TradingView automatically stops a script alert that triggers more than 15 times within three minutes. Multiple notifications in one bar are allowed, but a high-frequency script can hit this limit.

Sources

This article was produced with Al assistance and reviewed for accuracy. It is provided for general information only and is not professional or financial advice.

Tags :

Latest Post