📈 Smart Alert System — EMA/MA/Volume/SMC AlertsHere's a detailed description of your custom TradingView **Pine Script v6**:
---
### 📌 **Title**: Smart Alert System — Webhook Ready (with EMA, MA, Volume, and SMC)
This script is designed to **monitor price behavior**, detect important **technical analysis events**, and **send real-time alerts via webhook to a Telegram bot**.
---
## 🔧 SETTINGS
| Setting | Description |
| ----------------------- | ------------------------------------------------------------------------------ |
| `volumeSpikeMultiplier` | Multiplier to determine a volume spike compared to the 20-bar average volume |
| `testAlert` | If `true`, sends a test alert when the indicator is first applied to the chart |
---
## 🔍 COMPONENT BREAKDOWN
### 1. **EMA & MA Calculations**
These indicators are calculated and plotted on the chart:
* **EMAs**: 13, 25, 30, 200 — used for trend and touch detection
* **MAs**: 100, 300 — used for break and retest detection
```pinescript
ema_13 = ta.ema(close, 13)
ema_200 = ta.ema(close, 200)
ma_100 = ta.sma(close, 100)
```
---
### 2. **📈 Volume Spike Detection**
* A volume spike is identified when the current bar's volume is **2x (default)** greater than the 20-period average.
* A red triangle is plotted above such candles.
* A **JSON alert** is triggered.
```pinescript
volSpike = volume > avgVol * volumeSpikeMultiplier
```
---
### 3. **📊 EMA Touch Alerts**
* The script checks if the current close is:
* Within 0.1% of an EMA value **OR**
* Has crossed above/below it.
* If so, it sends an alert with the EMA name.
```pinescript
touch(val, crossed) =>
math.abs(close - val) / val < 0.001 or crossed
```
---
### 4. **📉 MA Break and Retest Alerts**
* A **break** is when price falls **below** a moving average.
* A **retest** is when price climbs **above** the same average after breaking below.
```pinescript
breakBelow(ma) => close > ma and close < ma
```
---
### 5. 🧠 **SMC Alerts (Break of Structure \ & Change of Character \ )**
These follow **Smart Money Concepts (SMC)**. The script identifies:
* **BOS**: New higher high in uptrend or lower low in downtrend
* **CHOCH**: Opposite of trend, e.g. lower low in uptrend or higher high in downtrend
```pinescript
bos = (high > high ) and (low > low ) and (low > low )
choch = (low < low ) and (high < high ) and (high < high )
```
---
### 6. 🧪 Dummy Test Alert (1-time fire)
* Sends a `"✅ Test Alert Fired"` to verify setup
* Executes **once only** after adding the indicator
```pinescript
var bool sentTest = false
if testAlert and not sentTest
```
---
### 7. 🚀 Alert Delivery (Webhook JSON)
All alerts are sent as a JSON payload that looks like this:
```json
{
"pair": "BTCUSD",
"event": "🔺 Volume Spike",
"timeframe": "15",
"timestamp": "2024-06-29T12:00:00Z",
"volume": "654000"
}
```
This format makes it compatible with your **Telegram webhook server**.
---
### 🔔 Alerts You Can Create in TradingView
* Set **Webhook URL** to your `https://xxxx.ngrok-free.app/tradingview-webhook`
* Use alert condition: `"Any alert()`" — because all logic is internal.
* Select **"Webhook URL"** and leave the message body blank.
---
### 🛠️ Use Cases
* Notify yourself on **EMA interaction**
* Detect **trend shifts or retests**
* Spot **volume-based market interest**
* Get real-time **BOS/CHOCH alerts** for Smart Money strategies
* Alert through **Telegram using your Node.js webhook server**
---
Would you like me to break down the full Pine Script block-by-block as well?
Trend Analysis
TRADING GURU - WatermarkHi guys,
If you are looking to add some watermark into your charts. You can use this indicator.
You can add add a title and a subtitle, if you want to write in diferents lines, you can use as you can see in the script.
All the features are customizable: position, text size, text color, background.
Enjoy it.
ZY Legend StrategyThe ZY Legend Strategy indicator closely follows the trend of the parity. It produces trading signals in candles where the necessary conditions are met and clearly shows these signals on the chart. Although it was produced for the scalp trade strategy, it works effectively in all time frames. 'DEAD PARITY' signals indicate that healthy signals cannot be generated for the relevant parity due to shallow ATR. It is not recommended to trade on parities where this signal appears.
GlocksFibsA modded Version of AlgoAlphas fib script. reworked it into my fib set. same rules apply 868 924 entry. first tp 50% mark. using it to help speed up my charting process overall. This is by far one of the best ones ive found that wont print the fib weird once the new numbers are in. all credits to AlgoAlpha and this gem they made!
CMF Hybrid Scalper (1m Optimized)CMF Hybrid SCALPER That measures the change of CMF and smoothen it with EMA. Gives green zone zero and vise versa
Intraday TWAP SimpleSlivKurs. This script implements a classic VWAP using ChatGPT (OpenAI). Purely a home project.
Historical Volatility with HV Average & High/Low TrendlinesHere's a detailed description of your Pine Script indicator:
---
### 📊 **Indicator Title**: Historical Volatility with HV Average & High/Low Trendlines
**Version**: Pine Script v5
**Purpose**:
This script visualizes market volatility using **Historical Volatility (HV)** and enhances analysis by:
* Showing a **moving average** of HV to identify volatility trends.
* Marking **high and low trendlines** to highlight extremes in volatility over a selected period.
---
### 🔧 **Inputs**:
1. **HV Length (`length`)**:
Controls how many bars are used to calculate Historical Volatility.
*(Default: 10)*
2. **Average Length (`avgLength`)**:
Number of bars used for calculating the moving average of HV.
*(Default: 20)*
3. **Trendline Lookback Period (`trendLookback`)**:
Number of bars to look back for calculating the highest and lowest values of HV.
*(Default: 100)*
---
### 📈 **Core Calculations**:
1. **Historical Volatility (`hv`)**:
$$
HV = 100 \times \text{stdev}\left(\ln\left(\frac{\text{close}}{\text{close} }\right), \text{length}\right) \times \sqrt{\frac{365}{\text{period}}}
$$
* Measures how much the stock price fluctuates.
* Adjusts annualization factor depending on whether it's intraday or daily.
2. **HV Moving Average (`hvAvg`)**:
A simple moving average (SMA) of HV over the selected `avgLength`.
3. **HV High & Low Trendlines**:
* `hvHigh`: Highest HV value over the last `trendLookback` bars.
* `hvLow`: Lowest HV value over the last `trendLookback` bars.
---
### 🖍️ **Visual Plots**:
* 🔵 **HV**: Blue line showing raw Historical Volatility.
* 🔴 **HV Average**: Red line (thicker) indicating smoothed HV trend.
* 🟢 **HV High**: Green horizontal line marking volatility peaks.
* 🟠 **HV Low**: Orange horizontal line marking volatility lows.
---
### ✅ **Usage**:
* **High HV**: Indicates increased risk or potential breakout conditions.
* **Low HV**: Suggests consolidation or calm markets.
* **Cross of HV above Average**: May signal rising volatility (e.g., before breakout).
* **Touching High/Low Levels**: Helps identify volatility extremes and possible reversal zones.
---
Let me know if you’d like to add:
* Alerts when HV crosses its average.
* Shaded bands or histogram visualization.
* Bollinger Bands for HV.
🔁 EMA 3/21 Crossover Strategy — Exit on Opposite SignalEMA 3/21 Crossover Strategy — Exit on Opposite Signal
This strategy enters trades based on a crossover between two exponential moving averages:
Buy Entry: When the 3-period EMA crosses above the 21-period EMA
Sell Entry: When the 3-period EMA crosses below the 21-period EMA
Exit Rule: Positions are exited only when an opposite signal occurs (i.e., a new crossover in the other direction)
Key Features:
Designed for trend-following setups
Uses ATR-based SL/TP lines for visual reference only (trades do not auto-close at SL/TP)
Suitable for manual or automated trading logic with high trade clarity
Can be applied on any timeframe and any liquid instrument (Forex, crypto, indices, etc.)
Recommended Use:
Combine with volume or session filters for improved signal quality
Ideal for traders seeking clear entry/exit rules with minimal noise
Best on trending instruments and medium timeframes (USDJPY; Daily)
Momentum TrendThis indicator suite aims to confirm strong uptrends or downtrends by combining ADX, MACD, ATR, and Accumulation/Distribution signals—green dots suggest confirmed upward momentum supported by accumulation at that moment, red dots indicate strong downward momentum, while separate A/D and ADX panels help visually assess trend strength and volume pressure for confirmation.
Close Above Prev High / Below Prev LowIdentifies candles that close above the previous candle's high (bullish) and candles that close below the previous candle's low (bearish). Helps with decisions for entry and exit.
Multi Horizontal Lines 1000 BarsThis indicator is is not my code, I have copied this from another user and extened the lines so they go back 1000 bars for back testing.
I use this indicator to trade Crude Oil and set the horizontal lines to 20 cents increments, 0.2 is 20 cents. You can change the horizontal lines to any price distance to suit your style of trading.
My idea is when price crosses over a horizontal line I will enter a trade long or short looking to secure 20 cents.
Moving Average ExponentialThis indicator plots 8 Exponential Moving Averages (EMAs) with customizable lengths: 20, 25, 30, 35, 40, 45, 50, and 55. It also includes optional smoothing using various moving average types (SMA, EMA, WMA, etc.) and an optional Bollinger Bands overlay based on the EMA. It helps identify trend direction, momentum, and potential reversal zones.
Gold DynamicThis is a custom-made TradingView indicator designed to visualize "sequential price levels" based on a user-defined step value, dynamically centered around the current gold price. It draws horizontal lines at multiples of a chosen step value (e.g., 7) both above and below the current price.
Key Features:
Dynamic Price Levels: Lines are calculated relative to the live price, providing relevant support/resistance or structural levels for the current market context.
Customizable Step Value: Easily adjust the Sequence Step Value (e.g., 7, 10, 14) from the indicator settings to align with your trading theory.
Adjustable Line Count: Control the Number of Lines ABOVE Current Price and Number of Lines BELOW Current Price to show as many or as few levels as desired.
Extended Lines: Horizontal lines extend indefinitely to both the left (historical data) and right (future projection) for comprehensive visualization.
Clear Price Labels: Each line displays its exact price value, positioned at the far right of the chart for quick reference.
Customizable Appearance: Modify line color, width, and style (solid, dotted, dashed) to suit your charting preferences.
Exact Values: All displayed price labels are rounded to whole numbers for clear, precise visualization without decimal values.
This indicator is ideal for traders looking to apply a fixed-step price theory to their gold analysis.
CMF Tilson Scalper (1m Optimized)Calculates CMF and smoothens it based on Tilson MA and then sets buy sone > 0 and sell zone < 0
CMF Tilson Scalper (1m Optimized)This indicator tracks CMF based on Tilson MA with buy zone above zero and Sell zone below zero
CRT Wick ReversalCustom code to help predict reversals by using LQ areas - Killzone highs/lows, high volume LQ (CPI/NFP/News)/ IRL events such as war/POTUS etc..
Order Blocks Pro (SMC + TP/SL + Panel)An advanced Smart Money Concepts (SMC) script for TradingView that identifies Order Blocks, liquidity zones, structure breaks (CHOCH/BOS), and Fair Value Gaps (FVG). It features automatic entries (aggressive and confirmed), dynamic Take Profit (TP) and Stop Loss (SL) levels, and a visual panel showing key market conditions. Designed for traders seeking institutional-level precision and optimized entries based on structure, HTF wicks, and price behavior.
Order + Breaker Blocks HTFThis indicator is a Hidden Liquidity Script, being a much more refined and precise version of "Order Blocks" also known as "Supply and Demand" zones.
This script is more refined and precise as this script is the only script that displays the exact body part of blocks on multiple timeframes, showing potentially powerful price reversal zones for taking a long or short.
This is a PRICE ACTION indicator, demonstrating price action that can result in potential good support/resistance levels for taking a long or short trade.
This indicator only displays the body part of order blocks, instead of including wicks that all other indicators do. That makes this script a much more refined version of all other scripts out there.
Not only that, this script can collate multiple timeframes into one indicator, again something other scripts cannot do.
This script is also unique compared to other Hidden Liquidity style scripts in that you have full control over each Order Block so you can see each individual block on a chart, whilst other charts combine them into a zone instead. This refined version gives you precise potential entries and much further refinement as well as more thorough backtesting capabilities.
This script also can highlight order blocks that pass THROUGH a Fair Value Gap. These are known as 'Breaker Blocks'. These powerful blocks can be places of interest as support or resistance for a long or short trade. Note: This script shows the body part of a block only and not the wick.
Breaker Blocks, where significant displacement has occurred in price past a block can be more powerful. This script does not highlight Fair Value Gaps themselves, only order blocks (supply and demand) and breaker blocks through displacement in price (through an FVG). FVGs on their own can be weaker without order blocks behind them hence they are not highlighted.
The BODY of the order block, and the 0.5 of the order block are key regions for considering a trade, treating that level as either resistance or support.
Important: PLEASE NOTE: This indicator will only show timeframes that are higher than or the same as the current chart timeframe.
For Example, only blocks 3 Days or higher will show on a 3D chart. It will not show 12h blocks on a 3D chart. You would need to go to a 12 hour chart with the 12h blocks showing to see all Blocks that are 12h or higher drawn.
SETTINGS:
There is options to change the colours of the boxes and to differentiate between Order Blocks and stronger Breaker Blocks if desired.
If this is NOT desired, make all color options the same color,.
Shown below is blue Order Blocks (Supply and Demand)
Shown below there is Pink Breaker Blocks.
There is options to weaken the colour of blocks that have been tapped by a wick and thus partially used up, also called partially "mitigated".These blocks can be considered weaker support/resistance.
Once a block has had a wick or body close over it entirely, the block can be considered fully "mitigated" and will disappear from the indicator once that candle has closed. This block level can now be considered too weak. You can also choose to not show these partially mitigated blocks at all.
The chart above shows pale Violet blocks as partially mitigated or "tapped" blocks.
The blocks in HOT BRIGHT Violet are untapped and potentially stronger levels for a Long or Short trade.
See below and example of a HOT PINK stronger level with a 1,2,3,4,5 Days of blocks in the one area.
See below an example of a weaker pink level. Still valid, but potentially riskier. There is a weaker 5D Block in pale pink and no other days in that same zone.
Additional SETTINGS:
Further options include, if selected: Counting the number of fair value gaps an order block may pass through. More FVGs an order block (now a breaker block) passes through can strengthen the support of that block level, making a reversal more likely.
There is an option of showing old mitigated order blocks and changing the color of these on the chart. This can aid in backtesting of levels.
Further Settings include:
- an option to remove very thin blocks that may not be strong points.
- an option to denote with a character such as a * blocks that have their EQ 0.5 region wicked - these can be considered weaker.
- an option to denote with an additional * or another character blocks that are barely tapped by a small percent so you know they are still considered quite strong.
- an option to show how many candles form the order block.
Additional Options include:
- an option to show blocks only within a specific price range or percent range of the current price.
- an option to only look X number of bars back.
There is Options regarding labelling, and Border widths on boxes.
It is ESSENTIAL to do your own research and backtesting!
It is recommended to combine these levels with other concepts for added confluence.
Other indicators are NOT included in this script. This is purely a refined order block script for the BODY of a block only.
You can combine Order Blocks and stronger versions known as Breaker Blocks in this script with other indicators or concepts to form a Full Trading Strategy.
Other potential concepts to combine, not shown in this script can include Smart Money Concepts, Market Structure, Fibonnaccis, SMAs, EMAs or any other concept to give added confluence to the support / resistance levels identified in this script that may indicate that the level is stronger.
This indicator is not a trading strategy on its own. It is best used in combination with other concepts to improve the success.
Backtesting this indicator is highly recommended and incorporated into a full trading system of your own design. This only identifies possible key regions based on Price Action Strategies.
This indicator simply makes the identification of these hot levels easier and simpler to find, especially across multiple timeframes.
A strong bright zone on the indicator can be a stronger level than a weak partial block that is in light colours.
Again -Please do your own research and backtesting.
These indicators make finding these levels much much simpler and easier when combined with a full trading strategy.
Any feedback is welcome.
MandarKalgutkar-Buy/Sell Arrow Signal//@version=5
indicator("MandarKalgutkar-Buy/Sell Arrow Signal", overlay=true)
ma = ta.sma(close, 21)
rsi = ta.rsi(close, 14)
// Tracking variables
var float buyRefHigh = na
var float sellRefLow = na
var int buyCandleIndex = na
var int sellCandleIndex = na
// Detect initial breakout candle
bullishBreak = close > open and close > ma and close < ma
if bullishBreak
buyRefHigh := high
buyCandleIndex := bar_index
bearishBreak = close < open and close < ma and close > ma
if bearishBreak
sellRefLow := low
sellCandleIndex := bar_index
// Next candle only: ensure current bar is exactly next one
isNextBuyBar = (not na(buyCandleIndex)) and bar_index == buyCandleIndex + 1
isNextSellBar = (not na(sellCandleIndex)) and bar_index == sellCandleIndex + 1
// Buy/sell logic
buySignal = isNextBuyBar and high > buyRefHigh and rsi > 55
sellSignal = isNextSellBar and low < sellRefLow and rsi < 45
// Reset if signal used or next candle missed
if buySignal or isNextBuyBar
buyRefHigh := na
buyCandleIndex := na
if sellSignal or isNextSellBar
sellRefLow := na
sellCandleIndex := na
// Plot
plotshape(buySignal, title="Buy", location=location.belowbar, color=color.green, style=shape.labelup, size=size.small)
plotshape(sellSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small)
plot(ma, "20 MA", color.orange)