RSI‑MA Near‑Level AlertRSI‑MA Near‑Level Alert — Publication Description
Overview
RSI‑MA Near‑Level Alert plots a smoothed Relative Strength Index (RSI) line and sends automatic alerts whenever that line comes within a user‑defined distance of two key thresholds (default = 70 for overbought, 30 for oversold). It is designed for traders who want an early warning—before a classic 70/30 cross—so they can tighten stops, scale out, or prepare reversal setups.
How It Works
RSI Calculation – Uses the standard RSI (default length 14).
Smoothing – Applies a moving‑average (default Simple 10) to reduce noise.
Proximity Logic – On every bar, the script measures the absolute distance between the smoothed RSI line and each threshold.
If the distance ≤ the Proximity setting (default 1 point), the condition flips to true.
Built‑in Alert Triggers – Two alertcondition() calls are embedded:
“RSI MA near UPPER level”
“RSI MA near LOWER level”
Select either one (or both) from the TradingView alert dialog and choose your delivery method (popup, e‑mail, SMS, webhook).
Inputs
Input Default Purpose
RSI Length 14 Core momentum look‑back.
Smoothing MA Length 10 Length of the MA applied to RSI.
Upper Level 70 Overbought line.
Lower Level 30 Oversold line.
Alert Proximity (points) 1.0 How close (in RSI points) the MA must get to trigger.
All inputs are fully editable after you add the script to a chart.
Typical Use‑Cases
Pre‑emptive Exits – Get notified when momentum is stalling near 70 or 30 so you can lock in gains before a reversal.
Reversal Hunting – Combine the alert with price‑action patterns (pin bars, engulfing candles) for higher‑probability fades.
Breakout Confirmation – Increase Upper Level to 80 / Lower Level to 20 and lower Proximity to 0.5 for more aggressive trend‑following alerts.
Step‑by‑Step Alert Setup
Add the script to your chart.
Click the alarm‑clock‑plus icon (or press Alt + A).
In “Condition,” select RSI‑MA Near‑Level Alert.
Choose either RSI MA near UPPER level or RSI MA near LOWER level.
Pick Once Per Bar Close for confirmed signals or Once Per Bar for real‑time.
Select your preferred notification methods and click Create.
(Repeat for the opposite threshold.)
Customization Tips
Change Smoothing Type – Replace ta.sma() with ta.ema(), ta.rma(), etc., directly in the code if you prefer another MA.
Track Multiple Assets – Apply the indicator to each symbol in a multi‑chart layout and set independent alerts.
Narrow Range Play – Set Upper = 60, Lower = 40 and Proximity = 0.5 to monitor a quiet‑momentum band.
Disclaimer
This script is provided for educational purposes only. It does not constitute financial advice, and past performance is not indicative of future results. Always back‑test and validate on demo data before risking live capital. The author assumes no liability for trading losses or platform malfunctions.
Trend Analizi
Structure Level IndicatorThis indicator draws solid lines to show Structure based levels as they form.
When those levels are no longer valid, they turn into dashed lines.
Use it to visualize market structure and spot areas of interest.
Lucio Toolkit + LiquidityThis script is designed for trading assets like Nasdaq and Gold, offering a clear view of market trends using dynamic support and resistance indicators such as EMAs and VWAP.
It features Fair Value Gap (FVG) detection and key liquidity levels, helping traders pinpoint strategic zones for smarter entries and exits.
Ideal for those who want to combine advanced technical analysis with price structure-based decision-making.
AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)Below is a fully self-contained, English-language description of every input, function, and logical block inside the “AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)” indicator. You can copy and paste this into TradingView’s “Description” field when you publish, without exposing any Pine code.
---
## Indicator Name and Purpose
**Name (Short Title):**
AI Strat Adaptive v3 (NoRepaint)
**Overview:**
This indicator combines multiple technical tools—RSI, EMA, ATR (with a dynamic multiplier), ADX/DI, and an “AI‐style” scoring mechanism—to generate trend-filtered and reversal signals. It also optionally confirms signals on a higher timeframe, dynamically adjusts its sensitivity based on volatility, and plots intrabar stop‐loss (SL) and take‐profit (TP) levels derived from ATR. Special care has been taken to ensure that no signals “repaint” (i.e., once drawn on a closed bar, they never disappear or shift).
---
## 1. Main Inputs
All of the inputs appear in the Settings dialog for the published indicator. Below is a detailed explanation of each input, grouped by logical category.
### A. RSI & EMA Base Parameters
1. **RSI Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars used to calculate the Relative Strength Index (RSI). A shorter RSI reacts more quickly to price changes; a longer RSI is smoother.
2. **RSI Overbought Threshold**
* **Input type:** Integer (default 60)
* **Description:** If the RSI value rises above this level, it contributes a “sell” signal component. You can adjust this (e.g., 70) to make your system more conservative.
3. **RSI Oversold Threshold**
* **Input type:** Integer (default 40)
* **Description:** If the RSI falls below this level, it contributes a “buy” signal component. Raising this threshold (e.g., 50) makes the strategy more aggressive in seeking reversals.
4. **EMA Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** Number of bars for the Exponential Moving Average (EMA). A shorter EMA will produce more frequent crossovers, a longer EMA is smoother.
### B. ATR & Volatility Filter Parameters
5. **ATR Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars to calculate Average True Range (ATR). The ATR is used both for measuring volatility and for dynamic SL/TP levels.
6. **ATR SMA Length**
* **Input type:** Integer (default 50)
* **Description:** Number of bars to compute a Simple Moving Average of the ATR itself. This gives a baseline of “normal” volatility. If ATR rises significantly above this SMA, the indicator treats the market as “high volatility.”
7. **ATR Multiplier Base**
* **Input type:** Float (default 1.2, step 0.1)
* **Description:** Base multiplier for ATR when filtering for volatility. The actual threshold is computed as `ATR_SMA × (ATR_Multiplier Base) × sqrt(current_ATR / ATR_SMA)`. In other words, the multiplier becomes larger if volatility is rising, and smaller if volatility is falling.
8. **Disable Volatility Filter**
* **Input type:** Boolean (default false)
* **Description:** If enabled (true), the indicator will ignore any volatility‐based filtering, using signals regardless of ATR behavior. If disabled (false), signals only fire when ATR > (ATR\_SMA × dynamic multiplier).
### C. Price-Change & “AI Score” Parameters
9. **Price Change Period (bars)**
* **Input type:** Integer (default 3)
* **Description:** The number of bars back to measure percentage price change. Used to ensure that a “trend” signal is accompanied by a sufficiently positive (for longs) or negative (for shorts) price movement over this many bars.
10. **Base AI Score Threshold**
* **Input type:** Float (default 0.1)
* **Description:** The indicator computes a composite “AI-style” score by combining the RSI signal (overbought/oversold) and an EMA crossover signal. Only if the absolute value of that composite score exceeds this threshold will a trend signal be eligible. Raising it makes signals rarer but (potentially) higher-conviction.
### D. SMA “ICT” Trend Filter Parameters
11. **ICT SMA Long Length (Base)**
* **Input type:** Integer (default 50)
* **Description:** Number of bars for the “long” Simple Moving Average (SMA) used in the internal trend filter. Typically, price must be above this SMA (and ADX must be strong) to confirm an uptrend, or below it (and ADX strong) to confirm a downtrend.
12. **ICT SMA Short1 Length (Base)**
* **Input type:** Integer (default 10)
* **Description:** Secondary “fast” SMA used both for reversal logic (e.g., price crossing above it can count as a bullish reversal) and part of the internal trend confirmation.
13. **ICT SMA Short2 Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** A second “medium” SMA used for reversal triggers (e.g., crossovers or crossunders alongside RSI conditions).
### E. ADX & DI Parameters
14. **Base ADX Length**
* **Input type:** Integer (default 14)
* **Description:** Number of bars for the ADX (Average Directional Index) moving averages, which measure trend strength. The same length is used for +DI and –DI smoothing.
15. **Base ADX Threshold**
* **Input type:** Float (default 25.0, step 0.5)
* **Description:** If ADX > this threshold and +DI > –DI, we consider an uptrend; if ADX > this threshold and –DI > +DI, we consider a downtrend. Raising this value demands stronger trends to qualify.
### F. Sensitivity & Cooldown
16. **Sensitivity (0–1)**
* **Input type:** Float between 0.0 and 1.0 (default 0.5)
* **Description:** A general “mixture” parameter used internally to weight how aggressively the indicator leans into trend versus reversal. In practice, the code uses it to fine-tune exact thresholds for switching between trend and reversal conditions. You can leave it at 0.5 unless you want to bias more heavily toward either regime.
17. **Base Cooldown Bars Between Signals**
* **Input type:** Integer (default 5, min 0)
* **Description:** Once a long or short signal fires, the indicator will wait at least this many bars before allowing a new signal in the same direction. Prevents “signal flipping” on each bar. A higher number forces fewer, more spaced-out entries.
18. **Trend Confirmation Bars**
* **Input type:** Integer (default 3, min 1)
* **Description:** After the directional filters (+DI/–DI cross, price vs. SMA), the indicator still requires that price remains on the same side of the long SMA for at least this many consecutive bars before confirming “trend up” or “trend down.” Larger values smooth out false breakouts but may lag signals.
### G. Higher Timeframe Confirmation
19. **Use Higher Timeframe Confirmation**
* **Input type:** Boolean (default true)
* **Description:** If true, the indicator will request a block of values (SMA, +DI, –DI, ADX) from a higher timeframe (default 60 minutes) and require that the higher timeframe is also in agreement (strong uptrend or strong downtrend) before confirming your current-timeframe trend. This helps filter out lower-timeframe noise.
20. **Higher Timeframe (TF) for Confirmation**
* **Input type:** Timeframe (default “60”)
* **Description:** The chart timeframe (e.g., 5, 15, 60 minutes) whose trend conditions must also be true. It’s sent through a `request.security(..., lookahead=barmerge.lookahead_off)` call so that it never “paints ahead.”
### H. Dynamic TP/SL Parameters
21. **TP as ATR Multiple**
* **Input type:** Float (default 2.0, step 0.1)
* **Description:** When a trade is open, the “take-profit” price is determined by looking at the highest high (for longs) or lowest low (for shorts) observed since entry, and then plotting a cross (“X”) at that level when the trend finally flips. This is purely for display. However, separate from that, this parameter can be adapted if you want a strictly ATR–based TP. In the “Minimal” version, TP is ≈ (highest high) once trend inverts, but you could rewrite it to use `entry_price + ATR×TP_Multiplier`.
22. **SL as ATR Multiple**
* **Input type:** Float (default 1.0, step 0.1)
* **Description:** While in a trade, a trailing SL line is plotted each bar. Its value is always `entry_price ± (ATR × SL_Multiplier)`. When the trend inverts, the SL no longer updates, and you see it on the chart.
### I. Display and Mode Options
23. **Show Debug Lines**
* **Input type:** Boolean (default true)
* **Description:** When enabled, the indicator will plot all intermediate lines—ATR SMA, ATR Threshold, +DI, –DI, ADX (current and HTF), HTF SMA, etc.—so that you can diagnose exactly what’s happening. Turn this off to hide all debug information and only see entry/exit shapes.
24. **Enable Scalping Mode**
* **Input type:** Boolean (default false)
* **Description:** If true, many of the “base” parameters are halved (e.g., RSI length becomes 7 instead of 14, ATR length becomes 7 instead of 14, ADX length becomes 7, etc.), and the ADX threshold is multiplied by 0.8. This makes all oscillators and moving averages more reactive, suited for very short-term (scalping) setups.
---
## 2. Core Calculation Blocks
Below is a high-level description of each logical block (in code order), translated from Pine into conceptual steps.
### A. Adjust Inputs if “Scalping Mode” Is On
If **Scalping Mode** = true, then:
* `RSI_Length` becomes `max(1, round(Base_RSI_Length / 2))`
* `EMA_Length` becomes `max(1, round(Base_EMA_Length / 2))`
* `ATR_Length` becomes `max(1, round(Base_ATR_Length / 2))`
* `Price_Change_Period` becomes `max(1, round(Base_Price_Change_Period / 2))`
* `SMA_Long_Length`, `SMA_Short1_Length`, and `SMA_Short2_Length` are each halved (minimum 1).
* `ADX_Length` = `max(1, round(Base_ADX_Length / 2))`
* `ADX_Threshold` = `Base_ADX_Threshold × 0.8`
* `Cooldown_Bars` = `max(0, round(Base_Cooldown_Bars / 2))`
Otherwise, all adjusted lengths = their base values.
### B. RSI, EMA & “AI Score” on Current Timeframe
1. **Compute RSI:**
* Uses the (possibly adjusted) `RSI_Length`.
* Denote this as `RSI_Value`.
2. **Compute ATR & Its SMA:**
* `ATR_Value` = `ta.atr(ATR_Length)`.
* `ATR_SMA` = `ta.sma(ATR_Value, ATR_SMA_Length)`.
* Then define `Volatility_Increase` = (`ATR_Value > ATR_SMA`).
* If the volatility has increased, the weighting of RSI vs. EMA changes.
3. **Compute Weights:**
* If `Volatility_Increase == true`, then:
* `RSI_Weight = 0.7`
* `EMA_Weight = 0.3`
* Otherwise:
* `RSI_Weight = 0.3`
* `EMA_Weight = 0.7`
4. **RSI Signal Component (`RSI_Sig`):**
* If `RSI_Value > RSI_Overbought`, then `RSI_Sig = –1`.
* Else if `RSI_Value < RSI_Oversold`, then `RSI_Sig = +1`.
* Otherwise, `RSI_Sig = 0`.
5. **EMA Value & Signal Component (`EMA_Sig`):**
* `EMA_Value` = `ta.ema(close, EMA_Length)`.
* `EMA_Sig = +1` if the current close crosses **above** the EMA; `EMA_Sig = –1` if the current close crosses **below** the EMA; else `0`.
6. **Compute Raw “AI Score”:**
$$
Raw\_AI = (RSI\_Sig \times RSI\_Weight)\;+\;(EMA\_Sig \times EMA\_Weight)
$$
Then,
$$
AI\_Score = \frac{Raw\_AI}{(RSI\_Weight + EMA\_Weight)}
$$
(This normalization ensures the score always ranges between –1 and +1 if both weights sum to 1.)
### C. Dynamic ATR Multiplier & Volatility Filter
1. **Volatility Factor:**
$$
Volatility\_Factor = \frac{ATR\_Value}{ATR\_SMA}
$$
2. **Dynamic ATR Multiplier:**
$$
ATR\_Multiplier = ATR\_Multiplier\_Base \times \sqrt{Volatility\_Factor}
$$
3. **High Volatility Condition (`High_Volatility`):**
* If `Disable_Volatility_Filter == true`, then treat `High_Volatility = true` always.
* Else, `High_Volatility = (ATR_Value > ATR_SMA × ATR_Multiplier)`.
### D. Price Change Percentage
* **Compute Price Change:**
$$
Price\_Change = \frac{(Close - Close )}{Close } \times 100
$$
* This is the percent return from `Price_Change_Period` bars ago to now.
* For a valid long‐trend signal, we require `Price_Change > 0`; for a short trend, `Price_Change < 0`.
### E. Local SMAs for Trend/Reversal Filters
* `SMA_Close_Long` = `ta.sma(close, SMA_Long_Length)`.
* `SMA_Close_Short1` = `ta.sma(close, SMA_Short1_Length)`.
* `SMA_Close_Short2` = `ta.sma(close, SMA_Short2_Length)`.
These three SMAs help define the “local trend” and reversal breakout points:
* **Primary Trend Filter:**
* Price must be above `SMA_Close_Long` for an uptrend filter, or below `SMA_Close_Long` for a downtrend filter.
* **Reversal Filter:**
* A bullish reversal is detected if **(RSI < Oversold AND close crosses above EMA)** OR **(RSI < Oversold AND close crosses above SMA\_Close\_Short1)**.
* A bearish reversal is detected if **(RSI > Overbought AND close crosses below EMA)** OR **(RSI > Overbought AND close crosses below SMA\_Close\_Short1)**.
### F. Manual +DI, –DI & ADX on Current Timeframe
Instead of relying on the built-in `ta.adx`, the script calculates DI and ADX manually. This makes it easier to replicate the exact logic on a higher timeframe via `request.security`. The steps are:
1. **Directional Movement (DM) Components:**
* `Up_Move` = `high – high `
* `Down_Move` = `low – low`
* `Plus_DM` = `Up_Move` if (`Up_Move > Down_Move` AND `Up_Move > 0`), else `0`
* `Minus_DM` = `Down_Move` if (`Down_Move > Up_Move` AND `Down_Move > 0`), else `0`
2. **True Range (TR) Components:**
* `TR1` = `high – low`
* `TR2` = `abs(high – close )`
* `TR3` = `abs(low – close )`
* `True_Range` = `max(TR1, TR2, TR3)`
3. **Smoothed Averages (RMA):**
* `Sm_TR` = `ta.rma(True_Range, ADX_Length)`
* `Sm_Plus` = `ta.rma(Plus_DM, ADX_Length)`
* `Sm_Minus`= `ta.rma(Minus_DM, ADX_Length)`
4. **Compute DI%:**
$$
Plus\_DI = \frac{Sm\_Plus}{Sm\_TR} \times 100,\quad
Minus\_DI = \frac{Sm\_Minus}{Sm\_TR} \times 100
$$
5. **DX and ADX:**
$$
DX = \frac{|Plus\_DI - Minus\_DI|}{Plus\_DI + Minus\_DI} \times 100,\quad
ADX = ta.rma(DX, ADX_Length)
$$
These values are referred to as `(plus_di, minus_di, adx_val)` for the current timeframe.
---
## 3. Higher Timeframe (HTF) Confirmation Function
If **Use Higher Timeframe Confirmation** is enabled, the script calls a single helper (Pine) function `f_htf` with two parameters: the ADX length and the SMA length (both taken from the “base” or “scaled” values). Internally, `f_htf` simply reruns the manual DI/ADX logic (same as above) on the higher timeframe’s bar data, and also includes that timeframe’s closing price and its SMA for trend comparison.
* **Request.Security Call:**
```
= request.security(
syminfo.tickerid,
higher_tf,
f_htf(adx_length, sma_long_len),
lookahead=barmerge.lookahead_off
)
```
* `lookahead=barmerge.lookahead_off` ensures that no HTF value “paints” early; you always see only confirmed HTF bars.
* The returned tuple provides:
1. `ht_close` = HTF closing price
2. `ht_sma` = HTF SMA of length `sma_long_len`
3. `ht_pdi` = HTF +DI percentage
4. `ht_mdi` = HTF –DI percentage
5. `ht_adx` = HTF ADX value
---
## 4. Trend & Reversal Filters (Current & HTF)
### A. Current-Timeframe Trend Filter
1. **Uptrend\_Basic (Current TF)**
$$
(plus\_di > minus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close > SMA\_Close\_Long)
$$
2. **Downtrend\_Basic (Current TF)**
$$
(minus\_di > plus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close < SMA\_Close\_Long)
$$
3. **Trend Confirmation by Bars:**
* `Bars_Since_Below` = number of bars since `close <= SMA_Close_Long`.
* `Bars_Since_Above` = number of bars since `close >= SMA_Close_Long`.
* If `Uptrend_Basic == true` AND `Bars_Since_Below ≥ Trend_Confirmation_Bars` → mark `Uptrend_Confirm = true`.
* If `Downtrend_Basic == true` AND `Bars_Since_Above ≥ Trend_Confirmation_Bars` → mark `Downtrend_Confirm = true`.
### B. Reversal Filters (Current TF)
1. **Bullish Reversal (`Rev_Bullish`):**
* If `(RSI < RSI_Oversold AND close crosses above EMA_Value)` OR
`(RSI < RSI_Oversold AND close crosses above SMA_Close_Short1)`
→ then `Rev_Bullish = true`.
2. **Bearish Reversal (`Rev_Bearish`):**
* If `(RSI > RSI_Overbought AND close crosses below EMA_Value)` OR
`(RSI > RSI_Overbought AND close crosses below SMA_Close_Short1)`
→ then `Rev_Bearish = true`.
### C. Higher-Timeframe Trend Filter (HTF)
1. **HTF Uptrend (`HT_Uptrend`):**
$$
(ht\_pdi > ht\_mdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close > ht\_sma)
$$
2. **HTF Downtrend (`HT_Downtrend`):**
$$
(ht\_mdi > ht\_pdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close < ht\_sma)
$$
3. **Combine Current & HTF:**
* If **Use\_HTF\_Confirmation == true**, then:
* `Uptrend_Confirm := Uptrend_Confirm AND HT_Uptrend`
* `Downtrend_Confirm := Downtrend_Confirm AND HT_Downtrend`
* Otherwise, just use the current timeframe’s `Uptrend_Confirm` and `Downtrend_Confirm`.
4. **Define `CurrentTrend` (Integer):**
* `CurrentTrend = +1` if `Uptrend_Confirm == true`.
* `CurrentTrend = –1` if `Downtrend_Confirm == true`.
* Otherwise, `CurrentTrend = 0`.
5. **Reset “One Trade Per Trend”:**
* There is a persistent variable `LastTradeTrend`.
* Every time `CurrentTrend` flips (i.e., `CurrentTrend != CurrentTrend `), the code sets `LastTradeTrend := 0`.
* That allows one new entry once the detected trend has changed.
---
## 5. One‐Time “Cooldown” Logic
* **`LastSignalBar`**
* A persistent integer (initially undefined).
* After each confirmed long or short entry, `LastSignalBar` is set to the bar index where that signal fired.
* **`Bars_Since_Signal`**
* If `LastSignalBar` is undefined, treat as a very large number (so that initial signals are always allowed).
* Otherwise, `Bars_Since_Signal = bar_index – LastSignalBar`.
* **Cooldown Check:**
* A new long (or short) can only be generated if `(Bars_Since_Signal > Signal_Cooldown)`.
* This prevents multiple signals in rapid succession.
---
## 6. Entry Conditions (No Repaint)
All of the conditions below are calculated “intrabar,” but the script only actually registers a **signal** on **bar close** (`barstate.isconfirmed`) so that signals never repaint.
### A. Trend‐Based “Raw” Conditions
1. **Trend\_Long\_Raw:**
$$
(AI\_Score > AI\_Score\_Threshold)\;\land\;Uptrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change > 0)
$$
2. **Trend\_Short\_Raw:**
$$
(AI\_Score < -AI\_Score\_Threshold)\;\land\;Downtrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change < 0)
$$
### B. Reversal “Raw” Conditions
1. **Rev\_Long\_Raw:**
$$
Rev\_Bullish\;\land\;(CurrentTrend eq +1)
$$
2. **Rev\_Short\_Raw:**
$$
Rev\_Bearish\;\land\;(CurrentTrend eq -1)
$$
### C. Combine Raw Signals
* `Raw_Long = Trend_Long_Raw OR Rev_Long_Raw`.
* `Raw_Short = Trend_Short_Raw OR Rev_Short_Raw`.
### D. Confirmed Long/Short Signal Flags
On each new bar **close** (`barstate.isconfirmed == true`):
* **Long\_Signal\_Confirmed** can fire if:
1. `Raw_Long == true`
2. `LastTradeTrend != +1` (we haven’t already taken a long in this same trend)
3. `Bars_Since_Signal > Signal_Cooldown`
If all three hold, then on this bar close the code sets:
* `Long_Signal = true`
* `LastTradeTrend := +1`
* `LastSignalBar := bar_index`
Otherwise, `Long_Signal := false` on this bar.
* **Short\_Signal\_Confirmed** works the same way but with `Raw_Short`, `LastTradeTrend != -1`, etc.
If triggered, it sets `Short_Signal = true`, `LastTradeTrend := -1`, and `LastSignalBar := bar_index`. Otherwise `Short_Signal := false`.
* **Important:** If the bar is still forming (`else` branch of `barstate.isconfirmed`), then both `Long_Signal` and `Short_Signal` are forced to `false`. This guarantees that no shape or alert appears until the bar actually closes.
---
## 7. Plotting Entry/Exit Shapes
1. **Trend Long Signal (Triangle Up)**
* Condition: `Long_Signal == true` **AND** `Trend_Long_Raw == true`.
* Appearance: A small, semi-transparent lime green triangle drawn **below** the bar.
2. **Trend Short Signal (Triangle Down)**
* Condition: `Short_Signal == true` **AND** `Trend_Short_Raw == true`.
* Appearance: A small, semi-transparent maroon triangle drawn **above** the bar.
3. **Reversal Long Signal (Circle)**
* Condition: `Long_Signal == true` **AND** `Rev_Long_Raw == true`.
* Appearance: A tiny, more transparent green circle drawn **below** the bar.
4. **Reversal Short Signal (Circle)**
* Condition: `Short_Signal == true` **AND** `Rev_Short_Raw == true`.
* Appearance: A tiny, more transparent red circle drawn **above** the bar.
Since `Long_Signal` and `Short_Signal` only ever become true at bar close, these shapes are never repainted or removed once drawn.
---
## 8. Unified Alert Message
* As soon as a new bar closes with either `Long_Signal` or `Short_Signal == true`, an alert message is sent:
* If `Long_Signal`, then `alert_msg = "action=BUY"`.
* If `Short_Signal`, then `alert_msg = "action=SELL"`.
* If neither, `alert_msg = ""` (no alert).
* The code calls `alert(alert_msg, freq=alert.freq_once_per_bar)` only if `barstate.isconfirmed` and `alert_msg` is non‐empty. This ensures exactly one alert per confirmed bar, no intrabar pops.
---
## 9. Dynamic TP/SL Logic (Minimal Implementation)
Once a long or short position is “open,” the script tracks these variables:
1. **Persistent Flags and Prices** (all persist between bars until reset):
* `InLong` (Boolean)
* `InShort` (Boolean)
* `Long_Max` (Float)
* `Short_Min` (Float)
* `Entry_Price` (Float)
2. **On Bar Close:**
* If `Long_Signal == true` →
* Set `InLong := true`,
* `Entry_Price := close` of that bar,
* `Long_Max := high ` (last bar’s high, so that we’re not using “future” data).
* If `Short_Signal == true` →
* Set `InShort := true`,
* `Entry_Price := close`,
* `Short_Min := low `.
3. **While `InLong == true`:**
* Continuously update `Long_Max = max(Long_Max, current high)` on each bar (intrabar, but finalized each close).
* Compute a dynamic SL:
$$
SL_{Long} = Entry\_Price - (ATR \times SL\_ATR\_Multiplier).
$$
* If **current trend** flips to non-uptrend (`CurrentTrend != +1`), mark `ExitLong = true`.
* Then the routine plots `TP_Long = Long_Max` as a cross (“X”) at that level.
* Set `InLong := false` so that no further changes to `Long_Max` or `Entry_Price` happen on future bars.
4. **While `InShort == true`:**
* Continuously update `Short_Min = min(Short_Min, current low)`.
* Compute a dynamic SL:
$$
SL_{Short} = Entry\_Price + (ATR \times SL\_ATR\_Multiplier).
$$
* If trend flips to non-downtrend (`CurrentTrend != –1`), mark `ExitShort = true`.
* Then the routine plots `TP_Short = Short_Min`.
* Set `InShort := false` to freeze those values.
5. **Plotting TP/SL if “Show Debug” is On:**
* **TP Shapes:**
* When `ExitLong == true`, plot a solid lime “X” at `TP_Long` (highest high).
* When `ExitShort == true`, plot a solid maroon “X” at `TP_Short` (lowest low).
* **SL Lines:**
* If still `InLong`, draw a thin red line at `SL_Long` on each bar.
* If still `InShort`, draw a thin green line at `SL_Short`.
Thus, your charts visually show the highest‐high take-profit cross for longs, the lowest-low take-profit cross for shorts, and a continuously updating trailing SL until the trend flips. Because all of this is triggered on confirmed bars, nothing “jumps around” after the fact.
---
## 10. Debug‐Only Plot Lines (When Enabled)
When **Show Debug Lines** = true, the indicator will also plot:
1. **ATR SMA (Orange):**
* The simple moving average of ATR over `ATR_SMA_Length`.
2. **ATR Threshold (Yellow):**
* `ATR_SMA × ATR_Multiplier` (the dynamically scaled threshold).
3. **+DI & –DI (Current TF):**
* +DI plotted as a green line, –DI plotted as a red line (opacity \~70%).
4. **ADX (Current TF, Blue):**
* A blue line for the present timeframe’s ADX.
5. **ADX Threshold (Gray):**
* A horizontal gray line showing `ADX_Threshold`.
6. **+DI & –DI (HTF, Darker Colors):**
* If HTF confirmation is on, “HTF +DI” is a greener but more transparent line; “HTF –DI” is a redder but more transparent line.
7. **ADX (HTF, Blue but Transparent):**
* HTF ADX plotted in blue (high transparency).
8. **HTF SMA (Orange, Transparent):**
* The higher timeframe’s SMA (same length as `SMA_Long_Length`), drawn in fainter orange.
9. **Volatility Zone Fill (Yellow Tinted Area):**
* Fills the area between `ATR_SMA` and `ATR_SMA × ATR_Multiplier`.
* Indicates “normal” versus “high‐volatility” regimes.
These debug lines are purely visual aids. Disable them if you want a cleaner chart.
---
## 11. Putting It All Together — Step-By-Step Flow
1. **Read Inputs** (RSI lengths, EMA length, ATR settings, etc.).
2. **Optionally Halve All Lengths** if “Scalping Mode” is checked.
3. **Calculate Current TF Indicators:**
* RSI, ATR, ATR\_SMA, EMA, price change, various SMAs, DI/ADX.
4. **Compute “AI Score”** (weighted sum of RSI and EMA signals).
5. **Compute Dynamic ATR Multiplier** and decide if “High Volatility” is true.
6. **Compute Raw Trend/Reversal Conditions** on the current timeframe (without triggering yet).
7. **Fetch HTF Values** in one `request.security` call (SMAs, DI/ADX).
8. **Combine Current & HTF Trend Filters** to confirm `Uptrend_Confirm` or `Downtrend_Confirm`.
9. **Check Reversal Conditions** (price crossing EMA or SMA short, in overbought/oversold zones).
10. **Enforce “One Trade Per Trend”** (clear `LastTradeTrend` whenever `CurrentTrend` flips).
11. **Enforce Cooldown** (must wait at least `Signal_Cooldown` bars since the prior signal).
12. **On Bar Close:**
* If `Raw_Long` AND not already in a long trend AND cooldown met, then fire `Long_Signal`.
* Else if `Raw_Short` AND not already in a short trend AND cooldown met, then fire `Short_Signal`.
* Otherwise, no new signal on this bar.
13. **Plot Long/Short Entry Shapes** according to whether it was a Trend signal or a Reversal signal.
14. **Send Alert** (“action=BUY” or “action=SELL”) exactly once per confirmed bar.
15. **If New Long/Short Signal, Set `InLong`/`InShort`, Record Entry Price, Initialize `Long_Max`/`Short_Min`.**
16. **While `InLong` is true:** Update `Long_Max = max(previous Long_Max, current high)`. Compute `SL_Long`. If the current trend flips (no longer uptrend), set `ExitLong = true`, plot a “TP X,” and close the position logic.
17. **While `InShort` is true:** Similarly update `Short_Min`, compute `SL_Short`, and if trend flips, set `ExitShort = true`, plot a “TP X,” and close the position logic.
18. **Optionally Display Debug Lines** (ATR SMA, ATR threshold, DI/ADX, HTF DI/ADX, etc.).
---
## 12. How to Use in TradingView Community
When you publish this indicator to the TradingView community—choosing “Protected” or “Invite-only” visibility—you can paste the above description into the “Description” field. Users will see exactly what each input does, how signals are generated, and what the various plotted lines represent, **without ever seeing the script source**. In this way, the code itself remains hidden but the logic is fully documented.
1. **Go to “Create New Indicator”** on TradingView.
2. **Paste Your Pine Code** (the full indicator script) in the Pine editor and save it.
3. **Set Visibility = Protected** (or Invite-only).
4. **In the “Description” Text Box, paste the entirety of this document** (steps 1–11).
5. **Click “Publish Script.”**
Users who view your indicator will see its name (“AI Strat Adaptive v3 (NoRepaint)”), a list of all inputs (with default values), and the detailed English description above. They can then load it on any chart, adjust inputs, and see the plotted signals, TP/SL lines, and optional debug overlays—without accessing the underlying Pine code.
---
### Summary of Key Points
* **RSI, EMA, ATR, DI/ADX, and “AI Score”** work together to define “trend vs. reversal.”
* **Dynamic volatility filter** uses ATR and ATR\_SMA to adapt the weighting of RSI vs. EMA and decide whether “volatility is high enough” to permit a trend trade.
* **One trade per detected trend** and a **cooldown period** prevent over‐trading.
* **Higher timeframe confirmation** (optional) further filters out noise.
* **No-repaint logic**:
* All signals only appear at bar close (`barstate.isconfirmed`).
* HTF values are fetched with `lookahead=barmerge.lookahead_off`.
* **Entry shapes** (triangles and circles) clearly mark trend vs. reversal entries.
* **Dynamic TP/SL**: highest‐high (or lowest‐low) since entry is used as TP, ATR×multiplier as SL.
* **Debug mode** (optional) shows every intermediate line for full transparency.
Use this description verbatim (or adapt it slightly for your personal style) when publishing. That way, your community sees exactly how each component works—inputs, functions, filters—while the Pine source code remains private.
RSI TrendSignal🔍 **Smart RSI System – Free & Open Source**
A powerful RSI-based indicator designed for traders who want clarity, simplicity, and filtered signals that *actually mean something*.
---
### 🎯 Key Features:
✅ Classic RSI with custom smoothing
✅ Optional Bollinger Bands over RSI
✅ Built-in Divergence Detection (Regular Bullish/Bearish)
✅ Dynamic Buy/Sell Conditions based on RSI + MA cross
✅ STAR signals for high-conviction entries (Overbought/Oversold + strength filter)
✅ ATR-based strength filter and custom visualizations
✅ Works great on **crypto**, **forex**, or **indices**
✅ Fully open-source and beginner-friendly!
---
### 📊 Recommended Timeframes:
15min, 1H, 4H, Daily – test and adjust settings for your style.
---
### ⚙️ How to Use:
1. Watch for **Buy/Sell** shapes when RSI confirms crossover with smoothed MA.
2. **STAR signals** are stronger – when RSI is above 70 or below 30 with momentum separation.
3. Divergences (optional) can confirm reversals.
4. Use ATR plot or your own trailing stop logic for exit strategy.
---
🔔 Alerts are built-in and ready to use.
📌 You can connect them to bots, webhooks, or Telegram (see alert templates in the script).
---
🧠 **Built by a trader, for traders.**
Use this as a base and build your own version – or just trade it as is.
---
---
💬 **Feedback / Questions / Want to talk?**
Feel free to message me on Telegram:
👉 (t.me/Ario_pinescript_pogramer)
This is a clean version of RSI TrendSignal with improved alerts.
It uses RSI cross with a smoothed moving average to generate filtered buy/sell signals.
No external links or bots. Fully compliant with TradingView rules.
📺 Demo & Tutorial coming soon on my YouTube channel – stay tuned
Babil34 VOLXBabil34 VOL is a custom volume indicator designed to measure how trading volume impacts price movement. Rather than displaying raw volume, it evaluates volume-powered price momentum by combining volume strength with price range.
It automatically selects an appropriate period based on the chart timeframe: Monthly (18), Weekly (30), Daily (21), Others (14).
It calculates how strong current volume is compared to recent history.
This volume power is multiplied by the bar’s price range (high - low), producing a dynamic score.
The score is normalized between 0 and 100 based on recent min-max values.
Red: Score below 45 → Strong selling volume, downside pressur
Blue: Score between 45–65 → Neutral, indecisive, or low-impact volume
Green: Score above 65 → Strong buying volume, upward pressure
Babil34 VOL filters out noise by focusing on how volume truly affects price – helping traders detect meaningful volume shifts more reliably than traditional volume bars.
Average True Ranges with IBD RSThis indicator combines multiple ATR readings with a custom IBD Relative Strength (RS) formula to help you assess both volatility and price leadership in one view.
Visualize standard and 1.5× ATR to gauge volatility zones.
Track IBD RS (based on multi-timeframe price performance) to spot strong or weak stocks.
Choose your preferred smoothing method (RMA, SMA, EMA, WMA) for personalized analysis.
Perfect for traders looking to blend volatility awareness with relative strength momentum.
Color Bar Based on Closing Range, ATR, and VolumeTight Closes with Volume Highlight is a bar coloring script that helps you spot price consolidation and potential breakout zones. It highlights bars with two key conditions:
Tight Closing Ranges based on ATR to detect compression.
Volume and Price Strength using dynamic volume comparisons to flag accumulation or interest.
Customize the bar colors to suit your chart style and use this tool to visually scan for high-potential setups with less effort.
Valentine_scriptThe Valentine_script overlays five customizable moving averages (MA) directly on your chart. Choose between SMA and EMA for each MA, and set your preferred lengths to fit your strategy. This tool provides a clean and flexible way to analyze trend direction and momentum across multiple timeframes—all in one view.
ORB2The "ORB2" Indicator (Opening Range Breakout 2) is designed to identify the key price range at the beginning of the trading day—commonly referred to as the opening range. Its main purpose is to help traders detect potential breakout points from this range, which are often used as signals for trade entries.
📌 Purpose
The indicator visually marks the highest (high) and lowest (low) price within a defined time interval at the start of the session (e.g., from 09:15 to 09:20). These values form what’s known as the opening range, which is often considered a consolidation zone before the market chooses a direction.
⚙️ How It Works
Time Setup:
The user defines the time window during which the opening range is monitored (default: 09:15–09:20).
The high and low values are tracked within this interval.
Session Detection:
When the defined session begins (is_first), the indicator records the current high and low as the initial ORB levels.
Range Updating:
During the session, if a new candle has a higher high or a lower low than the previously recorded ORB range, the indicator updates the levels accordingly.
Visualization:
The ORB zone is displayed as a shaded area (a blue fill between a green upper line and a red lower line)—but only when applied to intra-day charts with a time interval less than or equal to the specified inputMax (e.g., 5 minutes).
🎯 Purpose and Benefits
Quick breakout detection – Helps traders easily identify when price breaks out of the initial consolidation.
Clear visualization – Highlights the high/low boundaries and range area, making breakout strategies more effective.
Customizability – The user can adjust the session time and the maximum allowed chart resolution for display.
Innotrade Multi-TF SMMA + VWAP Price ActionWelcome to the Innotrade Price Action Concept, a comprehensive indicator designed to demystify market movements and empower your trading decisions. This script integrates multiple powerful analytical tools into a single, cohesive framework, focusing on how price behaves in relation to key levels, volume, and specific candlestick formations. It's built to help you "read the story" the market is telling.
What is the Innotrade Price Action Concept? (In Simple Terms):
Think of the market as a dynamic environment where buyers and sellers are constantly interacting. The Innotrade Price Action Concept aims to interpret these interactions by observing:
The Overall Trend: Are buyers or sellers generally in control?
Specific Price Behaviors: Are there strong, decisive moves, or signs of hesitation and potential reversals?
Volume Clues: Is there conviction behind the price movements? Are big players involved?
Key "Fair Value" Areas: Where has the market established important price zones?
Contextual Signals: Are there specific patterns forming under particular market conditions that offer an edge?
This script provides the tools to analyze these aspects, all working together.
Core Pillars of the Innotrade Price Action Concept (Features Explained):
Pillar 1: Trend & Market Structure (Smoothed Moving Averages - SMMAs & Clouds)
Innotrade SMMAs (SMMA 1 & SMMA 2):
These are your primary guides for understanding trend direction and dynamic support/resistance.
SMMA 1 (default 9-period, green/red) is the faster-reacting average, showing short-term sentiment.
SMMA 2 (default 21-period, lime/maroon) is the slower average, indicating the more established trend.
The Story: When SMMA 1 is above SMMA 2 and both are angling up, buyers are generally in control (uptrend). The opposite suggests a downtrend.
Innotrade SMMA Clouds:
These shaded areas around each SMMA represent zones of volatility and potential support/resistance.
The Story: Price interacting with these clouds can signal bounces or breakthroughs. A widening cloud might indicate increasing volatility.
Pillar 2: Candlestick Storytelling (Bar Pattern Recognition)
The Innotrade Concept emphasizes that individual candles and short sequences tell a story. This script automatically highlights key "chapters":
Elephant Bars (Momentum): Very large candles signaling strong conviction. (Bullish: Green, Bearish: Red)
The Story: A strong push in one direction.
Tail Bars (Indecision/Reversal): Small bodies, long wicks (pin bars). (Bullish: Lime, Bearish: Maroon)
The Story: Price was rejected at a certain level, hinting at a potential shift.
180 Bars (Strong Reversal): An Elephant Bar quickly and strongly reversed. (Bullish: Blue, Bearish: Purple)
The Story: A sudden, powerful change in sentiment.
RBI (Red Bar Ignored / Potential Continuation Down): A bearish candle after two bullish ones. (Teal)
The Story: Buyers tried, but sellers overwhelmed them, possibly continuing the downtrend.
GBI (Green Bar Ignored / Potential Continuation Up): A bullish candle after two bearish ones. (Orange)
The Story: Sellers tried, but buyers stepped in, possibly continuing the uptrend.
Pillar 3: Volume Intelligence (PVSRA Candle Coloring)
Price action is more reliable when confirmed by volume. PVSRA (Price Volume Spread Range Analysis) helps:
If enabled, candles are colored based on their range, closing position, and volume.
The Story: Helps spot if "smart money" or significant interest is behind a move. (Special Vector Colors: Red, Green, Violet, Blue highlight these moments).
Pillar 4: Fair Value & Key Levels (Innotrade Multi-Timeframe VWAP)
Innotrade VWAP (Volume Weighted Average Price):
This isn't just any average; it's the average price weighted by how much volume was traded at each price level. It's a key reference for institutional traders.
The script plots VWAP for multiple timeframes (Daily, Weekly, Monthly, Quarterly, Yearly).
The Story: VWAP levels often act as magnets for price, or as dynamic support/resistance. Trading above the Daily VWAP can be seen as bullish for the day, and below as bearish.
VWAP Standard Deviation Bands:
Optional bands around a selected VWAP show common deviations from the "fair value."
The Story: Extreme deviations might signal overextension and a potential pullback towards the VWAP.
Previous Period VWAP Levels:
Yesterday's (or last week's, etc.) VWAP can be a powerful psychological level.
Pillar 5: Contextual Signals (GBI/RBI Text Labels)
This adds a specific layer to the Innotrade Concept:
"GBI" Text: Appears under a GBI candle pattern only if the price is currently below SMMA 1.
The Story: A bullish GBI pattern is forming, but it's fighting against short-term bearish pressure (below SMMA 1). If it succeeds, the move could be stronger.
"RBI" Text: Appears under an RBI candle pattern only if the price is currently above SMMA 1.
The Story: A bearish RBI pattern is forming, but it's fighting against short-term bullish pressure (above SMMA 1). If it succeeds, the move down could be more significant.
How to Apply the Innotrade Price Action Concept (The Strategy):
The core of the Innotrade Price Action Concept is CONFLUENCE – waiting for multiple signals from the pillars above to align.
Step 1: Understand the Dominant Trend & Market Structure.
Are SMMAs trending up or down? Is SMMA 1 above/below SMMA 2?
Where is price relative to the key Innotrade VWAP levels (e.g., Daily, Weekly VWAP)?
Is price inside or breaking out of an SMMA Cloud?
Step 2: Look for Candlestick Stories at Key Areas.
As price approaches an SMMA, a VWAP level, or a cloud edge, watch for the formation of Elephant Bars, Tail Bars, or 180 Bars.
Does a PVSRA "vector" candle appear, confirming volume interest at this level?
Step 3: Identify GBI/RBI Setups for Specific Context.
If a GBI pattern forms below SMMA 1, and you see the "GBI" text, this could be an early sign of buyers attempting to overcome short-term resistance. Look for follow-through.
If an RBI pattern forms above SMMA 1, and you see the "RBI" text, this could be an early sign of sellers attempting to break short-term support. Look for follow-through.
Step 4: Seek Confirmation and Manage Risk.
High Probability Setups: The strongest signals occur when:
A bullish bar pattern (e.g., Bullish Elephant, Bullish Tail, GBI text) forms near support (SMMA, VWAP, Cloud bottom) within an established uptrend.
A bearish bar pattern (e.g., Bearish Elephant, Bearish Tail, RBI text) forms near resistance (SMMA, VWAP, Cloud top) within an established downtrend.
PVSRA volume confirms the move.
Example Trade Idea (Bullish):
Price is above SMMA 2 and SMMA 1 (uptrend).
Price pulls back to touch SMMA 1 or the Daily VWAP.
A Bullish Tail Bar or Bullish Elephant Bar forms, OR a GBI pattern with "GBI" text appears.
A green/blue PVSRA candle confirms buying interest.
This confluence of signals suggests a potential entry.
Always use appropriate stop-loss orders and manage your risk.
Customization:
The Innotrade Price Action Concept is adaptable. You can:
Adjust SMMA lengths.
Customize all colors to your preference.
Toggle on/off VWAPs, Clouds, and PVSRA coloring.
Fine-tune bar pattern parameters.
Enable/disable GBI/RBI text and alerts.
Disclaimer:
The Innotrade Price Action Concept and this script are for educational and informational purposes.
This is NOT financial advice. Trading involves significant risk.
Past performance does not guarantee future results.
Always test thoroughly and combine with your own judgment and risk management.
Acknowledgements:
This script embodies the "Innotrade Price Action Concept," bringing together established analytical techniques into a unified framework for market analysis.
CTS : Clear Trend and Swing Signal Alert by TonyAlgo📌 CTS: Clear Trend and Swing Signal Alert
by TonyAlgo
CTS (Clear Trend and Swing Signal) is a powerful trend-following tool designed to help traders identify high-probability swing setups in the direction of the prevailing market trend. This indicator simplifies price action and trend analysis into clear alerts, empowering traders with actionable decisions across multiple timeframes.
🔍 Core Features:
🔄 Swing Detection: Automatically labels Higher Lows (HL) and Lower Highs (LH) using customizable pivot settings.
📈 Trend Analysis: Confirms trend direction using slow swing structure (HH/HL = Uptrend, LH/LL = Downtrend).
⚡ Signal Alerts: Alerts for Bullish Continuation (BUY) and Bearish Continuation (SELL) based on recent swing and trend alignment.
📊 Volume, RSI, ADX Filters: Optional filters to improve signal quality and reduce noise.
🧠 Dashboard: Clean and readable on-chart panel showing real-time trend, swing class, RSI, ADX, and ADR info.
🎯 Custom Alert Options: Enable or disable individual filters like Trend, Volume, ADX, and alert types (HL or LH) for flexible control.
✅ Best Use Cases:
Identifying trend continuation setups after pullbacks.
Confirming directional bias in swing and intraday strategies.
Filtering out weak signals using built-in momentum and volume confirmation.
⚙️ How to Use:
Load the indicator on your preferred chart and timeframe (works well on H1 and H4).
Customize pivot lengths and filter options to suit your strategy.
Enable TradingView alerts for real-time BUY/SELL signals based on the logic you prefer.
🔔 Sample Alert Message:
CTSAlert -> BUY UPTREND HL on H1 @EURUSD price: 1.0865
CTSAlert -> SELL DOWNTREND LH on H1 @EURUSD price: 1.0866
Percent Change of Range Candles📌 Indicator Description: "Percent Change of Range Candles"
This indicator is designed to visualize the percentage price change over a specified number of candles, relative to the historical market range. Instead of traditional candles, it uses a custom "range candle" visualization that reflects relative changes in context with the highest and lowest points within a given period.
🎯 Purpose and Application
The goal of this indicator is to:
Show how much the current price has changed compared to the price length candles ago (default: 100).
Express this change as a percentage of the total price range during that period.
Help traders identify extreme price movements, whether bullish or bearish.
Serve as an additional filter for momentum zones, divergences, or overextended conditions.
⚙️ How It Works
🔹 Core Calculation:
Range: The difference between the highest and lowest price over the selected period (length).
Price Change: The difference between the current close and the close length bars ago.
Percentage Value: (price_change / range) * 100
🔹 Additional Logic:
The synthetic open value is calculated as the average of the last 5 c values.
The high and low of each range candle are adjusted:
If c is negative, the high is replaced with a shorter-term percentage change (25% of length).
If c is positive, the low is adjusted in the same way.
🔹 Visualization:
Displays custom candles based on percentage change, not real price.
Candle color is green if the current value is above the recent average, and red if below.
Horizontal reference lines are drawn at +100, +70, 0, -70, and -100, helping to identify extremes.
✅ Advantages and Use Cases
Detects market extremes and potential reversal zones.
Useful in volatility or momentum-based strategies.
Can serve as a signal filter or divergence detector when combined with other tools (e.g., RSI, MACD).
EU Session Only StrategyThe name of the strategy is the EU session only, but you choose which time is important for you to follow, it can also be the beginning of the US session, a few hours after the news (2 hours after the US open level) or based on the daily open level.
📌 Indicator Description: "EU Session Only Strategy"
This TradingView indicator, written in Pine Script version 6, represents a simple yet effective intraday trading strategy focused exclusively on the European trading session.
🎯 Purpose and Use
The goal of this strategy is to:
Automatically identify the European session open price for the current trading day.
Trade only during a defined intraday time window (e.g., between 08:00 and 18:00 UTC).
Enter a trade only if the price moves a certain distance (in pips) away from the EU open level.
Limit the number of trades per day to avoid overtrading.
Automatically close all open positions at the end of the day to minimize overnight risk.
⚙️ How It Works
🔹 1. EU Open Level
When the European session opens (e.g., 09:00 UTC), the strategy records the opening price at that moment (eu_open_price).
This level is displayed as a red horizontal line on the chart.
🔹 2. Entry Conditions
The strategy checks if the current price:
Is above the EU open level by at least a defined number of pips → Buy signal.
Is below the EU open level by at least a defined number of pips → Sell signal.
Trading is allowed only within the specified time range (e.g., 08:00 to 18:00 UTC).
A maximum number of trades per day is enforced (e.g., 2 trades max).
🔹 3. Exit Conditions
If an opposite signal appears during the day, the strategy automatically closes the current position.
At the start of each new day, all open positions are closed, regardless of direction or profit.
✅ Advantages
A clear and efficient system based on price reaction around a key daily level.
Suitable for automated backtesting and optimization on TradingView.
Reduces risk with daily trade limits and end-of-day auto-closing.
Ideal for forex pairs that show volatility during the European session (e.g.,GOLD, EUR/USD, GBP/USD, etc.).
EU & US Current Day Only📌 Purpose of the Indicator
The purpose of this indicator is:
To automatically detect and mark the opening prices of the European and U.S. trading sessions for each day.
To generate buy/sell trading signals only when specific intraday conditions are met.
To limit the number of trades per day and ensure that all trades are closed by the end of the day.
To enable intraday trading within a defined time window and with confirmed price action.
⚙️ How the Indicator Works
1. User Inputs
The user defines the following parameters:
Opening hour for the EU and US sessions (UTC).
Maximum number of trades per day (e.g., 2).
Minimum distance in pips the price must move from the session open levels to confirm a signal.
Trading hours (start and end).
Time zone.
2. Tracking Session Open Prices
At the start of each new day, the indicator:
Detects the exact moment when the EU and US sessions open (e.g., 9:00 UTC for EU).
Records the opening prices of these sessions (eu_open_price and us_open_price).
These levels are then plotted as horizontal lines on the chart:
Red line = EU Open
Black line = US Open
3. Trading Signals
The strategy will only trigger a trade if the following conditions are met:
Trading is happening within the defined hours (start_hour to end_hour).
Both session open levels (EU & US) are defined for the current day.
The current price is:
Above both levels by a defined pip distance → Buy signal.
Below both levels by a defined pip distance → Sell signal.
The strategy has not yet reached the maximum number of trades for the day.
Example logic:
If price moves more than 20 pips above both EU and US open levels → enter a long position.
If price drops more than 20 pips below both levels → enter a short position.
4. Exiting Positions
If the opposite signal appears while a position is open:
The strategy will automatically close the current position.
Additionally, at the start of a new day, any open positions are forcefully closed:
pinescript
Копирај
Измени
strategy.close_all(comment="Close EOD")
This ensures that the strategy remains purely intraday and avoids overnight risk.
✅ Advantages
Clear identification of daily session levels (EU/US open).
Filters out weak signals using minimum pip distance.
Limits the number of trades per day – avoids overtrading.
Automatically closes trades at the end of the day – reduces risk.
🔚 Conclusion
This indicator is especially useful for intraday traders who base their entries on how price behaves around the EU and US session open levels. The strategy is clean, rule-based, and suitable for automated backtesting, optimization, and real-time trading—especially for currency pairs with high volatility during the European and American sessions.
S/R-AA+++++++AAThe “S/R-AA+++++++AA” indicator is an advanced technical analysis tool that automatically identifies and plots key Support and Resistance (S/R) levels based on a combination of RSI, CMO, and pivot points. It is designed for traders who need clear visual signals of important price zones on the chart.
🔧 How It Works:
The indicator uses the following logic to detect support and resistance:
RSI (Relative Strength Index) – Utilized in both standard and legacy forms to detect extreme conditions (below 25 for support, above 75 for resistance).
CMO (Chande Momentum Oscillator) – Based on HMA (Hull Moving Average), this acts as a momentum confirmation filter.
Pivot Points – Short-term (2-bar) pivots are used to identify local highs and lows for precise S/R plotting.
🧠 Detection Logic:
A Support Zone is marked when RSI is low (< 25), CMO is strongly positive (> 50), and a local low is detected.
A Resistance Zone appears when RSI is high (> 75), CMO is strongly negative (< -50), and a local high is formed.
📈 Visual Output:
The indicator automatically draws horizontal lines:
Blue Line = Support
Red Line = Resistance
Lines are displayed on the selected timeframe (S/R Timeframe) and shown directly on the chart as an overlay.
🔔 Extra Features:
Alert Support: Allows users to set alerts when a new support or resistance level is formed.
Customizable line thickness and colors for improved visibility and clarity.
🎯 Purpose of the Indicator:
The purpose of this indicator is to automatically identify high-probability price reversal zones, helping traders better plan their entries, exits, stop-loss, and take-profit levels.
Advanced VW SMI w/ Divergence, Confirmations & TableVolume-Weighted SMI with Dynamic Divergence and Confirmation
Description:
This advanced indicator combines the Stochastic Momentum Index (SMI) with volume weighting, dynamic overbought/oversold bands, and robust divergence detection to help you spot true momentum reversals confirmed by volume, trend, and momentum.
Features
Volume-Weighted SMI
The SMI is amplified or dampened based on normalized volume, filtering out low-interest price moves and highlighting those with real conviction.
Dynamic OB/OS Bands
Overbought and oversold levels adapt automatically to current volatility and trend using moving average and standard deviation bands, keeping signals relevant across all market regimes.
Divergence Detection with Visuals
Real-time bullish and bearish divergence signals are drawn right on the SMI line, including lines and labels, making reversal setups easy to spot.
Triple Confirmation
Divergence signals are filtered by:
Volume surge (user adjustable)
RSI extremes (oversold/overbought)
Higher timeframe trend (optional EMA filter)
Customizable Volume Weighting
Adjust how much influence volume has on SMI signals—tune sensitivity to your market and style.
Performance Table
Track bullish/bearish divergence counts in real time.
How to Use
Add to your chart.
(Move to a separate pane for best results.)
Adjust settings to fit your market (lengths, volume power, trend filter, etc.).
Watch for colored SMI moves outside dynamic bands for momentum extremes.
Look for divergences marked by arrows, lines, and labels on the SMI.
Use table count for an overview of signal frequency.
Tips
Works on all timeframes; try adjusting dynamic band length for higher timeframes.
For scalping, lower the SMI and pivot lengths.
For swing trading, enable trend and volume confirmations for higher confidence.
Use with other price action signals for best results.
Created with Pine Script v5.
If you find this helpful, please give it a like or comment!
Dear Traders SwingX Score v1🎯 Dear Traders SwingX Score
A powerful swing trading indicator that combines momentum, trend strength, and volume analysis to identify high-probability trading opportunities.
🔍 Key Features:
Multi-factor Scoring System (1-5 for bullish, -1 to -5 for bearish)
Volume Confirmation (with MA filter for stronger signals)
Trend Strength Analysis (proprietary ADX calculation)
Momentum Detection (custom RSI thresholds)
Clear Visual Signals (color-coded labels above/below bars)
💡 How It Works:
The indicator evaluates:
Trend strength using a modified ADX formula
Momentum conditions through specialized RSI thresholds
Volume confirmation with moving average filter
Combines these factors into an easy-to-read scoring system
🚦 Signal Interpretation:
Positive Scores (1-5): Bullish opportunities (higher numbers = stronger signal)
Negative Scores (-1 to -5): Bearish opportunities
"*" Symbol: Volume-confirmed (stronger validity)
Neutral (0): Market in balance
⚙️ Customizable Settings:
Adjustable ADX length and threshold
Configurable RSI period
Volume MA length for confirmation filter
📈 Best Used For:
Swing trading and Holding Decision
Confirming other strategy signals
Identifying trend reversals early
Filtering high-probability entries
Note: This is a standalone indicator but works exceptionally well when combined with price action analysis and proper risk management.
Polynomial Deviation BandsThis indicator applies polynomial regression of selectable degree (1st to 4th) to recent price data, fitting a smooth curve that models the underlying price trend more flexibly than linear regression.
Around this polynomial regression line, it plots dynamic deviation bands calculated using a variety of selectable methods—including standard deviation, mean/median absolute deviation, exponential deviation, true range deviation, Hull, Frama, Kaufman adaptive, Gaussian weighted, and quantile deviation—providing a comprehensive view of price volatility and dispersion.
Key Features:
Polynomial regression fit updated on each bar, capturing nonlinear price trends.
Multiple deviation calculation options allow customization of band sensitivity and robustness.
Bands adjust dynamically to changing volatility and price behavior.
Overlay on price chart with optional candle coloring based on trend signals derived from price relative to bands.
Trend signals indicated by price crossing upper or lower bands.
Useful for identifying trend direction, potential support/resistance, and volatility expansion/contraction.
This tool combines advanced statistical modeling with flexible volatility measures to help traders better understand price structure and make informed trading decisions.
The indicator is computationally efficient despite polynomial fitting and offers extensive customization for diverse trading styles and markets.
Disclaimer
Disclaimer: This indicator is provided for educational and informational purposes only and does not constitute investment advice. Trading involves risk and may result in financial loss. Always perform your own research and consult with a qualified financial advisor before making any trading decisions.
Zero Lag Trend Strategy (MTF) [AlgoAlpha]# Zero Lag Trend Strategy (MTF) - Complete Guide
## Overview
The Zero Lag Trend Strategy is a sophisticated trading system that combines zero-lag exponential moving averages with volatility bands and EMA-based entry/exit filtering. This strategy is designed to capture trending movements while minimizing false signals through multiple confirmation layers.
## Core Components
### 1. Zero Lag EMA (ZLEMA)
- **Purpose**: Primary trend identification with reduced lag
- **Calculation**: Uses a modified EMA that compensates for inherent lag by incorporating price momentum
- **Formula**: `EMA(price + (price - price ), length)` where lag = (length-1)/2
- **Default Length**: 70 periods (adjustable)
### 2. Volatility Bands
- **Purpose**: Define trend strength and entry/exit zones
- **Calculation**: Based on ATR (Average True Range) multiplied by a user-defined multiplier
- **Upper Band**: ZLEMA + (ATR * multiplier)
- **Lower Band**: ZLEMA - (ATR * multiplier)
- **Default Multiplier**: 1.2 (adjustable)
### 3. EMA Filter/Exit System
- **Purpose**: Entry filtering and exit signal generation
- **Default Length**: 9 periods (fully customizable)
- **Color**: Blue line on chart
- **Function**: Prevents counter-trend entries and provides clean exit signals
## Entry Logic
### Long Entry Conditions
1. **Primary Signal**: Price crosses above the upper volatility band (strong bullish momentum)
2. **Additional Entries**: Price crosses above ZLEMA while already in an uptrend (if enabled)
3. **EMA Filter**: Price must be above the EMA filter line
4. **Confirmation**: All conditions must align simultaneously
### Short Entry Conditions
1. **Primary Signal**: Price crosses below the lower volatility band (strong bearish momentum)
2. **Additional Entries**: Price crosses below ZLEMA while already in a downtrend (if enabled)
3. **EMA Filter**: Price must be below the EMA filter line
4. **Confirmation**: All conditions must align simultaneously
## Exit Logic
**Simple and Clean**: Positions are closed when price crosses the EMA filter line in the opposite direction:
- **Long Exit**: Price crosses below the EMA filter
- **Short Exit**: Price crosses above the EMA filter
## Multi-Timeframe Analysis
The strategy includes a real-time table showing trend direction across 5 different timeframes:
- Default timeframes: 5m, 15m, 1h, 4h, 1D (all customizable)
- Color-coded signals: Green for bullish, Red for bearish
- Helps confirm overall market direction before taking trades
## Key Parameters
### Main Calculations
- **Length (70)**: Zero-lag EMA calculation period
- **Band Multiplier (1.2)**: Controls volatility band width
### Strategy Settings
- **Enable Additional Trend Entries**: Allow multiple entries during strong trends
- **EMA Exit Length (9)**: Period for the entry filter and exit EMA
### Timeframes
- **5 customizable timeframes** for multi-timeframe trend analysis
### Appearance
- **Bullish Color**: Default green (#00ffbb)
- **Bearish Color**: Default red (#ff1100)
## Visual Elements
### Chart Display
- **ZLEMA Line**: Color-coded trend line (green/red based on trend direction)
- **Volatility Bands**: Dynamic upper/lower bands that appear based on trend
- **EMA Filter**: Blue line for entry filtering and exits
- **Entry Signals**:
- Large arrows (▲▼) for primary trend signals
- Small arrows for additional trend entries
- Tiny letters (L/S) for actual strategy entries
### Information Table
- **Position**: Top-right corner
- **Content**: Real-time trend status across all configured timeframes
- **Updates**: Continuously updated with current market conditions
## Strategy Advantages
### Trend Following Excellence
- Captures strong trending moves with reduced whipsaws
- Multiple confirmation layers prevent false entries
- Dynamic bands adapt to market volatility
### Risk Management
- Clear, objective exit rules
- EMA filter prevents counter-trend trades
- Multi-timeframe confirmation reduces bad trades
### Flexibility
- Fully customizable parameters
- Works across different timeframes and instruments
- Optional additional trend entries for maximum profit potential
### Visual Clarity
- Clean, professional chart display
- Easy-to-read signals and trends
- Comprehensive multi-timeframe overview
## Best Practices
### Parameter Optimization
- **Length**: Higher values (50-100) for longer-term trends, lower values (20-50) for shorter-term
- **Band Multiplier**: Higher values (1.5-2.0) reduce signals but increase quality
- **EMA Length**: Shorter periods (5-13) for quick exits, longer periods (20-50) for trend riding
### Market Conditions
- **Trending Markets**: Enable additional trend entries for maximum profit
- **Choppy Markets**: Use higher band multiplier and longer EMA for fewer, higher-quality signals
- **Different Timeframes**: Adjust all parameters proportionally when changing chart timeframes
### Multi-Timeframe Usage
- Align trades with higher timeframe trends
- Use lower timeframes for precise entry timing
- Avoid trades when timeframes show conflicting signals
## Risk Considerations
- Like all trend-following strategies, may struggle in ranging/choppy markets
- EMA exit system prioritizes trend continuation over quick profit-taking
- Multiple timeframe analysis requires careful interpretation
- Backtesting recommended before live trading with any parameter changes
## Conclusion
The Zero Lag Trend Strategy provides a comprehensive approach to trend trading with built-in risk management and multi-timeframe analysis. Its combination of advanced technical indicators, clear entry/exit rules, and customizable parameters makes it suitable for both novice and experienced traders seeking to capture trending market movements.
Range Breakout + TradePulse HUD + Momentum GlowRange Breakout + TradePulse HUD + Momentum Glow
Overview
The Range Breakout + TradePulse HUD + Momentum Glow is a sophisticated Pine Script® indicator for TradingView, engineered to provide traders with a comprehensive toolkit for identifying breakout opportunities, monitoring real-time market dynamics, and visualizing momentum shifts. By integrating volatility-based channels, a dynamic heads-up display (HUD), and momentum-driven background glow, this indicator empowers traders with actionable insights for scalping, day trading, or swing trading across stocks, forex, and cryptocurrencies.
Key Features
Range Breakout System
ATR-Based Dynamic Channels: Constructs upper, lower, and mid-channel lines using a smoothed Average True Range (ATR) multiplied by a customizable factor (default: 4x), adapting to market volatility for precise breakout detection.
Breakout and Reversal Signals: Generates buy (▲) and sell (▼) signals on mid-channel crossovers, with an optional trend filter to align with the prevailing market direction, enhancing signal reliability.
Fakeout Detection: Optionally displays "X" markers for fakeout signals when price briefly breaches channel boundaries but fails to sustain the move, helping traders avoid false breakouts.
Customizable Visuals: Offers adjustable channel colors, gradient fill options, and transparency settings for a clean, user-friendly chart display.
TradePulse HUD
Real-Time Market Dashboard: A sleek, top-center HUD provides critical metrics on the last confirmed bar, including:
Price: Current price, color-coded (green for up, red for down).
Price Change (%): Percentage change with customizable alert thresholds for significant spikes (default: 3%).
Volume Analysis: Displays volume direction (Bullish, Bearish, Neutral) and highlights "Hype" surges when volume exceeds a user-defined threshold relative to its standard deviation (default: 1.5x).
Trend Direction: Derived from EMA crossovers (fast: 4-period, slow: 6-period) and volume confirmation, shown as Bullish, Bearish, or Neutral.
Momentum Score: A normalized RSI-based score (0–100), color-coded for overbought (>70) or oversold (<30) conditions.
Signal Confidence: A composite score (0–100) combining RSI, volume, and EMA divergence to evaluate signal strength.
Session Trend: Tracks intraday trends during key US market sessions (Open: 9:30–10:00, Mid: 10:00–14:00, Power Hour: 14:00–16:00, US Eastern Time) with emoji indicators ( for bullish, for bearish, for neutral).
RSI: Displays current RSI with customizable overbought (default: 65) and oversold (default: 35) levels.
Customizable HUD: Toggle visibility and adjust colors for a tailored trading experience.
Momentum Glow
Dynamic Background Visualization: Highlights strong market momentum with a background glow (green for bullish when RSI > 80, pink for bearish when RSI < 20), toggleable for minimal chart clutter.
Trend Confirmation: Combines channel breakouts with EMA crossovers and volume thresholds to identify high-probability bullish and bearish zones, ideal for trend-following strategies.
Session-Based Filtering: Excludes low-volatility "barcode" patterns (price range < 60% of average) to focus on actionable trends during active market hours.
Alert System
Robust Alerts: Configurable alerts for:
Buy/sell signals with optional trend filtering.
Price spikes exceeding the user-defined threshold.
"Hype" volume surges with a cooldown period (default: 5 bars) to prevent repetitive alerts.
EMA bullish/bearish crossovers for trend confirmation.
Flexible Thresholds: Customize price change, volume spike, and hype volume multipliers to align with specific trading strategies.
How It Works
Range Breakout: Calculates a central channel line (HL2) with upper and lower boundaries based on ATR. Breakouts are detected when price crosses these boundaries, while buy/sell signals trigger on mid-channel crossovers, validated by stability and optional trend filters.
TradePulse HUD: Integrates EMA, RSI, volume, and price data into a real-time, top-center dashboard, providing a holistic view of market conditions.
Momentum Glow: Enhances trend visualization with background glow for extreme RSI conditions, reinforcing breakout signals and trend direction.
Session Analysis: Monitors price behavior during key trading sessions, filtering out low-range periods to highlight high-probability trading opportunities.
Settings
Range Breakout Settings:
Line Extension Length: Duration of breakout lines (default: 100 bars).
Channel Width Multiplier: ATR multiplier for channel width (default: 4x).
Show Fakeout Signals: Toggle fakeout markers (default: disabled).
Filter Signals by Trend: Align signals with the broader trend (default: disabled).
Colors and Transparency: Customize channel colors and fill opacity.
TradePulse HUD Settings:
Show HUD: Enable/disable HUD display.
Show Momentum Glow: Toggle background glow for momentum visualization.
Price Change Alert Threshold: Percentage for price spike alerts (default: 3%).
Volume Spike Multiplier: Threshold for volume spikes (default: 1.2x average).
Hype Volume Multiplier: Threshold for "Hype" surges (default: 1.5x standard deviation).
Hype Cooldown: Minimum bars between hype alerts (default: 5).
EMA Periods: Fast (default: 4) and Slow (default: 6) for trend detection.
RSI Settings: Period (default: 14), overbought (default: 65), oversold (default: 35).
How to Use
Add the indicator to your TradingView chart.
Customize settings to match your trading style (e.g., adjust channel width, enable trend filters, or tweak HUD colors).
Monitor breakout signals (▲ for buy, ▼ for sell), fakeout markers (X), and HUD metrics for real-time context.
Use session trend indicators (//) to identify high-probability trading zones.
Set up alerts for breakouts, price spikes, volume surges, or EMA crossovers to stay informed.
Notes
License: Mozilla Public License 2.0 (mozilla.org).
Author: © StanTheTradingMan
Version: Pine Script® v6
Best Used With: Liquid markets (stocks, forex, crypto) on intraday or daily timeframes.
Optimization: Adjust ATR multiplier, EMA periods, and RSI thresholds to optimize for specific assets or strategies.
Why Use This Indicator?
The Range Breakout + TradePulse HUD + Momentum Glow delivers a powerful combination of breakout detection, real-time market analytics, and momentum visualization. Its intuitive HUD, dynamic glow feature, and robust alert system make it an essential tool for traders seeking clarity and precision in fast-moving markets. Whether capturing intraday moves or riding longer-term trends, this indicator equips you with the insights to trade confidently.
Get Started
Apply the indicator to your chart, fine-tune settings to suit your strategy, and leverage its advanced features to elevate your trading. For feedback or questions, connect via TradingView.
Kaufman Trend Strength Signal█ Overview
Kaufman Trend Strength Signal is an advanced trend detection tool that decomposes price action into its underlying directional trend and localized oscillation using a vector-based Kalman Filter.
By integrating adaptive smoothing and dynamic weighting via a weighted moving average (WMA), this indicator provides real-time insight into both trend direction and trend strength — something standard moving averages often fail to capture.
The core model assumes that observed price consists of two components:
(1) a directional trend, and
(2) localized noise or oscillation.
Using a two-step Predict & Update cycle, the filter continuously refines its trend estimate as new market data becomes available.
█ How It Works
This indicator employs a Kalman Filter model that separates the trend from short-term fluctuations in a price series.
Predict & Update Cycle : With each new bar, the filter predicts the price state and updates that prediction using the latest observed price, producing a smooth but adaptive trend line.
Trend Strength Normalization : Internally, the oscillator component is normalized against recent values (N periods) to calculate a trend strength score between -100 and +100.
(Note: The oscillator is not plotted on the chart but is used for signal generation.)
Filtered MA Line : The trend component is plotted as a smooth Kalman Filter-based moving average (MA) line on the main chart.
Threshold Cross Signals : When the internal trend strength crosses a user-defined threshold (default: ±60), visual entry arrows are displayed to signal momentum shifts.
█ Key Features
Adaptive Trend Estimation : Real-time filtering that adjusts dynamically to market changes.
Visual Buy/Sell Signals : Entry arrows appear when the trend strength crosses above or below the configured threshold.
Built-in Range Filter : The MA line turns blue when trend strength is weak (|value| < 10), helping you filter out choppy, sideways conditions.
█ How to Use
Trend Detection :
• Green MA = bullish trend
• Red MA = bearish trend
• Blue MA = no trend / ranging market
Entry Signals :
• Green triangle = trend strength crossed above +Threshold → potential bullish entry
• Red triangle = trend strength crossed below -Threshold → potential bearish entry
█ Settings
Entry Threshold : Level at which the trend strength triggers entry signals (default: 60)
Process Noise 1 & 2 : Control the filter’s responsiveness to recent price action. Higher = more reactive; lower = smoother.
Measurement Noise : Sets how much the filter "trusts" price data. High = smoother MA, low = faster response but more noise.
Trend Lookback (N2) : Number of bars used to normalize trend strength. Lower = more sensitive; higher = more stable.
Trend Smoothness (R2) : WMA smoothing applied to the trend strength calculation.
█ Visual Guide
Green MA Line → Bullish trend
Red MA Line → Bearish trend
Blue MA Line → Sideways/range
Green Triangle → Entry signal (trend strengthening)
Red Triangle → Entry signal (trend weakening)
█ Best Practices
In high-volatility conditions, increase Measurement Noise to reduce false signals.
Combine with other indicators (e.g., RSI, MACD, EMA) for confirmation and filtering.
Adjust "Entry Threshold" and noise settings depending on your timeframe and trading style.
❗ Disclaimer
This script is provided for educational purposes only and should not be considered financial advice or a recommendation to buy/sell any asset.
Trading involves risk. Past performance does not guarantee future results.
Always perform your own analysis and use proper risk management when trading.