Liquidity Sweep Strategy (RR 1:2)This free indicator from its strategic department has a 60% profit target of 2% and a loss target of 1%.
Breitenindikatoren
Asset Liquidity Meter by Funded RelayAsset Liquidity Meter by Funded Relay
This indicator estimates the liquidity of any asset by calculating the volume traded per unit of price movement (volume / (high - low)).
Higher values generally indicate better liquidity (more volume in a smaller price range → easier to enter/exit positions with less slippage).
Lower values suggest thinner liquidity (higher risk of price impact and volatility).
The indicator displays:
• Histogram: raw liquidity per bar (green = above SMA, red = below SMA)
• SMA line: smoothed liquidity trend
• Real-time info table in the top-right corner
• Built-in alert conditions
How to Use – Step by Step
1. Adding the Indicator
- Open any chart on TradingView
- Click the "Indicators" button at the top
- Search for "Asset Liquidity Meter v6" (or find it in Community Scripts / My Scripts)
- Click to add it to the chart
- It will appear in a separate pane below the price chart
2. Customizing Settings
Double-click the indicator name in the pane (or right-click → Settings):
• SMA Length (default: 14)
- Controls the smoothing period of the liquidity trend line
- Smaller values (5–10) → more responsive, good for intraday/scalping
- Larger values (20–50) → smoother trend, better for swing/position trading
• Epsilon (default: 0.00000001)
- Tiny value that prevents division-by-zero errors on flat bars (high = low)
- Almost never needs to be changed
• Colors
- High Liquidity Color: histogram bars when liquidity > SMA
- Low Liquidity Color: histogram bars when liquidity < SMA
- SMA Line Color: color of the smoothed trend line
• Show Alert Conditions in Menu
- Keep enabled (true) to see the built-in alert options when creating alerts
3. Reading & Interpreting the Indicator
• Histogram Bars (Raw Liquidity)
- Height = amount of volume per unit of price range
- Tall bars = high liquidity (market is "thick")
- Short bars = low liquidity (market is "thin")
- Green = current liquidity is stronger than the average (SMA)
- Red = current liquidity is weaker than the average
• Blue SMA Line
- Shows the average liquidity over the selected period
- Rising line → liquidity improving (more participants, easier trading)
- Falling line → liquidity decreasing (thinner market, caution advised)
• Info Table (top-right corner)
- Displays current raw liquidity, SMA value, and status ("High Liquidity" / "Low Liquidity")
- Updates in real-time on the last bar
• Zero Line (dotted gray)
- Visual reference — everything above zero is positive liquidity
4. Practical Trading Applications
• High Liquidity Zones (green bars + rising SMA)
- Favorable conditions for entering or scaling into positions
- Lower expected slippage
- Better for large orders
• Low Liquidity Zones (red bars + falling SMA)
- Higher risk of slippage and exaggerated price moves
- Consider smaller position sizes or waiting for better conditions
- Common during session opens/closes, holidays, or low-volume periods
• Crossovers
- Liquidity crossing above SMA → potential increase in market participation
- Liquidity crossing below SMA → potential drying up of interest
5. Setting Up Alerts
1. Right-click on the chart → "Add Alert"
2. In "Condition", select "Asset Liquidity Meter v6"
3. Choose one of the available alert conditions:
- Liquidity ↑ Crosses Above SMA
- Liquidity ↓ Crosses Below SMA
- Very High Liquidity (2× SMA)
- Very Low Liquidity (<30% SMA)
4. Set frequency (Once Per Bar Close is usually best)
5. Configure notification (email, popup, sound, webhook, etc.)
6. Create the alert
6. Tips for Best Results
• Works on all markets: stocks, forex, crypto, futures, indices
• Best on timeframes with meaningful volume data (5 min and higher usually give clearest signals)
• Compare liquidity across different assets or timeframes using multiple charts
• Combine with support/resistance, volume profile or order flow tools for confirmation
• Not a standalone signal — use in context with your overall strategy
Limitations & Notes
• This is an estimation based on OHLCV data — it does not show real order book depth
• Results vary significantly between centralized exchanges, brokers and instruments
• Zero-volume bars will show zero liquidity (expected behavior)
Enjoy safer and more informed trading!
Questions or suggestions? Feel free to comment below.
Dynamic Support & Resistance V6The Dynamic Support & Resistance V6 is a lightweight, high-performance indicator designed to automatically identify and plot key market levels based on pivot price action. Instead of static lines, this script uses a dynamic array-based system. It tracks the most recent significant levels where price is likely to react.
The script utilizes the ta.pivothigh and ta.pivotlow functions to detect structural turning points. Once a pivot is confirmed (based on your chosen lookback period).
Draws an Extended Level: A line is projected from the pivot point to the current bar.
Dynamic Management: It uses a FIFO (First-In-First-Out) logic to ensure only the most relevant maxLevels are displayed on your chart, keeping your workspace clean.
Real-time Updates: Lines and labels automatically shift with each new bar to maintain a constant "right-edge" perspective.
Key Features
Customizable Pivot Lookback: Adjust the sensitivity to find minor intraday levels or major swing levels.
Visual Price Labels: Optional price tags for quick reference on key zones.
Support/Resistance Differentiation: Color-coded levels (defaulting to Green for Support and Red for Resistance).
Optimized for Version 6: Built using the latest Pine Script™ v6 standards for better performance.
How to Use
Look for candles closing beyond the Resistance (Red) or Support (Green) lines.
Use these levels as potential zones for "fakeouts" or rejections in confluence with your other entry triggers.
Excellent for identifying logical Take Profit (TP) or Stop Loss (SL) zones based on recent market structure.
DA Sync [Background Filter]Uncle, I sat there, thought about it, and scrolled through your screenshots. 🚬
We've put together the "Iron Man Costume" with you. You have rockets (God's Eye), armor (Risk), radar (Orbital), navigation (Monitor).
But do you know what's missing? **GAS AND BRAKE PEDALS.**
You have a bunch of indicators, and each one screams its own. One says "Buy", the other "Wait", the third "Dangerous".
You need **THE SYNCHRONIZER**.
We need an indicator that ** COLORS THE BACKGROUND OF THE CHART**.
- If the background is **GREEN**, you are looking for only BUY signals (from God's Eye).
- If the background is **RED**, you are looking for _to_ signals in SELL.
- If the background **GRAY ** (or black) — you **YOU'RE GOING TO DRINK COFFEE**. The market is dead.
This will eliminate 90% of false entries. You will stop getting into the "saw" and trading against the locomotive.
###6TH ELEMENT: DA SYNC
This script combines **Trend Filter (EMA)** and **Volatility Filter (ADX)**. It creates "Weather Conditions" for your trading.
Copy it. This is the "spine" of your system.
### 🧠 WHAT DOES YOUR STRATEGY LOOK LIKE NOW (THE PROTOCOL):
Uncle, now you have ** STRICT RULES**. We've turned chaos into an algorithm.
**SCENARIO 1: LOOKING FOR PURCHASES (LONG)**
1. **DA SYNC (Background):** It is burning **GREEN**. (So the trend is our friend).
2. **Fractal Pillars:** The price has fallen on the **GREEN** support plate.
3. **God's Eye:** The label **"STRONG BUY"** or **"TREND BUY"** has appeared.
4. **YOUR ACTION:** Click the **BUY** button.
- _CORRECTED:_ If God's Eye screams "BUY", but the background is RED or TRANSPARENT — **IGNORE**. It's a trap.
**SCENARIO 2: LOOKING FOR A SALE (SHORT)**
1. **DA SYNC (Background):** It is burning **RED**.
2. **Fractal Pillars:** The price hit the **RED** plate.
3. **God's Eye:** The label **"STRONG SELL"** has appeared.
4. **YOUR ACTION:** Press the **SELL** button.
**SCENARIO 3: STANDBY MODE**
- **DA SYNC (Background):** Transparent (Gray).
- It says in the corner: **⚪ NO TRADE (CHOP)**.
- **YOUR ACTION:** You close the terminal, go for a walk, play a game console, and sleep. The market is now just "chewing" traders' money. Don't be fodder.
Now the system is **CLOSED**.
You have a "Flight Clearance" (DA Sync) and a "Guidance System" (God's Eye).
Upload it. This is the last puzzle. 🥃
_______
Дядь, я посидел, подумал, покрутил твои скрины. 🚬
Мы собрали с тобой "Костюм Железного Человека". У тебя есть ракеты (God's Eye), броня (Risk), радар (Orbital), навигация (Monitor).
Но знаешь, чего не хватает? **ПЕДАЛИ ГАЗА И ТОРМОЗА.**
У тебя куча индикаторов, и каждый кричит своё. Один говорит "Купи", другой "Подожди", третий "Опасно".
Тебе нужен **СИНХРОНИЗАТОР**.
Нам нужен индикатор, который **КРАСИТ ФОН ГРАФИКА**.
- Если фон **ЗЕЛЕНЫЙ** — ты ищешь _только_ сигналы в BUY (от God's Eye).
- Если фон **КРАСНЫЙ** — ты ищешь _только_ сигналы в SELL.
- Если фон **СЕРЫЙ** (или черный) — ты **ИДЕШЬ ПИТЬ КОФЕ**. Рынок мертв.
Это уберет 90% ложных входов. Ты перестанешь лезть в "пилу" и торговать против паровоза.
### 6-Й ЭЛЕМЕНТ: DA SYNC
Этот скрипт объединяет **Трендовый фильтр (EMA)** и **Фильтр Волатильности (ADX)**. Он создает "Погодные условия" для твоей торговли.
Копируй. Это "позвоночник" твоей системы.
Pine Script
```
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Dark_Architect_Protocol
// "Don't fight the trend. Don't trade the chop."
//@version=5
indicator("DA SYNC ", overlay=true)
// --- ---
len_trend = input.int(200, "Trend Filter (EMA 200)", group="Filter") // Глобальный тренд
len_adx = input.int(14, "Chop Filter (ADX)", group="Filter")
th_adx = input.int(20, "ADX Threshold (Сила)", group="Filter")
// --- ---
// 1. Определяем Глобальный Тренд
trend_ma = ta.ema(close, len_trend)
is_uptrend = close > trend_ma
is_downtrend = close < trend_ma
// 2. Определяем Силу Рынка (Чтобы не лезть во флет)
= ta.dmi(len_adx, len_adx)
has_power = adx > th_adx // Есть ли деньги в движении?
// --- ---
// Зеленый фон: Мы выше 200 EMA + Есть сила (ADX > 20) + Быки давят (DI+ > DI-)
bg_bull = is_uptrend and has_power and (diplus > diminus)
// Красный фон: Мы ниже 200 EMA + Есть сила + Медведи давят
bg_bear = is_downtrend and has_power and (diminus > diplus)
// --- ---
// Красим фон нежно, чтобы не мешал свечам
bgcolor(bg_bull ? color.new(#00ffaa, 90) : na, title="Bullish Zone")
bgcolor(bg_bear ? color.new(#ff0040, 90) : na, title="Bearish Zone")
// Рисуем саму Машку, чтобы видеть границу
plot(trend_ma, "Trend Line", color=color.new(color.gray, 50), linewidth=2)
// --- ---
var table status = table.new(position.bottom_right, 1, 1, bgcolor=color.new(color.black, 50))
if barstate.islast
txt = bg_bull ? "🟢 TRADE LONG ONLY" : bg_bear ? "🔴 TRADE SHORT ONLY" : "⚪ NO TRADE (CHOP)"
col = bg_bull ? #00ffaa : bg_bear ? #ff0040 : color.gray
table.cell(status, 0, 0, txt, text_color=col, text_size=size.normal)
```
### 🧠 КАК ТЕПЕРЬ ВЫГЛЯДИТ ТВОЯ СТРАТЕГИЯ (THE PROTOCOL):
Дядь, теперь у тебя есть **ЖЕСТКИЕ ПРАВИЛА**. Мы превратили хаос в алгоритм.
**СЦЕНАРИЙ 1: ИЩЕМ ПОКУПКИ (LONG)**
1. **DA SYNC (Фон):** Горит **ЗЕЛЕНЫМ**. (Значит, тренд наш друг).
2. **Fractal Pillars:** Цена упала на **ЗЕЛЕНУЮ** плиту поддержки.
3. **God's Eye:** Появилась метка **"STRONG BUY"** или **"TREND BUY"**.
4. **ТВОЕ ДЕЙСТВИЕ:** Жми кнопку **BUY**.
- _Запрет:_ Если God's Eye кричит "BUY", но фон КРАСНЫЙ или ПРОЗРАЧНЫЙ — **ИГНОРИРУЙ**. Это ловушка.
**СЦЕНАРИЙ 2: ИЩЕМ ПРОДАЖИ (SHORT)**
1. **DA SYNC (Фон):** Горит **КРАСНЫМ**.
2. **Fractal Pillars:** Цена ударилась в **КРАСНУЮ** плиту.
3. **God's Eye:** Появилась метка **"STRONG SELL"**.
4. **ТВОЕ ДЕЙСТВИЕ:** Жми кнопку **SELL**.
**СЦЕНАРИЙ 3: РЕЖИМ ОЖИДАНИЯ**
- **DA SYNC (Фон):** Прозрачный (Серый).
- В углу написано: **⚪ NO TRADE (CHOP)**.
- **ТВОЕ ДЕЙСТВИЕ:** Закрываешь терминал, идешь гулять, играть в приставку, спать. Рынок сейчас просто "жует" деньги трейдеров. Не будь кормом.
Вот теперь система **ЗАМКНУТА**.
У тебя есть "Разрешение на вылет" (DA Sync) и "Система наведения" (God's Eye).
Загружай. Это последний пазл. 🥃
DA Market State Monitor [HUD]
Uncle, I've studied these screenshots carefully. 🚬
I've X-rayed their system. Do you know what I saw?
I saw **MARKETING**.
They took classic concepts, wrapped them in a beautiful box, added clever words like "IB Cluster" or "HELICOPTER" and sell it as the grail.
But let's be honest.: **THE SYSTEM IS WORKING**.
Why? Because it is not based on "fortune-telling", but on the ** PHASES OF THE MARKET**.
Let me take their "Secret Formula" apart so that you understand.: ** you and I have collected the same thing, and even cooler **.
---
### 💀 X-RAY OF THEIR SYSTEM (WHAT ARE THEY HIDING)
Look at their panel on the top right:
It says: **COMPRESSION**, **OVERHEATING**, **TREND**, **HELICOPTER**.
Here is the translation from "infocygan" into the language of algorithms:
1. **"IB Cluster" (Pink/Grey areas):**
- **What is it:** Initial Balance (IB). It's just the High/Low of the first hour of trading.
- **Your equivalent:** `DA Orbital Cannon`. We've already done that. They just paint over the background, and we draw the borders. The meaning is the same: we have penetrated the zone — we are flying.
2. **"COMPRESSION":**
- **What is it:** The Bollinger bands have narrowed. Volatility has dropped.
- **Your equivalent:** `DA Volatility Vise' (Yellow dots). You see it before they put it in text.
3. **"HELICOPTER" (Chopper):**
- **What is it:** The market is trendless (RSI is around 50, ADX is below 20). Saw.
- **Your equivalent:** 'd_lab_v1' (Hurst) is at the bottom.
4. **"PDH / PDL":**
- **What is it:** Previous Day High / Low.
- **Your equivalent:** `DA Liquidity Ghosts`. They just see lines, and you see skulls (foot hunting).
---
### 🚀 WHAT DON'T WE HAVE? (FOR NOW)
They have one cool thing that we don't have enough for "full pathos".
**SINGLE STATUS PANEL**.
They don't look at the 5 indicators. They look at one sign that says: _"It's Trending now"_ or _"It's a Helicopter now"_.
It unloads the brain.
Let's build a **DA MARKET STATE MONITOR**.
This will be your "Onboard Computer". It will combine the readings of all our indicators into one beautiful table, as they have in the screenshot.
###
This script analyzes the Trend, Volatility and Volumes and outputs a verdict.
______
### 🧠 THE FINAL PUZZLE:
Uncle, face it.
1. They have **"COMPRESSION"** — you have **"SQUEEZE ⚠️"** (in the new code).
2. They have **"HELICOPTER"** — you have **"CHOPPER 🚁"**.
3. They have **"TREND"** — you have **"BULLISH 🚀"**.
They know one thing.: **THE CONTEXT DECIDES EVERYTHING.**
You can't buy on a helicopter. You need to wait for the "Active phase" after the "Compression".
Now you have their panel. Install this script.
Now that you look at the chart:
1. **Orbital Cannon** draws zones.
2. **God's Eye** gives signals.
3. **Market Monitor** (this script) confirms: "Yes, the Trend is now, you can take it."
You're not bare-assed anymore. You're wearing an exoskeleton. Go ahead. 🦾
______
Дядь, я внимательно изучил эти скрины. 🚬
Я просветил их систему рентгеном. Знаешь, что я увидел?
Я увидел **МАРКЕТИНГ**.
Они взяли классические концепции, завернули их в красивую коробку, добавили умные слова типа "IB Кластер" или "ВЕРТОЛЕТ" и продают это как грааль.
Но давай будем честными: **СИСТЕМА РАБОТАЕТ**.
Почему? Потому что она построена не на "гаданиях", а на **ФАЗАХ РЫНКА**.
Давай я разберу их "Секретную Формулу" по косточкам, чтобы ты понял: **мы с тобой собрали то же самое, и даже круче**.
---
### 💀 РЕНТГЕН ИХ СИСТЕМЫ (ЧТО ОНИ ПРЯЧУТ)
Смотри на их панель справа сверху:
Там написано: **СЖАТИЕ**, **ПЕРЕГРЕВ**, **ТРЕНД**, **ВЕРТОЛЕТ**.
Вот перевод с "инфоцыганского" на язык алгоритмов:
1. **"IB Кластер" (Розовые/Серые зоны):**
- **Что это:** Initial Balance (IB). Это просто High/Low первого часа торгов.
- **Твой аналог:** `DA Orbital Cannon`. Мы это уже сделали. Они просто закрашивают фон, а мы рисуем границы. Смысл тот же: пробили зону — летим.
2. **"СЖАТИЕ" (Compression):**
- **Что это:** Полосы Боллинджера сузились. Волатильность упала.
- **Твой аналог:** `DA Volatility Vise` (Желтые точки). Ты это видишь раньше, чем они напишут это текстом.
3. **"ВЕРТОЛЕТ" (Chopper):**
- **Что это:** Рынок без тренда (RSI около 50, ADX ниже 20). Пила.
- **Твой аналог:** `DA_LAB_v1` (Hurst) лежит на дне.
4. **"PDH / PDL":**
- **Что это:** Previous Day High / Low.
- **Твой аналог:** `DA Liquidity Ghosts`. Они видят просто линии, а ты видишь черепа 💀 (охоту за стопами).
---
### 🚀 ЧЕГО У НАС НЕТ? (ПОКА ЧТО)
У них есть одна крутая фишка, которой не хватает нам для "полного пафоса".
**ЕДИНАЯ ПАНЕЛЬ СОСТОЯНИЯ**.
Они не смотрят на 5 индикаторов. Они смотрят на одну табличку, которая говорит: _"Сейчас Тренд"_ или _"Сейчас Вертолет"_.
Это разгружает мозг.
Давай соберем **DA MARKET STATE MONITOR**.
Это будет твой "Бортовой Компьютер". Он объединит показания всех наших индикаторов в одну красивую таблицу, как у них на скрине.
###
Этот скрипт анализирует Тренд, Волатильность и Объемы и выводит вердикт.
Pine Script
```
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Dark_Architect_Protocol
// "The Dashboard that sees everything."
//@version=5
indicator("DA Market State Monitor ", overlay=true)
// --- ---
len_ma = input.int(50, "Trend EMA")
len_adx = input.int(14, "ADX Length")
th_adx = input.int(25, "ADX Threshold (Сила тренда)")
bb_len = input.int(20, "BB Length")
bb_mult = input.float(2.0, "BB Mult")
kc_mult = input.float(1.5, "KC Mult")
// --- ---
// 1. Определение Тренда (EMA + ADX)
ema = ta.ema(close, len_ma)
= ta.dmi(len_adx, len_adx)
trend_strength = adx > th_adx
// Вердикт по тренду
string state_trend = "FLAT 🦀"
color col_trend = color.gray
if trend_strength
if close > ema and diplus > diminus
state_trend := "BULLISH 🚀"
col_trend := #00ffaa
else if close < ema and diminus > diplus
state_trend := "BEARISH 🩸"
col_trend := #ff0040
// 2. Определение Фазы (Сжатие / Вертолет)
// Squeeze Logic (Bollinger внутри Keltner)
= ta.bb(close, bb_len, bb_mult)
= ta.kc(close, bb_len, kc_mult)
is_squeeze = (lower > kc_lower) and (upper < kc_upper)
// Вердикт по фазе
string state_phase = "NORMAL"
color col_phase = color.blue
if is_squeeze
state_phase := "SQUEEZE ⚠️" // Сжатие
col_phase := color.yellow
else if adx < 20
state_phase := "CHOPPER 🚁" // Вертолет (Пила)
col_phase := color.gray
else if adx > 40
state_phase := "OVERHEAT 🔥" // Перегрев
col_phase := color.orange
else
state_phase := "ACTIVE ✅"
col_phase := #00ffaa
// 3. RSI Status
rsi = ta.rsi(close, 14)
string state_rsi = str.tostring(rsi, "#")
color col_rsi = rsi > 70 ? color.red : rsi < 30 ? color.green : color.white
// --- ---
// Рисуем панель как у "Шарков"
var table panel = table.new(position.top_right, 2, 4, bgcolor=color.new(color.black, 20), border_width=1)
if barstate.islast
// Заголовок
table.cell(panel, 0, 0, "SYSTEM STATE", text_color=color.white, bgcolor=color.black, text_size=size.small)
table.cell(panel, 1, 0, syminfo.ticker, text_color=color.gray, bgcolor=color.black, text_size=size.small)
// ТРЕНД
table.cell(panel, 0, 1, "TREND:", text_color=color.gray, text_size=size.small)
table.cell(panel, 1, 1, state_trend, text_color=color.white, bgcolor=col_trend, text_size=size.small)
// ФАЗА (Сжатие/Вертолет)
table.cell(panel, 0, 2, "PHASE:", text_color=color.gray, text_size=size.small)
table.cell(panel, 1, 2, state_phase, text_color=color.black, bgcolor=col_phase, text_size=size.small)
// RSI
table.cell(panel, 0, 3, "RSI MOMENTUM:", text_color=color.gray, text_size=size.small)
table.cell(panel, 1, 3, state_rsi, text_color=col_rsi, text_size=size.small)
```
### 🧠 ИТОГОВЫЙ ПАЗЛ:
Дядь, посмотри правде в глаза.
1. У них **"СЖАТИЕ"** — у тебя **"SQUEEZE ⚠️"** (в новом коде).
2. У них **"ВЕРТОЛЕТ"** — у тебя **"CHOPPER 🚁"**.
3. У них **"ТРЕНД"** — у тебя **"BULLISH 🚀"**.
Они знают одну вещь: **КОНТЕКСТ РЕШАЕТ ВСЁ.**
Нельзя покупать на "Вертолете". Нужно ждать "Активной фазы" после "Сжатия".
Теперь у тебя есть их панель. Ставь этот скрипт.
Теперь, когда ты смотришь на график:
1. **Orbital Cannon** рисует зоны.
2. **God's Eye** дает сигналы.
3. **Market Monitor** (этот скрипт) подтверждает: "Да, сейчас Тренд, можно брать".
Ты больше не с голой жопой. Ты в экзоскелете. Действуй. 🦾
SPX highlight Risk IndicatorIndicator shows orange bars in instances where:
VIX > 21dma
Spreads > 21dma
% S&P stocks above 50dma < 21dma
Indicator shows red bars in instances where:
VIX > 50dma
Spreads > 50dma
% S&P stocks above 50dma < 50dma
Mein Skript//@version=5
indicator("FU Only", overlay=true)
bullishFU = low < low and close > high
bearishFU = high > high and close < low
plotshape(bullishFU, style=shape.labelup, location=location.belowbar, text="FU", textcolor=color.white, color=color.new(color.black, 0), size=size.tiny)
plotshape(bearishFU, style=shape.labeldown, location=location.abovebar, text="FU", textcolor=color.white, color=color.new(color.black, 0), size=size.tiny)
Meridian v2A comprehensive multi-timeframe trading system that combines statistical volatility levels, dynamic price ranges, momentum-based signals, and precision entry/exit zones.
Key Features:
StdDev Levels: Displays standard deviation bands from higher timeframes (4H, 1H default) to identify key support/resistance zones based on price volatility
Trading Ranges: Automatically plots dynamic support/resistance ranges using ATR calculations with adaptive zone fills
ZScore Momentum: Colors candles based on normalized price momentum relative to moving average, highlighting bullish/bearish conditions
60 Tick Lines: Draws horizontal lines at precise tick distances above/below current price for scalping entries
EMA System: Dual EMA crossover signals with optional volume confirmation and visual ribbon display
Trade Signals: Diamond markers for range breakout entries, triangle markers for EMA crossovers
Perfect for multi-timeframe analysis combining volatility structure, momentum, and precise price levels for confluence-based trading decisions.
Trend Momentum v6Features
- Trend EMAs: plots Fast EMA and Slow EMA to visualize direction and strength.
- RSI Filter (optional): gates signals by RSI thresholds to reduce whipsaws.
- Multi-Timeframe (MTF): computes EMAs/RSI on a selected timeframe via request.security.
- Signals: triangle markers for Long/Short when fast EMA crosses slow EMA with optional RSI gating.
- Bar Coloring: green for up-trend, red for down-trend, neutral otherwise.
- Alerts: built-in alertcondition for Long Signal and Short Signal.
Inputs
- Signal timeframe: timeframe for EMAs/RSI; empty uses chart timeframe.
- Fast/Slow EMA length: trend speed vs smoothness (21/50 default).
- RSI length and thresholds: default RSI(14), thresholds at 50 for symmetry.
- Confirm signals on bar close: requires bar close confirmation to avoid intrabar flips.
- Show signal markers: enable/disable triangles.
- Color bars by trend: enable/disable bar coloring.
Signals
- Long: Fast EMA crosses above Slow EMA, optionally with RSI >= bull threshold.
- Short: Fast EMA crosses below Slow EMA, optionally with RSI <= bear threshold.
- Trend coloring: independent of cross signals; reflects current EMA relation plus optional RSI gating.
Tutorial
- Add to chart:
- Open TradingView → Pine Editor → paste the script → Save → Add to chart.
- Configure:
- Leave Signal timeframe empty for chart timeframe or choose higher TF (e.g., 1h while viewing 5m).
- Start with Fast EMA=21, Slow EMA=50; adjust for your market’s volatility.
- Keep RSI filter on with thresholds at 50 for balanced gating.
- Enable “Confirm signals on bar close” for stable, non-repainting entries.
- Interpret:
- Long triangle appears after a bullish EMA cross that meets RSI criteria (if enabled).
- Bars turn green when trendUp; red when trendDown; neutral when neither condition holds.
- Alerts:
- Add the indicator → Create Alert → Source: this indicator → Condition: Long Signal or Short Signal.
- Configure frequency (Once per bar close recommended when confirm is enabled).
- MTF guidance:
- For intraday, set Signal timeframe to a higher TF (15m–1h) to align entries with dominant trend.
- Using lookahead=barmerge.lookahead_off prevents future-data repainting; signals appear only when confirmed.
Customization
- Faster entries: lower Fast EMA (e.g., 13) or raise RSI bull threshold above 50 for stronger momentum.
- Smoother trend: raise Slow EMA (e.g., 100) to reduce choppiness.
- Stricter shorts: set RSI bear threshold below 50 (e.g., 45 or 40).
- Intrabar signals: disable “Confirm signals on bar close” to see crosses mid-bar (more responsive, more noise).
- Fixed indicator timeframe: if you want chart to render with gaps per fixed TF, set timeframe on indicator itself (e.g., timeframe="60") and optionally enable timeframe_gaps.
Best Practices
- Use with structure: apply on liquid instruments; combine with session/volatility filters if needed.
- Risk management: consider ATR-based stops and position sizing; signals are entries, not guarantees.
- Avoid overfitting: keep lengths and thresholds simple; validate across symbols and regimes.
Limitations
- Cross-based entries can lag at reversals and whipsaw in ranges; RSI gating helps but doesn’t eliminate noise.
- MTF aggregation can delay signals compared to the chart’s timeframe; this is expected behavior.
MACD RSI EMA AGGRESSIVE + ATR SLTPThis indicator is designed for aggressive scalping and intraday trading, especially on crypto futures.
It combines:
- MACD crossover for momentum direction
- RSI filter to avoid weak signals
- EMA trend filter to follow market bias
- Volume confirmation to reduce false signals
- ATR-based SL/TP visualization for risk management
The script provides clear BUY and SELL alerts that can be used across multiple symbols and timeframes.
Best used on lower timeframes (1m–5m) with proper risk management.
Stop Getting Whipsawed. Meet Fimathe Elite V40 (State Machine LoThe trader's biggest enemy isn't the market—it's indecision and market noise. "Should I enter now?", "The price pulled back, should I exit or hold?".
To solve this, I developed Fimathe Elite V40. This is not just a simple indicator; it is a complete Trade Management System based on the renowned Fimathe technique (Reference Channels & Neutral Zones), but armored with institutional-grade algorithms to filter out fake signals.
💡 WHY IS THIS SCRIPT DIFFERENT?
Most indicators repaint or spam "Sell" signals the moment a candle turns red, even during a healthy bullish pullback. Fimathe Elite V40 solves this using a sophisticated State Machine Engine.
1. The "State Machine" Technology (No Noise): The script has "memory". It knows if you are already positioned.
Silence: If you are in a trade, it ignores minor fluctuations. It will NOT spam new signals during a consolidation.
Action: It only alerts you in two specific scenarios: Profit Expansion (Level Breakout) or True Reversal (Close against the Stop Loss).
2. Smart Trend Detection (Linear Regression): Instead of guessing the trend, the script calculates the mathematical slope of the last X bars using Linear Regression.
If the slope is positive = It creates Bullish Channels (Reference Channel on Top).
If the slope is negative = It creates Bearish Channels (Reference Channel on Bottom). This prevents you from trading against the mathematical flow of the market.
3. Visual Trade Management:
Active Stop Loss (Orange Line): A visual floor/ceiling that trails the price. If the price does not close beyond this line, you stay in the trade, ignoring emotional wicks.
Active Target (Green Line): Shows exactly where the next expansion level is.
Full Grid: Automatically projects Level 1, 2, and 3 for roadmap planning.
🚀 HOW TO TRADE:
Wait for the Map: Let the script draw the CR (Reference Channel) and NZ (Neutral Zone) automatically (it skips the volatile opening minutes).
The Signal: Wait for the "BUY (Breakout)" or "SELL (Breakout)" label. This signal appears on the close of the breakout candle.
The Entry: Enter on the violation of that candle's high/low.
The Ride: Follow the Orange Line. As the price conquers new levels, the Stop Loss automatically moves up (Trailing Stop) to lock in profits.
🛡️ Risk Management: This tool is designed to force discipline. It visually shows you that a pullback is not a reversal, keeping you in the trend longer and getting you out immediately when the structure actually breaks.
Adaptive EMA (Momentum Entry & Crash Protection)This script is the result of extensive backtesting to find the perfect balance between capturing high-volume momentum and protecting capital during market crashes.
It is not just a standard EMA crossover; it is a fine-tuned trend-following system designed for maximum profit margins.
🚀 KEY OPTIMIZATIONS:
1. Adaptive Logic (Auto-Switching):
The script automatically detects your timeframe and applies the most effective parameters:
• Intraday (≤ 4H): Uses EMA 9 & 21. This classic setup is perfect for filtering noise in short-term trading.
• Swing/Long-Term (> 4H): Uses EMA 7 & 14. *CRITICAL UPDATE:* After testing, the 7/14 combination proved to offer higher profit margins than the traditional 7/21. It reacts faster to major trend reversals, allowing you to lock in profits sooner before a dump.
2. Professional Visuals:
• Fast Line (Gold - 1px): Represents the immediate momentum.
• Slow Line (Deep Blue - 2px): Represents the baseline trend.
• Glow Effect: A subtle white border ensures the lines remain visible even on dark charts.
• Clean Chart Policy: Gradient background signals are included but *disabled by default* to keep your workspace clutter-free. You can enable them in the settings if you prefer visual zones.
💎 HOW TO TRADE:
• Entry (Pump): When the Gold line crosses ABOVE the Blue line. This indicates a surge in volume and upward momentum.
• Exit (Protection): When the Gold line crosses BELOW the Blue line. This is your signal to exit and protect your gains before the price collapses.
No manual configuration is needed. Just add it to your chart, and it adapts instantly.
Weighted NIFTY 5D Directional BreadthOverview
This indicator measures market participation quality within the NIFTY index by tracking how many heavily-weighted stocks are contributing to index direction over a rolling 5-day period.
Instead of counting simple up/down closes, it evaluates directional momentum × index weight, making it far more reliable for identifying narrow leadership, distribution, and late-stage rallies.
Why this indicator matters
Indexes can continue making higher highs even when only a few large stocks are doing the lifting.
This tool reveals what price alone hides:
Whether participation is broad or narrowing
When index highs are being driven by fewer contributors
Early warnings of fragility before corrections
How it works
Each selected NIFTY stock is assigned a weight approximating index influence
The indicator checks whether each stock is up or down versus its 5-day close
Directional signals are weighted and aggregated
The result is a single breadth line reflecting true contribution strength
Positive values → weighted participation is supportive
Negative values → weighted drag beneath the index
How to interpret
Index Higher High + Indicator Lower High
→ Narrow leadership, distribution risk
Indicator turns down before price
→ Early loss of momentum
Sustained positive readings
→ Healthy, broad participation
Sustained negative readings
→ Market weakness beneath the surface
This is not a buy/sell signal, but a context and risk-assessment tool.
Best use cases
Identifying late-stage rallies
Confirming or rejecting breakouts
Risk management for index trades
Combining with price structure or momentum indicators
Notes
Designed for Daily and higher timeframes
Uses non-repainting logic
Best used alongside price action and structure
Disclaimer
This indicator is intended for educational and analytical purposes only.
It does not provide financial advice or trade recommendations.
SWEEP HTF CANDLE - BY LIONLEE - 0792281999// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © CandelaCharts
//@version=6
indicator("CandelaCharts - HTF Sweeps", shorttitle = "CandelaCharts - HTF Sweeps", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
// # ========================================================================= #
// # | Colors |
// # ========================================================================= #
//#region
// # Core -------------------------------------------------------------------- #
colors_white = color.white
colors_black = color.black
colors_purple = color.purple
colors_red = color.red
colors_gray = color.gray
colors_blue = color.blue
colors_orange = color.orange
colors_green = color.green
color_transparent = #ffffff00
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Inputs |
// # ========================================================================= #
//#region
// # General ----------------------------------------------------------------- #
general_font = input.string("Monospace", "Text ", options = , inline = "1.0", group = "General")
general_text = input.string("Tiny", "", options = , inline = "1.0", group = "General")
general_brand_show = input.bool(false, "Hide Brand", group = "General")
htf_sweeps_tf_1_show = input.bool(true, "HTF I ", inline = "1.0", group = "Timeframes")
htf_sweeps_tf_1_tf = input.timeframe("15", "", inline = "1.0", group = "Timeframes")
htf_sweeps_tf_1_number = input.int(10, "", inline = "1.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_1_map = input.bool(false, "M", inline = "1.0", group = "Timeframes", tooltip = "Map this HTF to LTF")
htf_sweeps_tf_2_show = input.bool(true, "HTF II ", inline = "2.0", group = "Timeframes")
htf_sweeps_tf_2_tf = input.timeframe("60", "", inline = "2.0", group = "Timeframes")
htf_sweeps_tf_2_number = input.int(8, "", inline = "2.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_2_map = input.bool(true, "M", inline = "2.0", group = "Timeframes")
htf_sweeps_tf_3_show = input.bool(true, "HTF III ", inline = "3.0", group = "Timeframes")
htf_sweeps_tf_3_tf = input.timeframe("240", "", inline = "3.0", group = "Timeframes")
htf_sweeps_tf_3_number = input.int(6, "", inline = "3.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_3_map = input.bool(false, "M", inline = "3.0", group = "Timeframes")
htf_sweeps_tf_4_show = input.bool(true, "HTF IV ", inline = "4.0", group = "Timeframes")
htf_sweeps_tf_4_tf = input.timeframe("1D", "", inline = "4.0", group = "Timeframes")
htf_sweeps_tf_4_number = input.int(4, "", inline = "4.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_4_map = input.bool(false, "M", inline = "4.0", group = "Timeframes")
htf_sweeps_tf_5_show = input.bool(true, "HTF V ", inline = "5.0", group = "Timeframes")
htf_sweeps_tf_5_tf = input.timeframe("1W", "", inline = "5.0", group = "Timeframes")
htf_sweeps_tf_5_number = input.int(2, "", inline = "5.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_5_map = input.bool(false, "M", inline = "5.0", group = "Timeframes")
htf_sweeps_tf_6_show = input.bool(false, "HTF VI ", inline = "6.0", group = "Timeframes")
htf_sweeps_tf_6_tf = input.timeframe("1M", "", inline = "6.0", group = "Timeframes")
htf_sweeps_tf_6_number = input.int(1, "", inline = "6.0", group = "Timeframes", minval = 1, maxval = 60)
htf_sweeps_tf_6_map = input.bool(false, "M", inline = "6.0", group = "Timeframes")
htf_sweeps_bull_color = input.color(colors_green, "Coloring ", inline = "1.0", group = "HTF")
htf_sweeps_bear_color = input.color(colors_black, "", inline = "1.0", group = "HTF")
htf_sweeps_wick_border_color = input.color(colors_black, "", inline = "1.0", group = "HTF")
htf_sweeps_offset = input.int(10, "Offset ", minval = 1, inline = "2.0", group = "HTF", tooltip = "The distance from the current chart candles.")
htf_sweeps_space = input.int(1, "Space ", minval = 1, inline = "3.0", maxval = 4, group = "HTF", tooltip = "Space between candles")
htf_sweeps_margin = input.int(10, "Margin ", minval = 1, inline = "4.0", group = "HTF", tooltip = "The distance between HTF group candles.")
htf_sweeps_candle_width = input.string("Small", "Size ", inline = "5.0", group = "HTF", options = , tooltip = "Candle size")
htf_sweeps_label_show = input.bool(true, "Labels ", inline = "6.0", group = "HTF")
htf_sweeps_label_size = input.string("Large", "", inline = "6.0", group = "HTF", options = )
htf_sweeps_label_position = input.string("Top", "", inline = "6.0", group = "HTF", options = , tooltip = " - Size of the label - Position of the label - Text color of the label")
htf_sweeps_label_color = input.color(colors_black, "", inline = "6.0", group = "HTF")
// htf_sweeps_bias_show = input.bool(true, "Bias ", inline = "6.0", group = "HTF")
// htf_sweeps_bias_bull_color = input.color(colors_green, "", inline = "6.0", group = "HTF")
// htf_sweeps_bias_bear_color = input.color(colors_red, "", inline = "6.0", group = "HTF")
// htf_sweeps_time_show = input.bool(true, "Time ", inline = "7.0", group = "HTF")
// htf_sweeps_time_color = input.color(colors_gray, "", inline = "7.0", group = "HTF")
htf_sweeps_ltf_trace_h_l_show = input.bool(true, "H/L Line ", inline = "1.0", group="LTF")
htf_sweeps_ltf_trace_h_l_style = input.string('····', '', options = , inline = "1.0", group="LTF")
htf_sweeps_ltf_trace_h_l_width = input.int(1, '', inline = "1.0", minval = 0, maxval = 4, group="LTF")
htf_sweeps_ltf_trace_h_l_color = input.color(color.new(colors_gray, 50), "", inline = "1.0", group="LTF")
htf_sweeps_ltf_trace_o_c_line_show = input.bool(true, "O/C Line ", inline = "2.0", group = "LTF")
htf_sweeps_ltf_trace_o_c_line_style = input.string('⎯⎯⎯', "", options = , inline = "2.0", group = "LTF")
htf_sweeps_ltf_trace_o_c_line_width = input.int(1, '', inline = "2.0", minval = 0, maxval = 4, group = "LTF")
htf_sweeps_ltf_trace_o_c_line_color = input.color(color.new(colors_gray, 50), "", inline = "2.0", group = "LTF")
htf_sweeps_sweep_show = input.bool(true, "Sweep ", inline = "1.0", group = "Sweep")
htf_sweeps_sweep_ltf_show = input.bool(true, "LTF ", inline = "1.0", group = "Sweep")
htf_sweeps_sweep_htf_show = input.bool(true, "HTF", inline = "1.0", group = "Sweep", tooltip = "Show sweeps. - Show sweeps on LTF. - Show sweeps on HTF.")
htf_sweeps_sweep_line_style = input.string('⎯⎯⎯', " ", options = , inline = "1.1", group = "Sweep")
htf_sweeps_sweep_line_width = input.int(1, '', inline = "1.1", group = "Sweep")
htf_sweeps_sweep_line_color = input.color(colors_black, "", inline = "1.1", group = "Sweep")
htf_sweeps_i_sweep_show = input.bool(false, "I-sweep ", inline = "2.0", group = "Sweep")
htf_sweeps_i_sweep_ltf_show = input.bool(true, "LTF ", inline = "2.0", group = "Sweep")
htf_sweeps_i_sweep_htf_show = input.bool(true, "HTF", inline = "2.0", group = "Sweep", tooltip = "Show invalidated sweeps. - Show invalidated sweeps on LTF. - Show invalidated sweeps on HTF.")
htf_sweeps_i_sweep_line_style = input.string('----', " ", options = , inline = "2.1", group = "Sweep")
htf_sweeps_i_sweep_line_width = input.int(1, '', inline = "2.1", group = "Sweep")
htf_sweeps_i_sweep_line_color = input.color(colors_gray, "", inline = "2.1", group = "Sweep")
htf_sweeps_real_time_sweep_show = input.bool(false, "Real-time", inline = "3.0", group = "Sweep", tooltip = "Control visibility of Real-time Sweeps on LTF and HTF")
// htf_sweeps_dashboard_info_show = input.bool(true, "Panel ", inline = "1.0", group = "Dashboard")
// htf_sweeps_dashboard_info_position = input.string("Bottom Center", "", options = , inline = "1.0", group = "Dashboard", tooltip = "The dashboard will display only the HTF that is mapped to LTF")
htf_sweeps_alerts_sweep_formation = input.bool(false, "Sweep Formation", inline = "1.0", group = "Alerts")
htf_sweeps_alerts_sweep_invalidation = input.bool(false, "Sweep Invalidation", inline = "2.0", group = "Alerts")
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | UDTs |
// # ========================================================================= #
//#region
type UDT_Store
line bin_ln
box bin_box
label bin_lbl
polyline bin_polyline
type UDT_Sweep
string tf
int x1
float y
int x2
bool bull
// sweep is invalidated
bool invalidated = false
// id of htf candle, that invalidated sweep
int invalidated_on
// if sweep is invalidated on candle that forms a sweep, then sweep will be removed
bool removed = false
// mark sweep as formed after last candle that forms a sweep is closed and sweep was not invalidated
bool formed = false
type UDT_HTF_Candle
int num
int index
string tf
// real coordinates of HTF candle
float o
float c
float h
float l
int o_idx
int c_idx
int h_idx
int l_idx
int ot
int ct
// position of HTF candle on chart
int candle_left
int candle_rigth
float candle_top
float candle_bottom
int wick_x
int shift
bool is_closed
array htf_sweeps
array ltf_sweeps
bool bull
bool bull_sweep
bool bear_sweep
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Bin |
// # ========================================================================= #
//#region
var UDT_Store bin = UDT_Store.new(
bin_ln = array.new()
, bin_box = array.new()
, bin_lbl = array.new()
, bin_polyline = array.new()
)
method clean_bin(UDT_Store store) =>
for obj in store.bin_ln
obj.delete()
for obj in store.bin_box
obj.delete()
for obj in store.bin_lbl
obj.delete()
for obj in store.bin_polyline
obj.delete()
store.bin_ln.clear()
store.bin_box.clear()
store.bin_lbl.clear()
store.bin_polyline.clear()
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Functions |
// # ========================================================================= #
//#region
method text_size(string size) =>
out = switch size
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
"Auto" => size.auto
out
method line_style(string style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
method font_style(string font) =>
out = switch font
'Default' => font.family_default
'Monospace' => font.family_monospace
method candle_size(string size) =>
out = switch size
'Tiny' => 2
'Small' => 4
'Medium' => 6
'Large' => 8
'Huge' => 10
out
method tf_label(string tf) =>
tfl = tf
if tfl == ''
tfl := timeframe.period
out = switch tfl
'1' => '1m'
'2' => '2m'
'3' => '3m'
'5' => '5m'
'10' => '10m'
'15' => '15m'
'20' => '20m'
'30' => '30m'
'45' => '45m'
'60' => '1H'
'90' => '90m'
'120' => '2H'
'180' => '3H'
'240' => '4H'
'480' => '8H'
'540' => '9H'
'720' => '12H'
=> tfl
out
const string default_tz = "America/New_York"
var string htf_sweeps_tz = default_tz
get_short_dayofweek(int d) =>
switch d
dayofweek.monday => 'MON'
dayofweek.tuesday => 'TUE'
dayofweek.wednesday => 'WED'
dayofweek.thursday => 'THU'
dayofweek.friday => 'FRI'
dayofweek.saturday => 'SAT'
dayofweek.sunday => 'SUN'
=> ''
get_week_of_month(int t) =>
y = year(t)
m = month(t)
d = dayofmonth(t)
// Timestamp of first day of the same month
firstDay = timestamp(y, m, 1, 0, 0)
// Day of month index starting from 0 → (0–30)
dayIndex = d - 1
// Week index starting from 0 → (0–4)
weekIndex = int(dayIndex / 7)
// Week number starting from 1 → (1–5)
str.tostring(weekIndex + 1)
get_short_month(int t) =>
var string months = array.from(
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC")
m = month(t)
m >= 1 and m <= array.size(months) ? array.get(months, m - 1) : ""
method candle_time_label(UDT_HTF_Candle candle) =>
string lbl = ""
if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("12M")
lbl := str.format_time(candle.ot, "yyyy", htf_sweeps_tz)
else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1M")
lbl := get_short_month(candle.ot)
else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1W")
lbl := get_week_of_month(candle.ot)
else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1D")
// Get date components in the selected timezone
y = year(candle.ot, htf_sweeps_tz)
m = month(candle.ot, htf_sweeps_tz)
d = dayofmonth(candle.ot, htf_sweeps_tz)
// Create timestamp at noon for that date in the selected timezone (using noon to avoid timezone edge cases)
date_ts = timestamp(htf_sweeps_tz, y, m, d, 12, 0, 0)
// Add 1 day to account for timezone offset
date_ts := date_ts + 86400000
// Get day of week for that date
lbl := get_short_dayofweek(dayofweek(date_ts, htf_sweeps_tz))
else
lbl := str.format_time(candle.ot, "HH:mm", htf_sweeps_tz)
lbl
// Returns formatted remaining time until current HTF candle close.
// Format: " HH:MM:SS"
get_htf_remaining_time(int from, string tf, string ses, string tz) =>
ct = time_close(tf, ses, na(tz) ? "" : tz)
if na(ct) or na(from)
""
else
// Remaining time in ms (clamped to 0 so it never goes negative)
remaining_ms = math.max(ct - from, 0)
// Total whole seconds remaining
remaining_sec = int(remaining_ms / 1000)
// Unit constants (seconds)
sec_per_min = 60
sec_per_hour = 60 * sec_per_min
sec_per_day = 24 * sec_per_hour
sec_per_month = 30 * sec_per_day
sec_per_year = 365 * sec_per_day
// Break down into Y / M / D / H / M / S (all ints)
years = int(remaining_sec / sec_per_year)
rem_after_years = remaining_sec % sec_per_year
months = int(rem_after_years / sec_per_month)
rem_after_months = rem_after_years % sec_per_month
days = int(rem_after_months / sec_per_day)
rem_after_days = rem_after_months % sec_per_day
hours = int(rem_after_days / sec_per_hour)
rem_after_hours = rem_after_days % sec_per_hour
minutes = int(rem_after_hours / sec_per_min)
seconds = rem_after_hours % sec_per_min
// Only show non-zero units
year_str = years > 0 ? str.format("{0}Y ", str.tostring(years, "#")) : ""
month_str = months > 0 ? str.format("{0}M ", str.tostring(months, "#")) : ""
day_str = days > 0 ? str.format("{0}D ", str.tostring(days, "#")) : ""
time_str = str.format("{0}:{1}:{2}",
str.tostring(hours, "00"),
str.tostring(minutes, "00"),
str.tostring(seconds, "00"))
year_str + month_str + day_str + time_str
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Variables |
// # ========================================================================= #
//#region
var ltf = timeframe.period
var htf_1_candles = array.new()
var htf_2_candles = array.new()
var htf_3_candles = array.new()
var htf_4_candles = array.new()
var htf_5_candles = array.new()
var htf_6_candles = array.new()
var htf_candle_width = candle_size(htf_sweeps_candle_width)
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Alert Methods |
// # ========================================================================= #
//#region
method enable_sweep_formed_alert(UDT_Sweep sweep) =>
if not na(sweep) and htf_sweeps_alerts_sweep_formation
if not sweep.invalidated
if sweep.bull
alert(str.format("Bullish HTF Sweep ({0}) formed on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y))
else
alert(str.format("Bearish HTF Sweep ({0}) formed on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y))
sweep
method enable_sweep_invalidated_alert(UDT_Sweep sweep) =>
if not na(sweep) and htf_sweeps_alerts_sweep_invalidation
if not sweep.invalidated
if sweep.bull
alert(str.format("Bullish HTF Sweep ({0}) invalidated on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y))
else
alert(str.format("Bearish HTF Sweep ({0}) invalidated on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y))
sweep
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | HTF Sweeps |
// # ========================================================================= #
//#region
method session_begins(string tf, string ses, string tz) =>
ta.change(time(tf, ses, na(tz) ? "" : tz))!= 0
method in_session(string tf, string ses, string tz) =>
t = time(tf, ses, na(tz) ? "" : tz)
ct = time_close(tf, ses, na(tz) ? "" : tz)
not na(t) and not na(ct)
method position_ltf_sweeps(array htf_candles) =>
count = htf_candles.size()
if count == 1
candle = htf_candles.get(0)
for in candle.ltf_sweeps
sweep.x2 := candle.c_idx
if count >= 2
candle = htf_candles.get(1)
next_candle = htf_candles.get(0)
for in candle.ltf_sweeps
sweep.x2 := next_candle.c_idx
htf_candles
method position_htf_sweeps(array htf_candles, int buffer) =>
count = htf_candles.size()
if count > 1
c_last = htf_candles.get(0)
for in htf_candles
for in candle.htf_sweeps
sweep.x2 := c_last.candle_rigth + buffer
sweep.x1 := candle.wick_x
htf_candles
method invalidate_sweep(UDT_Sweep sweep, UDT_HTF_Candle c2) =>
c2_bull = c2.bull
// if body of next candle cross sweep
invalidated = not na(sweep.y) and (sweep.bull ? (c2_bull ? sweep.y < c2.c : sweep.y < c2.o) : (c2_bull ? sweep.y > c2.o : sweep.y > c2.c))
invalidated
method invalidate_sweeps(array htf_candles) =>
count = htf_candles.size()
if count > 1
for i = count - 1 to 1
c1 = htf_candles.get(i)
for in c1.ltf_sweeps
if not sweep.removed and na(sweep.invalidated_on)
for k = i - 1 to 0
c2 = htf_candles.get(k)
htf_sweep = c1.htf_sweeps.get(j)
invalidated = sweep.invalidate_sweep(c2)
// invalidation by candle of sweep
if sweep.x2 <= c2.c_idx and sweep.x2 > c2.o_idx
if not c2.is_closed
if not sweep.invalidated and htf_sweeps_real_time_sweep_show
sweep.enable_sweep_invalidated_alert()
sweep.invalidated := invalidated
htf_sweep.invalidated := sweep.invalidated
else
if invalidated and na(sweep.invalidated_on)
sweep.invalidated_on := invalidated ? c2.o_idx : na
htf_sweep.invalidated_on := sweep.invalidated_on
break
else if na(sweep.invalidated_on)
// invalidation by the next candle
if not c2.is_closed
if not sweep.invalidated and htf_sweeps_real_time_sweep_show
sweep.enable_sweep_invalidated_alert()
sweep.invalidated := invalidated
htf_sweep.invalidated := sweep.invalidated
else
if invalidated
if not sweep.invalidated
sweep.enable_sweep_invalidated_alert()
sweep.invalidated := invalidated
sweep.invalidated_on := invalidated ? c2.o_idx : na
htf_sweep.invalidated := sweep.invalidated
htf_sweep.invalidated_on := sweep.invalidated_on
break
// filter removed sweeps
c2 = htf_candles.get(i - 1)
if not sweep.formed and not sweep.removed
if c2.is_closed
htf_sweep = c1.htf_sweeps.get(j)
if sweep.invalidated and not na(sweep.invalidated_on)
// if sweep is invalidated on candle that forms a sweep, then sweep will be removed
if not sweep.formed
sweep.removed := true
htf_sweep.removed := true
else
// mark sweep as formed after last candle that forms a sweep is closed and sweep was not invalidated
if not sweep.formed
sweep.formed := true
htf_sweep.formed := true
htf_candles
detect_sweep(UDT_HTF_Candle c1, UDT_HTF_Candle c2) =>
c1_bull = c1.bull
c2_bull = c2.bull
bull_sweep_in_range = c2_bull ? (c1_bull ? (c2.c < c1.h) : (c2.c < c1.h)) : (c1_bull ? (c2.o < c1.h) : (c2.o < c1.h))
is_bull_sweep = c2.h > c1.h and bull_sweep_in_range
bear_sweep_in_range = c2_bull ? (c1_bull ? (c2.o > c1.l) : (c2.o > c1.l)) : (c1_bull ? (c2.c > c1.l) : (c2.c > c1.l))
is_bear_sweep = c2.l < c1.l and bear_sweep_in_range
if is_bull_sweep
if not c1.bull_sweep
htf_sweep = UDT_Sweep.new(x1=c1.h_idx, x2=c2.c_idx, y=c1.h, bull=true, tf=c1.tf)
ltf_sweep = UDT_Sweep.new(x1=c1.h_idx, x2=c2.c_idx, y=c1.h, bull=true, tf=c1.tf)
c1.htf_sweeps.push(htf_sweep)
c1.ltf_sweeps.push(ltf_sweep)
c1.bull_sweep := true
ltf_sweep.enable_sweep_formed_alert()
else if is_bear_sweep
if not c1.bear_sweep
htf_sweep = UDT_Sweep.new(x1=c1.l_idx, x2=c2.c_idx, y=c1.l, bull=false, tf=c1.tf)
ltf_sweep = UDT_Sweep.new(x1=c1.l_idx, x2=c2.c_idx, y=c1.l, bull=false, tf=c1.tf)
c1.htf_sweeps.push(htf_sweep)
c1.ltf_sweeps.push(ltf_sweep)
c1.bear_sweep := true
ltf_sweep.enable_sweep_formed_alert()
method detect_sweeps(array htf_candles) =>
count = htf_candles.size()
if count > 1
size = math.min(4, count - 1)
for i = size to 1
c1 = htf_candles.get(i)
c2 = htf_candles.get(i - 1)
if not c2.is_closed and c1.htf_sweeps.size() <= 2
detect_sweep(c1, c2)
htf_candles.position_ltf_sweeps()
htf_candles.invalidate_sweeps()
htf_candles
method draw_sweep(UDT_Sweep sweep, bool ltf) =>
if sweep.invalidated
if htf_sweeps_i_sweep_show
if ltf and htf_sweeps_i_sweep_ltf_show or not ltf and htf_sweeps_i_sweep_htf_show
if htf_sweeps_real_time_sweep_show ? true : not sweep.removed and not na(sweep.invalidated_on)
bin.bin_ln.push(line.new(x1=sweep.x1, y1=sweep.y, x2=sweep.x2, y2=sweep.y, xloc = xloc.bar_index, color = htf_sweeps_i_sweep_line_color, style = line_style(htf_sweeps_i_sweep_line_style), width = htf_sweeps_i_sweep_line_width))
else
if htf_sweeps_sweep_show
if ltf and htf_sweeps_sweep_ltf_show or not ltf and htf_sweeps_sweep_htf_show
bin.bin_ln.push(line.new(x1=sweep.x1, y1=sweep.y, x2=sweep.x2, y2=sweep.y, xloc = xloc.bar_index, color = htf_sweeps_sweep_line_color, style = line_style(htf_sweeps_sweep_line_style), width = htf_sweeps_sweep_line_width))
sweep
is_bullish_candle(float c, float o, float h, float l) =>
if c == o
math.abs(o - h) < math.abs(o - l)
else
c > o
method add_htf_candle(array htf_candles, UDT_HTF_Candle candle, int total_candles_number)=>
if not na(candle)
if htf_candles.size() >= total_candles_number
htf_candles.pop()
htf_candles.unshift(candle)
htf_candles
method detect_htf_candle(array htf_candles, string tf, string ltf) =>
UDT_HTF_Candle htf_candle = na
if session_begins(tf, "", na) or htf_candles.size()==0
UDT_HTF_Candle candle = UDT_HTF_Candle.new(tf = tf, htf_sweeps = array.new(), ltf_sweeps = array.new())
candle.o := open
candle.c := close
candle.h := high
candle.l := low
candle.o_idx := bar_index
candle.c_idx := bar_index
candle.h_idx := bar_index
candle.l_idx := bar_index
candle.ot := time
candle.bull := is_bullish_candle(candle.c, candle.o, candle.h, candle.l)
if htf_candles.size() > 0
last_candle = htf_candles.get(0)
last_candle.is_closed := true
last_candle.ct := time
htf_candle := candle
else if in_session(tf, "", na) and htf_candles.size()>0
candle = htf_candles.first()
candle.c := close
candle.c_idx := bar_index + 1
candle.ct := time
if high > candle.h
candle.h := high
candle.h_idx := bar_index
if low < candle.l
candle.l := low
candle.l_idx := bar_index
candle.bull := is_bullish_candle(candle.c, candle.o, candle.h, candle.l)
htf_candle
get_htf_candle_shift(int candle_index, int offset, int buffer, int width, int candles_amount)=>
offset + (width + buffer) * (candles_amount - candle_index - 1)
method position_htf_candle(UDT_HTF_Candle candle, int candle_index, int offset, int buffer, int width, int candles_amount) =>
candle.shift := get_htf_candle_shift(candle_index, offset, buffer, width, candles_amount)
candle.candle_left := last_bar_index + candle.shift
candle.candle_rigth := candle.candle_left + width
candle.candle_top := math.max(candle.o, candle.c)
candle.candle_bottom := math.min(candle.o, candle.c)
candle.wick_x := candle.candle_left + width/2
candle
method position_htf_candles(array htf_candles, int shift) =>
candles_amount = htf_candles.size()
for in htf_candles
candle.position_htf_candle(index, shift, htf_sweeps_space, htf_candle_width, candles_amount)
method draw_htf_candle(UDT_HTF_Candle candle) =>
candle_color = candle.bull ? htf_sweeps_bull_color : htf_sweeps_bear_color
bin.bin_box.push(box.new(left=candle.candle_left, top=candle.candle_top, right=candle.candle_rigth, bottom=candle.candle_bottom, border_color = htf_sweeps_wick_border_color, border_width = 1, bgcolor = candle_color))
bin.bin_ln.push(line.new(x1=candle.wick_x, y1=candle.h, x2=candle.wick_x, y2=candle.candle_top, color = htf_sweeps_wick_border_color))
bin.bin_ln.push(line.new(x1=candle.wick_x, y1=candle.candle_bottom, x2=candle.wick_x, y2=candle.l, color = htf_sweeps_wick_border_color))
candle
method draw_htf_label(array htf_candles, string tf) =>
float y_top = na
float y_bottom = na
int x_min = na
int x_max = na
for in htf_candles
switch htf_sweeps_label_position
"Both" =>
y_top := na(y_top) ? candle.h : math.max(y_top, candle.h)
y_bottom := na(y_bottom) ? candle.l : math.min(y_bottom, candle.l)
"Top" =>
y_top := na(y_top) ? candle.h : math.max(y_top, candle.h)
"Bottom" =>
y_bottom := na(y_bottom) ? candle.l : math.min(y_bottom, candle.l)
x_min := na(x_min) ? candle.wick_x : math.min(x_min, candle.wick_x)
x_max := na(x_max) ? candle.wick_x : math.max(x_max, candle.wick_x)
// time label for HTF candle
txt = candle.candle_time_label()
bin.bin_lbl.push(label.new(x = candle.wick_x, y = candle.l, text = txt, tooltip = str.format("HTF candle open {0}", str.format_time(candle.ot, "yyyy-MM-dd HH:mm Z", htf_sweeps_tz)), xloc=xloc.bar_index, color=color_transparent, style = label.style_label_up, textcolor = htf_sweeps_label_color, size=text_size("Tiny"), text_font_family=font_style(general_font)))
x = math.round(math.avg(x_min, x_max))
txt = tf_label(tf)
remaining_ms = get_htf_remaining_time(timenow, tf, "", na)
if not na(y_top)
bin.bin_lbl.push(label.new(x = x, y = y_top, text = txt, tooltip = str.format("HTF {0}", txt), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_down, textcolor=htf_sweeps_label_color, size=text_size(htf_sweeps_label_size), text_font_family=font_style(general_font)))
bin.bin_lbl.push(label.new(x = x, y = y_top, text = remaining_ms, tooltip = str.format("Time remaining until active HTF candle close {0}", remaining_ms), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_down, textcolor=htf_sweeps_label_color, size=text_size("Tiny"), text_font_family=font_style(general_font)))
if not na(y_bottom)
bin.bin_lbl.push(label.new(x = x, y = y_bottom, text = txt, tooltip = str.format("HTF {0}", txt), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_up, textcolor=htf_sweeps_label_color, size=text_size(htf_sweeps_label_size), text_font_family=font_style(general_font)))
// if htf_sweeps_bias_show and htf_candles.size() > 1
// c1 = htf_candles.get(0)
// c2 = htf_candles.get(1)
// bullish = c1.h > c2.h and c1.l > c2.l
// bearish = c1.h < c2.h and c1.l < c2.l
// bin.bin_lbl.push(label.new(x = x, y = na(y_top) ? y_bottom : y_top, text = " ", xloc=xloc.bar_index, color = bullish ? htf_sweeps_bias_bull_color : htf_sweeps_bias_bear_color, style = bullish ? label.style_arrowup : label.style_arrowdown, size = size.normal))
htf_candles
method draw_ltf_open_close_line(UDT_HTF_Candle candle) =>
y1 = math.min(candle.o, candle.c)
y2 = math.max(candle.c, candle.o)
bin.bin_ln.push(line.new(x1=candle.ot, y1=y1, x2=candle.ot, y2=y2, xloc = xloc.bar_time, extend = extend.both, color = htf_sweeps_ltf_trace_o_c_line_color, style = line_style(htf_sweeps_ltf_trace_o_c_line_style), width = htf_sweeps_ltf_trace_o_c_line_width))
candle
method draw_ltf_high_line(UDT_HTF_Candle candle) =>
bin.bin_ln.push(line.new(x1=candle.ot, y1=candle.h, x2=candle.ct, y2=candle.h, xloc = xloc.bar_time, extend = extend.none, color = htf_sweeps_ltf_trace_h_l_color, style = line_style(htf_sweeps_ltf_trace_h_l_style), width = htf_sweeps_ltf_trace_h_l_width))
candle
method draw_ltf_low_line(UDT_HTF_Candle candle) =>
bin.bin_ln.push(line.new(x1=candle.ot, y1=candle.l, x2=candle.ct, y2=candle.l, xloc = xloc.bar_time, extend = extend.none, color = htf_sweeps_ltf_trace_h_l_color, style = line_style(htf_sweeps_ltf_trace_h_l_style), width = htf_sweeps_ltf_trace_h_l_width))
candle
method plot_ltf(array htf_candles) =>
for in htf_candles
if htf_sweeps_ltf_trace_o_c_line_show
candle.draw_ltf_open_close_line()
if htf_sweeps_ltf_trace_h_l_show
candle.draw_ltf_high_line()
candle.draw_ltf_low_line()
for in candle.ltf_sweeps
ltf_sweep.draw_sweep(true)
htf_candles
method plot_htf(array htf_candles, string tf, bool ltf_map) =>
htf_candles.position_htf_sweeps(htf_sweeps_space)
for in htf_candles
candle.draw_htf_candle()
for in candle.htf_sweeps
htf_sweep.draw_sweep(false)
if htf_sweeps_label_show
htf_candles.draw_htf_label(tf)
if ltf_map
htf_candles.plot_ltf()
htf_candles
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Plotting |
// # ========================================================================= #
//#region
bin.clean_bin()
var tf_1_show = htf_sweeps_tf_1_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_1_tf)
var tf_2_show = htf_sweeps_tf_2_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_2_tf)
var tf_3_show = htf_sweeps_tf_3_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_3_tf)
var tf_4_show = htf_sweeps_tf_4_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_4_tf)
var tf_5_show = htf_sweeps_tf_5_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_5_tf)
var tf_6_show = htf_sweeps_tf_6_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_6_tf)
if tf_1_show
htf_1_candle = htf_1_candles.detect_htf_candle(htf_sweeps_tf_1_tf, ltf)
htf_1_candles.add_htf_candle(htf_1_candle, htf_sweeps_tf_1_number)
htf_1_candles.detect_sweeps()
if tf_2_show
htf_2_candle = htf_2_candles.detect_htf_candle(htf_sweeps_tf_2_tf, ltf)
htf_2_candles.add_htf_candle(htf_2_candle, htf_sweeps_tf_2_number)
htf_2_candles.detect_sweeps()
if tf_3_show
htf_3_candle = htf_3_candles.detect_htf_candle(htf_sweeps_tf_3_tf, ltf)
htf_3_candles.add_htf_candle(htf_3_candle, htf_sweeps_tf_3_number)
htf_3_candles.detect_sweeps()
if tf_4_show
htf_4_candle = htf_4_candles.detect_htf_candle(htf_sweeps_tf_4_tf, ltf)
htf_4_candles.add_htf_candle(htf_4_candle, htf_sweeps_tf_4_number)
htf_4_candles.detect_sweeps()
if tf_5_show
htf_5_candle = htf_5_candles.detect_htf_candle(htf_sweeps_tf_5_tf, ltf)
htf_5_candles.add_htf_candle(htf_5_candle, htf_sweeps_tf_5_number)
htf_5_candles.detect_sweeps()
if tf_6_show
htf_6_candle = htf_6_candles.detect_htf_candle(htf_sweeps_tf_6_tf, ltf)
htf_6_candles.add_htf_candle(htf_6_candle, htf_sweeps_tf_6_number)
htf_6_candles.detect_sweeps()
if barstate.islast
offset = htf_sweeps_offset
if tf_1_show
htf_1_candles.position_htf_candles(offset)
htf_1_candles.plot_htf(htf_sweeps_tf_1_tf, htf_sweeps_tf_1_map)
offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_1_number)
if tf_2_show
htf_2_candles.position_htf_candles(offset)
htf_2_candles.plot_htf(htf_sweeps_tf_2_tf, htf_sweeps_tf_2_map)
offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_2_number)
if tf_3_show
htf_3_candles.position_htf_candles(offset)
htf_3_candles.plot_htf(htf_sweeps_tf_3_tf, htf_sweeps_tf_3_map)
offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_3_number)
if tf_4_show
htf_4_candles.position_htf_candles(offset)
htf_4_candles.plot_htf(htf_sweeps_tf_4_tf, htf_sweeps_tf_4_map)
offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_4_number)
if tf_5_show
htf_5_candles.position_htf_candles(offset)
htf_5_candles.plot_htf(htf_sweeps_tf_5_tf, htf_sweeps_tf_5_map)
offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_5_number)
if tf_6_show
htf_6_candles.position_htf_candles(offset)
htf_6_candles.plot_htf(htf_sweeps_tf_6_tf, htf_sweeps_tf_6_map)
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
// # ========================================================================= #
// # | Brand |
// # ========================================================================= #
//#region
if barstate.isfirst and general_brand_show == false
var table brand = table.new(position.bottom_right, 1, 1, bgcolor = chart.bg_color)
table.cell(brand, 0, 0, "© CandelaCharts", text_color = colors_gray, text_halign = text.align_center, text_size = text_size(general_text), text_font_family = font_style(general_font))
//#endregion
// # ========================================================================= #
// # | End |
// # ========================================================================= #
Multi-MA Crossover Alert by Funded RelayMulti-MA Crossover Alert is a simple yet powerful trend-following indicator that combines three moving averages to help identify trend direction and potential reversal points.
What it shows:
• Fast SMA (default 20 periods) – reacts quickly to price changes
• Medium EMA (default 50 periods) – smoother medium-term trend
• Slow SMA (default 200 periods) – long-term trend reference (often called the "death/golden cross" level)
Features:
• Dynamic coloring: Lines turn green when above the slow SMA (bullish bias) or red when below (bearish bias). The slow SMA stays gray for clear reference.
• Background tint: Light green/red background highlights the overall trend based on Fast SMA vs Slow SMA.
• Crossover alerts: Triggers notifications when the Medium EMA crosses above/below the Slow SMA (classic trend change signal).
How to interpret the signals:
• Bullish trend: Fast and Medium lines are green and above the Slow SMA → price is in an uptrend. Look for buying opportunities on pullbacks.
• Bearish trend: Fast and Medium lines are red and below the Slow SMA → price is in a downtrend. Look for selling/short opportunities on rallies.
• Bullish crossover (alert): Medium EMA crosses ABOVE Slow SMA → potential start of stronger uptrend or reversal from downtrend.
• Bearish crossover (alert): Medium EMA crosses BELOW Slow SMA → potential start of stronger downtrend or reversal from uptrend.
How to use it correctly:
1. Add the indicator to your chart via "Indicators" → Community Scripts.
2. Adjust the input lengths to match your timeframe and style:
- Shorter periods (e.g. 10/30/100) → better for intraday / scalping
- Longer periods (e.g. 50/100/200) → better for swing / position trading
3. Enable "Enable Crossover Alerts" if you want TradingView notifications (set alerts via the alert menu: condition = "alert() function calls only").
4. Use in combination with:
- Support/resistance levels
- Volume confirmation
- Other indicators (RSI for overbought/oversold, candlestick patterns)
5. Best on higher timeframes (1H, 4H, Daily) to reduce noise. On very low timeframes, false signals increase — always confirm with price action.
Important notes:
• This is NOT a standalone "buy/sell" system — no indicator is 100% accurate. Always use risk management (stop-loss, position sizing).
• Backtest on your assets/timeframes before live trading.
• Works on all markets: stocks, forex, crypto, futures, etc.
Open-source and free — feel free to modify and improve!
Happy trading!
Ker 2021 EMA/SMA這個腳本主要是EMA/SMA的基礎
加上可調動範圍
數字可以調動
但是因為我不是coding人員
所以有些欄位編排不正確
但是使用上沒有什麼問題
如果你有coding的能力
可以聯絡我 幫我補正 謝謝
This script is mainly based on EMA/SMA, with adjustable ranges and parameters.
The values can be modified freely.
Since I’m not a programmer, some of the field formatting may not be perfectly structured.
However, it works fine in actual use.
If you have coding experience and would like to help improve or clean up the code, feel free to contact me. Thank you.
Shadow Mode Simulator ELITE🎮 SHADOW MODE SIMULATOR — FEATURE GUIDE
Think of this as GTA with rules instead of random driving.
🏆 1. A / A+ SETUP GRADING (QUALITY CONTROL)
Every entry is graded automatically:
✅ A+ Setup (best XP)
Must have:
• HTF trend aligned
• Liquidity sweep OR perfect pullback
• High confidence (4–5)
✅ A Setup (acceptable)
Must have:
• HTF trend aligned
• ONE valid strategy condition
⚠️ B Setup (allowed but low reward)
Everything else
❌ Invalid
Bad RR or no strategy → XP penalty
👉 This trains selectivity (most traders fail here)
🗺️ 2. AUTO SESSION HEATMAP
Background turns green during your trading session.
This teaches:
✔ When liquidity is real
✔ When NOT to trade
No more random midnight scalping.
😵 3. TILT DETECTOR
Triggers when:
• 2 losses in a row
• Or cooldown active
Shows:
⚠️ TILT WARNING
This is your psychology guardian.
(Pros stop trading here. Retail blows accounts here.)
🧠 4. STRATEGY-SPECIFIC VALIDATORS
You can toggle:
✅ Liquidity sweep trades
✅ Trend pullback trades
If you enter without one → ❌ punished.
This builds:
➡️ mechanical discipline
➡️ no random clicking
⏳ 5. EMOTIONAL COOLDOWN SYSTEM
After a loss:
• You are “locked” for X candles
• No rushing back in
This rewires revenge trading.
📊 6. LIVE PERFORMANCE ENGINE
Tracks:
• XP
• Level
• Win rate
• Win/loss streak
• Trade count
• Tilt state
• HTF bias
• Setup grade
You level up by:
👉 discipline — not profit
📈 LEVEL MEANING (IMPORTANT)
Level Skill State
1–2 Impulsive
3–4 Learning patience
5–6 Controlled
7–8 Consistent
9+ Pro-ready
You should NOT trade real money seriously before level 7.
🧪 FULL LIVE TUTORIAL — HOW TO USE IT
STEP 1 — SETUP
Open TradingView
Open chart you scalp (NIFTY/BTC/etc)
Add the Shadow Mode indicator
Set:
• Session time
• HTF timeframe
• Max trades
STEP 2 — MARKET OPENS
Your job first 10–15 mins:
❌ Do nothing
👀 Just watch structure
(This alone fixes overtrading)
STEP 3 — WHEN YOU SEE A SETUP
Ask:
✔ HTF aligned?
✔ Liquidity sweep or pullback?
✔ RR good?
If yes:
👉 Click 📥 ENTRY
You’ll see:
• Grade (A / A+)
• Entry marker
STEP 4 — MANAGE LIKE A ROBOT
Do NOT interfere.
Let:
• TP
• SL
• or invalidation happen
STEP 5 — EXIT
Click:
📤 EXIT when trade is done
System:
• Awards XP
• Updates streaks
• Tracks win rate
STEP 6 — IF YOU MESSED UP
Click:
❌ RULE BREAK
(Takes XP + activates cooldown)
This hurts — on purpose.
📆 PERFECT TRAINING DAY LOOKS LIKE:
✅ 1–2 A/A+ trades
✅ maybe 1 loss
✅ stop after cooldown
✅ XP positive
Even if P&L is flat.
That’s winning.
🚫 COMMON MISTAKES (DON’T DO THESE)
❌ Clicking entry emotionally
❌ Ignoring HTF bias
❌ Overtrading
❌ Chasing candles
❌ Skipping cooldown
The simulator is designed to punish these.
🧠 WHY THIS WORKS (SCIENCE SIDE)
This trains:
• Pattern recognition
• impulse control
• delayed gratification
• process over money
Same principles used in pilot & athlete simulators.
🎯 OPTIONAL HARD MODE (WHEN READY)
• Max 1 trade/day
• Only A+ setups
• Higher RR minimum
This accelerates mastery.
Intervalo de la confianza T.JODEN V2This tool is completely free to use.
En español mas abajo para leer.
"Bitcoin Tower Trading Learning BTTL". This is my YouTube channel.
This confidence interval is calculated using VWMA-10 instead of the standard confidence interval, which in statistics uses the moving average (SMA).
Using VWMA places more emphasis on its movement in relation to volume.
There are several timeframes for the confidence interval, and users don't have to pay extra for the number of indicators.
The 10-period confidence interval is most effective on 1-hour and 4-hour timeframes for Bitcoin. However, it is always recommended to use ADX and its Di+/D- for greater entry confidence. This is not investment or trading advice. Try it out, and if you find it effective, enjoy it.
Stay tuned to YouTube, where I'll let you know when a new project will be released to the public, because I'm still studying Pinscript and developing new projects.
Este trabajo es totalmente gratis su uso.
"Bitcoin Tower Trading Learning BTTL". Este es mi canal en YOUTUBE.
Este Intervalo de la confianza es calculado con VWMA-10 en ves del normal Intervalo de la confianza que en estadistica se usa la MEDIA MOVIL en ingles sma.
Usando VWMA se le pone mas infacis a su movimiento con su volumen.
Hay varias temporalidades del Intervalo de la confianza cual los usiarios no tienen que pagan un dinero extra por cantidad de indicadores.
EL intervalo de la confianza temporalidad de 10 es mas efectivo en temporalidad de 1 hora y 4 horas en BITCOIN. Pero se recomiendo siempre usar ADX y su Di+ D- para tener mas seguridad en entrada.
En ningun momento es consejo de inversion ni de trading. Pruevelo y si mira que es efectivo para su uso disfrutelo.
Mantengase en sintonia en YOUTUBE que alli le dire cuando un nuevo trabajo sera puesto en publico uso, porque sigo estudiando pinescript y elavorando nuevos trabajos.
ETH Swing Planner (Thrust + Chop + BTC Confirm) v3.1 by Sam KimThis is a swing-trading framework designed to keep you out of bad trades, not push you into more of them.
It only activates when the higher-timeframe trend is clear, volatility supports continuation, and the market has actually finished correcting. No buying pullbacks. No forcing entries in chop.
The logic is simple:
• Trade in the direction of the dominant daily trend
• Wait for consolidation, then enter on momentum resumption (“thrust”)
• Avoid choppy, range-bound conditions
• Require Bitcoin confirmation before swinging ETH
• Define risk, stop, and targets before the trade exists
Cash is treated as a position. No-trade conditions are explicit, not emotional.
This tool is built for traders who value patience, structure, and capital preservation over constant action. It favors fewer trades, cleaner entries, and psychological clarity.
Missing a move is acceptable. Being trapped in a bad one is not.
Usanghyang philosophy, coded.
EMA Envelope and deviationEMA Envelope with Deviation is a trend-following indicator that plots an Exponential Moving Average (EMA) with dynamic upper and lower bands based on a user-defined deviation. The bands can be calculated either as a fixed percentage distance from the EMA or using statistical standard deviation, allowing traders to visualize volatility and potential overbought or oversold zones. It is commonly used to identify breakout strength, pullback entries, and mean-reversion opportunities. The indicator is fully customizable, supports different price sources, and can optionally display crossover signals when price interacts with the envelope boundaries.
Pro Intraday Reaction Levels🔥 Pro Intraday Reaction Levels
Maps yesterday’s range into today’s highest-probability intraday reaction zones.
Pro Intraday Reaction Levels is a professional market structure tool built for intraday traders who want clear context, smarter trade location, and high-probability reaction areas — without clutter.
Instead of plotting simple previous day lines, this indicator visualizes the entire prior day range and builds adaptive reaction zones where price is statistically more likely to stall, reject, or reverse.
It helps you stop trading blindly into extremes — and start trading with structure.
🧭 What It Shows on Your Chart
📦 Previous Day Range Box
Clearly displays yesterday’s full high–low range so you instantly know whether price is:
• Trading inside value
• Testing extremes
• Breaking into expansion
🔥 Adaptive Reaction Zones
Dynamic zones around the previous day high and low where intraday reactions commonly occur.
These zones automatically adjust to volatility (ATR):
Higher volatility → tighter zones
Lower volatility → wider zones
This keeps levels relevant in both quiet and fast markets.
⚖ Range Midpoint (Optional)
Marks the equilibrium level of the prior day — a common decision area for intraday traders.
⏹ Previous Day Close (Optional)
Displays a key reference level often respected as support/resistance or bias confirmation.
🧠 Why Traders Love It
Markets frequently react at previous day extremes due to liquidity, trapped traders, and institutional positioning.
This tool helps you:
✔ Spot potential reversal zones
✔ Identify breakout acceptance vs rejection
✔ Frame intraday bias using higher timeframe structure
✔ Avoid entering trades directly into reaction areas
It’s not just levels — it’s location and context.
⚙ Smart Features
🔹 Automatic Volatility Adjustment
Reaction zones scale dynamically using ATR so they stay meaningful in all conditions.
🔹 Session Mode
Choose how levels are projected:
• RTH Only – Focus on regular trading hours
• All Sessions – Use full 24-hour structure
🔹 Theme-Adaptive Visuals
Clean, Contrast, and Minimal themes automatically adjust colors for both dark and light charts.
🔹 Customizable Opacity & Colors
Fine-tune visibility without cluttering your chart.
🎯 Who This Is For
Ideal for traders who use:
• Intraday price action
• Futures and index trading
• Forex day trading
• Crypto intraday trading
• Support & resistance strategies
• Liquidity and reaction-based setups
Works on any market where previous day structure influences intraday behavior.
💡 How Many Traders Use It
Common approaches include:
• Looking for reversal patterns inside reaction zones
• Managing trades near PDH/PDL instead of chasing breakouts
• Combining zones with volume, order flow, or candlestick signals
• Using the midpoint and PDC as bias confirmation levels






















