OPEN-SOURCE SCRIPT
John Trade Alerts

Imagine you are watching a ball bounce up and down on a graph.
This script is like a set of rules that says:
When to start playing
When to stop playing
When you got some prize levels
and it yells to you (alerts) when those things happen.
The main ideas
Breakout Buy (ball jumps high)
There is a line drawn high on the chart called the breakout level.
If the price (the ball) closes above that line, and some extra “good conditions” are true (enough volume, uptrend, etc.),
the script says: “We entered a Breakout trade now.”
Pullback Buy (ball dips into a box)
There is a zone (a small box) between a low line and a high line: the pullback zone.
If the price closes inside that zone, and the pullback looks “healthy” (not too much volume, still above a moving average, etc.),
the script says: “We entered a Pullback trade now.”
Stops (when to get out if it goes wrong)
For each entry type (Breakout or Pullback), there is a red stop line under the price.
If the price falls below that stop line, the script says:
“Stop hit, we’re out of the trade.”
Hard Support / Invalidation (big no‑no level)
There is a special hard support line.
The script also looks at the 1‑hour chart in the background.
If a 1‑hour candle closes below that hard support, it says:
“Hard invalidation – idea is broken, get out.”
Targets (prize levels)
Above the current price there are several orange lines: Target 1, 2, 3A, 3B, 4A, 4B.
If the price goes up and crosses one of these lines, the script says:
“Target X reached!”
Trend and Volume “health checks”
It checks if the short‑term average price (SMA20) is going up → “uptrend.”
It can check if price is above a long‑term average (SMA200).
For breakouts, it checks if volume is stronger than usual (good push).
For pullbacks, it prefers quieter than usual volume (calm dip).
It can also check an Anchored VWAP line (a special average price from a chosen starting time) and only trade if price is above that too.
Remembering if you are “in a trade”
The script keeps a little memory:
Are we currently in a position (inPos) or not?
Was it a Breakout or a Pullback entry?
What is our entry price and active stop?
When it gets a new entry signal, it turns inPos to true, picks the right stop, and draws that stop line.
When a stop or hard invalidation happens, it sets inPos to false again.
It can also “forget” and reset at the start of a new trading day if you want.
Alerts
When:
you get a Breakout entry
or a Pullback entry
or a Stop is hit
or the hard support is broken on 1‑hour
or a Target is reached
the script sends a message you can use in TradingView alerts (pop‑ups, email, webhook, etc.).
Things you see on the chart
Teal line: Breakout level
Green lines: Pullback zone low & high
Red line: Active stop (only when you’re “in” a trade)
Orange lines: Targets 1, 2, 3A, 3B, 4A, 4B
Blue line: Anchored VWAP (if you turn it on)
Purple faint line: SMA20 (short‑term trend)
Gray faint line: SMA200 (long‑term trend)
Little label near the last bar that says:
if you’re IN or Flat
which type of entry (Breakout/Pullback)
what your current stop is
So in kid words:
It draws important lines on the chart.
It watches the price move like a ball.
When the ball does something special (jump above, fall below, hit a prize line),
it shouts to you with alerts.
It remembers if you’re in the game or not, and where your safety line (stop) is.
This script is like a set of rules that says:
When to start playing
When to stop playing
When you got some prize levels
and it yells to you (alerts) when those things happen.
The main ideas
Breakout Buy (ball jumps high)
There is a line drawn high on the chart called the breakout level.
If the price (the ball) closes above that line, and some extra “good conditions” are true (enough volume, uptrend, etc.),
the script says: “We entered a Breakout trade now.”
Pullback Buy (ball dips into a box)
There is a zone (a small box) between a low line and a high line: the pullback zone.
If the price closes inside that zone, and the pullback looks “healthy” (not too much volume, still above a moving average, etc.),
the script says: “We entered a Pullback trade now.”
Stops (when to get out if it goes wrong)
For each entry type (Breakout or Pullback), there is a red stop line under the price.
If the price falls below that stop line, the script says:
“Stop hit, we’re out of the trade.”
Hard Support / Invalidation (big no‑no level)
There is a special hard support line.
The script also looks at the 1‑hour chart in the background.
If a 1‑hour candle closes below that hard support, it says:
“Hard invalidation – idea is broken, get out.”
Targets (prize levels)
Above the current price there are several orange lines: Target 1, 2, 3A, 3B, 4A, 4B.
If the price goes up and crosses one of these lines, the script says:
“Target X reached!”
Trend and Volume “health checks”
It checks if the short‑term average price (SMA20) is going up → “uptrend.”
It can check if price is above a long‑term average (SMA200).
For breakouts, it checks if volume is stronger than usual (good push).
For pullbacks, it prefers quieter than usual volume (calm dip).
It can also check an Anchored VWAP line (a special average price from a chosen starting time) and only trade if price is above that too.
Remembering if you are “in a trade”
The script keeps a little memory:
Are we currently in a position (inPos) or not?
Was it a Breakout or a Pullback entry?
What is our entry price and active stop?
When it gets a new entry signal, it turns inPos to true, picks the right stop, and draws that stop line.
When a stop or hard invalidation happens, it sets inPos to false again.
It can also “forget” and reset at the start of a new trading day if you want.
Alerts
When:
you get a Breakout entry
or a Pullback entry
or a Stop is hit
or the hard support is broken on 1‑hour
or a Target is reached
the script sends a message you can use in TradingView alerts (pop‑ups, email, webhook, etc.).
Things you see on the chart
Teal line: Breakout level
Green lines: Pullback zone low & high
Red line: Active stop (only when you’re “in” a trade)
Orange lines: Targets 1, 2, 3A, 3B, 4A, 4B
Blue line: Anchored VWAP (if you turn it on)
Purple faint line: SMA20 (short‑term trend)
Gray faint line: SMA200 (long‑term trend)
Little label near the last bar that says:
if you’re IN or Flat
which type of entry (Breakout/Pullback)
what your current stop is
So in kid words:
It draws important lines on the chart.
It watches the price move like a ball.
When the ball does something special (jump above, fall below, hit a prize line),
it shouts to you with alerts.
It remembers if you’re in the game or not, and where your safety line (stop) is.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。