Smart Reversal Signal (Stoch + RSI + EQH/EQL)Smart Reversal Signal combines Stochastic oscillator, RSI levels, and Equal High/Low detection to identify potential price reversal zones. It highlights buy signals when Stochastic crosses up in oversold conditions with RSI confirmation and Equal Low (EQL), and sell signals when Stochastic crosses down in overbought areas with Equal High (EQH), shown via background color alerts.
Chart patterns
RSI Candlestick//@version=5
indicator("RSI Candlestick", overlay=false)
length = input(14, title="RSI Length")
rsi = ta.rsi(close, length)
// RSI를 캔들로 변환 (예: RSI의 시가, 고가, 저가, 종가 계산)
rsi_open = rsi // 이전 RSI 값
rsi_close = rsi // 현재 RSI 값
rsi_high = math.max(rsi, rsi_open) // 고가는 현재와 이전 중 큰 값
rsi_low = math.min(rsi, rsi_open) // 저가는 현재와 이전 중 작은 값
// 캔들 플롯
plotcandle(rsi_open, rsi_high, rsi_low, rsi_close, title="RSI Candles", color=rsi_close > rsi_open ? color.green : color.red)
MA 3/20/200 mit Trendverlängerung📊 3-Line MA Pack – Clean Trend Tracking with Projection
Fast. Clear. No fluff.
This script shows:
🔴 MA 3 – short-term momentum
🟠 MA 20 – medium trend flow
🔵 MA 200 – long-term direction
All lines extend forward based on recent slope – automatically adjusted to your timeframe.
Perfect for traders who want to see the flow at a glance.
Plug it in. Read the trend. Trade smarter.
No noise – just structure.
Turtle God IndicatorThe Turtle God indicator displays a turtle icon 🐢 on the most recent candle only, helping traders track current candle behavior at a glance.
✅ Green Turtle above the candle if it’s bullish (close > open)
🔻 Red Turtle below the candle if it’s bearish (close < open)
📌 Only the latest candle is marked — no historical clutter
This tool is useful for:
Live price action observation
Real-time signal overlays
Clean chart setups with dynamic candle feedback
Inside/Multiple Inside Bars Detector by Yasser R.01Multiple Inside Bars Trading System
Detects multiple inside bar patterns with visual alerts, breakout signals, and risk management levels (1:2 RR ratio). Identifies high-probability trading setups.
This indicator scans for consecutive inside bar patterns (2+ bars forming within a 'mother bar'), which often precede strong breakouts. When detected, it:
1. Draws clear reference lines showing the mother bar's high/low
2. Alerts when price breaks either level
3. Automatically calculates 1:2 risk-reward stop loss and take profit levels
4. Displays entry points with trade details
Ideal for swing traders, the system helps identify consolidation periods before potential trend continuations. Works best on 4H/Daily timeframes.
#InsideBars #BreakoutTrading #RiskManagement #SwingTrading #PriceAction
Professional-grade inside bar detector that:
✅ Identifies single AND multiple inside bar setups
✅ Provides clean visual references (lines/labels)
✅ Generates breakout signals with calculated RR levels
✅ Self-cleaning - removes old setups automatically
Use alongside trend analysis for best results. Customizable in Settings.
Setup Score OscillatorSetup Score Oscillator – Full Description
🎯 Purpose of the Script
This script is a manual trading setup scoring tool, designed to help traders quantify the quality of a trade setup by combining multiple technical, cyclical, and contextual signals.
Instead of relying on a single indicator, the trader manually selects which signals are present, and the script calculates a total score (0–100%), displayed as an oscillator in a separate panel (like RSI or MACD).
🔧 How it works in practice
1. Manual signal inputs
The script presents a set of checkboxes in the settings, where the trader can enable/disable the following signals:
✅ Confirmed Support/Resistance
✅ Aligned Volume Profile
✅ Favorable Cyclic Timing
✅ Valid Trend Line
✅ Aligned Cyclical Moving Averages
✅ Relevant Fibonacci Level
✅ Classic Volume Signal (spike, dry-up, etc.)
✅ Oscillator confirmation (e.g., divergences)
✅ Extreme Sentiment
✅ Relevant or incoming News
Each selected signal contributes to the total score based on its weight.
2. Scoring system
Each signal has a default weight (e.g., 20% for support/resistance, 15% for cycles, etc.).
Optionally, the trader can enable the “custom weights” checkbox and adjust each signal’s weight directly in the settings.
3. Score visualization
The final score (sum of all active weights) is plotted as an oscillator ranging from 0 to 100%, with dynamic coloring:
Range Color Meaning
0–39% Red No valid setup
40–54% Yellow Watchlist only
55–69% Orange Good setup
70–100% Green Strong setup
Several horizontal threshold lines are displayed:
50% → neutral threshold
40%, 55%, 70% → operational levels
4. Optional background coloring
When the score exceeds 55% or 70%, the oscillator background lightly changes color to highlight stronger setups (non-intrusive).
📌 Practical benefits
Objectifies subjective analysis: each decision becomes a number.
Prevents overtrading: no entries if the score is too low.
Adaptable to any trading style: swing, intraday, positional.
User-friendly: no coding needed – just tick boxes.
Italiano:
Setup Score Oscillator – Descrizione completa
🎯 Obiettivo dello script
Lo script è uno strumento manuale di valutazione dei setup di trading, pensato per aiutare il trader a quantificare la qualità di un'opportunità operativa basandosi su più segnali tecnici, ciclici e contestuali.
Invece di affidarsi a un solo indicatore, il trader seleziona manualmente quali segnali sono presenti, e lo script calcola un punteggio complessivo percentuale (0–100%), rappresentato come oscillatore in una finestra separata (tipo RSI, MACD, ecc.).
🔧 Come funziona operativamente
1. Input manuale dei segnali
Lo script mostra una serie di checkbox nelle impostazioni, dove il trader può attivare o disattivare i seguenti segnali:
✅ Supporto/Resistenza confermata
✅ Volume Profile allineato
✅ Cicli o timing favorevole
✅ Trend line valida
✅ Medie mobili cicliche allineate
✅ Livello di Fibonacci rilevante
✅ Volume classico significativo (spike, dry-up)
✅ Conferme da oscillatori (es. divergenze)
✅ Sentiment estremo (es. euforia o panico)
✅ News importanti imminenti o appena uscite
Ogni casella attiva contribuisce al punteggio totale, con un peso specifico.
2. Sistema di punteggio
Ogni segnale ha un peso predefinito (es. 20% per supporti/resistenze, 15% per cicli, ecc.).
Facoltativamente, il trader può attivare la funzione “Enable custom weights” per personalizzare i pesi di ciascun segnale direttamente da input.
3. Visualizzazione del punteggio
Il punteggio complessivo (somma dei pesi attivati) viene tracciato come oscillatore da 0 a 100%, con colori dinamici:
Range Colore Significato
0–39% Rosso Nessun setup valido
40–54% Giallo Osservazione
55–69% Arancione Setup buono
70–1005 Verde Setup forte
Sono tracciate anche delle linee guida orizzontali a:
50% → soglia neutra
40%, 55%, 70% → soglie operative
4. Colorazione dello sfondo (facoltativa)
Quando il punteggio supera 55% o 70%, lo sfondo dell’oscillatore cambia leggermente colore per evidenziare il segnale (non invasivo).
📌 Vantaggi pratici
Oggettivizza l’analisi soggettiva: ogni decisione manuale si trasforma in un numero.
Evita overtrading: se il punteggio è troppo basso, non si entra.
Adattabile a ogni stile: swing, intraday, position.
Facile da usare anche senza codice: basta spuntare le caselle.
Breakout Zones with Candle Color and BackgroundThis Pine Script highlights support/resistance breakout zones with background colors and marks consolidation areas using yellow candles:
🟥 Red background = Bearish breakout (below support)
🟩 Green background = Bullish breakout (above resistance)
🟨 Yellow candles = Price inside support-resistance range (consolidation/build-up)
Great for spotting breakouts and range-bound setups visually.
Coffee Box Ninja- Time zone and automatic box for the COFFEE BOX strategy based on New York time.
- Auto update for summer and winter time
--------------------------------------------------------------------------------------
- Rango de horarios y caja automatica para la estrategia COFFEE BOX basado en horarios de Nueva York.
- Actualizacion automatica horario de verano en invierno
-------------------------------------------------------------------------------------
Wyckoff Ninja 🥷🏼
linktr.ee
This indicator highlights a specific time range during the New York trading session by drawing a dynamic box that captures the high and low between the defined start and end times. It is useful for identifying price ranges during important market windows, such as the "coffee time" box from 8:30 AM to 10:00 AM (NY time). The box updates as the session progresses and finalizes when the range ends.
Simple 4EMA Lines简洁4EMA移动平均线 - 纯净趋势分析工具
📊 功能特点:
• 四条EMA线:7、20、90、180周期(可自定义)
• 简洁设计,无多余元素干扰
• 完全可自定义颜色和线条样式
• 支持偏移量调整
🎯 适用场景:
• 基础趋势分析
• 支撑阻力位参考
• 多时间框架分析
• 作为其他指标的基础层
💡 使用方法:
• 价格在EMA上方看多,下方看空
• EMA排列判断趋势强弱
• EMA交叉关注趋势转换信号
⚙️ 优势:
• 界面简洁清晰
• 资源占用少
• 适合叠加其他指标
• 适用所有交易品种和周期
经典移动平均线工具,适合所有级别的交易者使用。
Simple 4EMA Lines - Clean Trend Analysis Tool
📊 Features:
• Four EMA lines: 7, 20, 90, 180 periods (customizable)
• Clean design without visual clutter
• Fully customizable colors and line styles
• Offset adjustment support
🎯 Use Cases:
• Basic trend analysis
• Support/resistance reference
• Multi-timeframe analysis
• Foundation layer for other indicators
💡 Usage:
• Price above EMA = bullish bias
• Price below EMA = bearish bias
• EMA crossovers signal potential trend changes
⚙️ Advantages:
• Clean and clear interface
• Low resource usage
• Perfect for indicator overlay
• Works on all instruments and timeframes
Classic moving average tool suitable for traders of all levels.
4EMA Moving Average Group4EMA移动平均线组合 - 专业趋势分析指标
📈 核心功能:
• 四条EMA线:7、20、90、180周期
• Vegas隧道填充效果,清晰显示趋势通道
• 自动识别多头/空头排列
• 可选趋势背景颜色提示
• 支持EMA平滑处理和布林带扩展
🎯 使用场景:
• 趋势跟踪和方向判断
• 支撑阻力位识别
• 入场出场时机选择
• 多时间框架分析
💡 交易信号:
• 多头信号:EMA呈7>20>90>180排列 + 价格在EMA上方
• 空头信号:EMA呈7<20<90<180排列 + 价格在EMA下方
• 填充区域作为动态支撑阻力参考
⚙️ 特色功能:
• 完全可自定义颜色和透明度
• 灵活的显示选项控制
• 多种平滑算法可选
• 适用于所有时间周期
适合各级别交易者使用,建议结合其他技术指标综合分析。
4EMA Moving Average Group - Professional Trend Analysis Indicator
📈 Core Features:
• Four EMA lines: 7, 20, 90, 180 periods
• Vegas Tunnel fill effect for clear trend channels
• Automatic bullish/bearish alignment detection
• Optional trend background color alerts
• EMA smoothing and Bollinger Bands extension support
🎯 Use Cases:
• Trend following and direction analysis
• Support/resistance level identification
• Entry/exit timing optimization
• Multi-timeframe analysis
💡 Trading Signals:
• Bullish: EMA alignment 7>20>90>180 + price above EMAs
• Bearish: EMA alignment 7<20<90>180 + price below EMAs
• Fill areas serve as dynamic support/resistance zones
⚙️ Key Features:
• Fully customizable colors and transparency
• Flexible display options
• Multiple smoothing algorithms available
• Works on all timeframes
Suitable for traders of all levels. Recommended to use with other technical indicators for comprehensive analysis.
Smart Reversal Signal (Stoch + RSI + EQH/EQL) - TF + Lookback📌 Smart Reversal Signal (Stoch + RSI + EQH/EQL)
This custom TradingView indicator identifies potential trend reversal signals using a combination of Stochastic Oscillator, Relative Strength Index (RSI), and Equal Highs/Lows (EQH/EQL) based on a higher timeframe.
✅ Key Features:
Stochastic %K and %D Cross
Detects bullish reversal when %K crosses above %D in oversold zone (< 20)
Detects bearish reversal when %K crosses below %D in overbought zone (> 80)
RSI Signal Confirmation
Bullish when RSI crosses above the oversold level (e.g., 30)
Bearish when RSI crosses below the overbought level (e.g., 70)
Equal High / Low Zones (EQH/EQL)
Confirms price is reversing near previous unbroken highs/lows (within % tolerance)
Uses customizable higher timeframe (e.g., 1H) and user-defined lookback period
Buy Signal:
RSI crosses up from oversold
Stochastic %K crosses above %D
Price near an Equal Low (EQL)
Sell Signal:
RSI crosses down from overbought
Stochastic %K crosses below %D
Price near an Equal High (EQH)
Visual Aids:
Background highlights (green for Buy, red for Sell)
RSI and Stochastic plots with overbought/oversold levels
Alert conditions for Buy and Sell triggers
⚙️ Customizable Inputs:
Stochastic and RSI lengths
Overbought/Oversold levels
Tolerance for EQH/EQL zones (%)
Timeframe for EQH/EQL detection
Lookback bars to define EQ zones
📈 Use Case:
This indicator helps traders detect high-probability reversal zones by aligning:
Momentum shifts (via RSI & Stochastic)
Price structure zones (EQH/EQL)
Ideal for swing trading, mean reversion strategies, or trend reversal confirmations.
Trend TraderDescription and Usage of the "Trend Trader" Indicator
The "Trend Trader" indicator, created by Gerardo Mercado as a legacy project, is a versatile trading tool designed to identify potential buy and sell signals across various instruments. While it provides predefined settings for popular instruments like US30, NDX100, GER40, and GOLD, it can be seamlessly adapted to any market, including forex pairs like EUR/USD. The indicator combines moving averages, time-based filters, and MACD confirmation to enhance decision-making for traders.
How It Works
Custom Moving Averages (MAs):
The indicator uses two moving averages:
Short MA: A faster-moving average (default: 10 periods).
Long MA: A slower-moving average (default: 100 periods).
Buy signals are generated when the Short MA crosses above the Long MA.
Sell signals are triggered when the Short MA crosses below the Long MA.
Time-Based Signals:
The user can define specific trading session times (start and end in UTC) to focus on high-activity periods for their chosen market.
Signals and background coloring are only active during the allowed session times.
MACD Confirmation:
A MACD (Moving Average Convergence Divergence) calculation on a 15-minute timeframe ensures stronger confirmation for signals.
Buy signals require the MACD line to be above the signal line.
Sell signals require the MACD line to be at or below the signal line.
Target Levels:
Predefined profit targets are dynamically set based on the selected trading instrument.
While it includes settings for US30, NDX100, GER40, and GOLD, the target levels can be adjusted to fit the volatility and structure of any asset, including forex pairs like EUR/USD.
Target 1 and Target 2 levels display when these thresholds are met after an entry signal.
Adaptability to Any Market:
Although predefined options are included for specific instruments, the indicator's moving averages, time settings, and MACD logic are applicable to any tradable asset, making it suitable for forex, commodities, indices, and more.
Visual Alerts:
Labels appear on the chart to highlight "BUY" and "SELL" signals at crossover points.
Additional labels indicate when price movements reach the predefined target levels.
Bar and background coloring visually represent active signals and MACD alignment.
Purpose
The indicator aims to simplify trend-following and momentum-based trading strategies. By integrating moving averages, MACD, customizable time sessions, and dynamic targets, it offers clear entry and exit points while being adaptable to the needs of individual traders across diverse markets.
How to Use
Setup:
Add the indicator to your TradingView chart.
Configure the moving average periods, trading session times, and target levels according to your preferences.
Select the instrument for predefined target settings or customize them to fit the asset you’re trading (e.g., EUR/USD or other forex pairs).
Interpreting Signals:
Buy Signal: The Short MA crosses above the Long MA, MACD confirms the upward trend, and the session is active.
Sell Signal: The Short MA crosses below the Long MA, MACD confirms the downward trend, and the session is active.
Adapt for Any Instrument:
Adjust the predefined target levels to match the volatility and trading style for your chosen asset.
For forex pairs like EUR/USD, consider typical pip movements to set appropriate profit targets.
Targets:
Use the provided target labels (e.g., 50 or 100 points) or customize them to reflect realistic profit goals based on the asset’s volatility.
Visual Aids:
Pay attention to the background color:
Greenish: Indicates a bullish trend during the allowed session.
Redish: Indicates a bearish trend during the allowed session.
Use the "BUY" and "SELL" labels for actionable insights.
This indicator is a flexible and powerful tool, suitable for traders across all markets. Its adaptability ensures that it can enhance your strategy, whether you’re trading forex, commodities, indices, or other assets. By offering actionable alerts and customizable settings, the "Trend Trader" serves as a valuable addition to any trader’s toolkit. FX:EURUSD
Smart Entry System//@version=5
indicator("Smart Entry System", overlay=true)
// ── Inputs ──
len = input.int(20, title="Structure Lookback")
// ── Market Structure Shift ──
mssBuy = low < ta.lowest(low, len) and high > ta.highest(high, len)
mssSell = high > ta.highest(high, len) and low < ta.lowest(low, len)
// ── Fair Value Gap ──
fvgUp = low > high and low > high
fvgDown = high < low and high < low
// ── Breaker Block ──
breakerBuy = close > open and close < open and close > open
breakerSell = close < open and close > open and close < open
// ── Inversion Point ──
inversionBuy = close > high and close < high
inversionSell = close < low and close > low
// ── Fibonacci Levels ──
var float fibHigh = na
var float fibLow = na
if mssBuy
fibLow := low
fibHigh := ta.highest(high, len)
else if mssSell
fibHigh := high
fibLow := ta.lowest(low, len)
// Avoid plotting if values are not ready
validFib = not na(fibHigh) and not na(fibLow)
fib38 = validFib ? fibHigh - (fibHigh - fibLow) * 0.382 : na
fib61 = validFib ? fibHigh - (fibHigh - fibLow) * 0.618 : na
plot(fib38, title="Fib 38.2%", color=color.gray, linewidth=1)
plot(fib61, title="Fib 61.8%", color=color.gray, linewidth=1)
// ── Entry Conditions ──
buyEntry = mssBuy and fvgUp and breakerBuy and inversionBuy and close < fib61
sellEntry = mssSell and fvgDown and breakerSell and inversionSell and close > fib38
// ── Entry Plot ──
plotshape(buyEntry, title="Buy Entry", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellEntry, title="Sell Entry", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
Multi-Timeframe Hammer Confirmation Labelson 15 minutes, 1 hour , 4 hours, and daily time frame only, a hammer candle is formed and the following candle closes above hammer high, print white label HC15 below the hammer candle on 15 minutes chart, HC1H, HC4H and HCD when it is on the corresponding time frame.
Bullish Engulfing with MA ConditionsWith MA20 below MA200, with price action below MA20. this time put green labels. on 15 minutes, 30 minutes, 1 hour , 4 hours, and daily time frame only, a bullish engulfing pattern is formed. print yellow label BE15, BE30, BE1H, BE4H and BED when it is on the corresponding time frame.
Enhanced MA Cloud Guru ProEnhanced MA Cloud Guru Pro — Indicator Description
The Enhanced MA Cloud Guru Pro is a multi-layered trend and signal tool designed to visualize both short-term momentum and long-term trend context using six customizable moving averages.
🔹 Core Features:
MA Clouds:
Two distinct "clouds" are plotted:
MA Cloud 1–3 (short-term trend)
MA Cloud 4–6 (long-term trend)
Clouds are color-coded: bullish, bearish, or neutral, based on moving average alignment.
Contrarian Crossover Signals:
Buy signal: when MA1 crosses above MA3, but long-term cloud (MA4–6) is bearish or neutral — suggesting a potential reversal or early trend shift.
Sell signal: when MA1 crosses below MA3, while MA4–6 is bullish or neutral — indicating a possible breakdown or reversal.
Cloud-to-Cloud Entry Signals:
Bullish signal: when the short-term MA cloud enters upward into the long-term cloud from below.
Bearish signal: when the short-term MA cloud enters downward into the long-term cloud from above.
These mark potential trend transition zones or conflict between timeframes.
Cooldown Logic:
Adjustable cooldown bars prevent signal clustering and reduce noise.
🔹 Customization:
All MAs are independently adjustable in length and type (SMA, EMA, WMA, HMA).
Cloud transparency, colors, and signal timing can be tailored to user preference.
🧠 Use Case:
This indicator is ideal for:
Traders who want early trend reversal clues (contrarian logic)
Visualizing interaction between short- and long-term structure
Combining momentum shifts with long-term trend filters
Volatility Quality [Alpha Extract]The Alpha-Extract Volatility Quality (AVQ) Indicator provides traders with deep insights into market volatility by measuring the directional strength of price movements. This sophisticated momentum-based tool helps identify overbought and oversold conditions, offering actionable buy and sell signals based on volatility trends and standard deviation bands.
🔶 CALCULATION
The indicator processes volatility quality data through a series of analytical steps:
Bar Range Calculation: Measures true range (TR) to capture price volatility.
Directional Weighting: Applies directional bias (positive for bullish candles, negative for bearish) to the true range.
VQI Computation: Uses an exponential moving average (EMA) of weighted volatility to derive the Volatility Quality Index (VQI).
vqiRaw = ta.ema(weightedVol, vqiLen)
Smoothing: Applies an additional EMA to smooth the VQI for clearer signals.
Normalization: Optionally normalizes VQI to a -100/+100 scale based on historical highs and lows.
Standard Deviation Bands: Calculates three upper and lower bands using standard deviation multipliers for volatility thresholds.
vqiStdev = ta.stdev(vqiSmoothed, vqiLen)
upperBand1 = vqiSmoothed + (vqiStdev * stdevMultiplier1)
upperBand2 = vqiSmoothed + (vqiStdev * stdevMultiplier2)
upperBand3 = vqiSmoothed + (vqiStdev * stdevMultiplier3)
lowerBand1 = vqiSmoothed - (vqiStdev * stdevMultiplier1)
lowerBand2 = vqiSmoothed - (vqiStdev * stdevMultiplier2)
lowerBand3 = vqiSmoothed - (vqiStdev * stdevMultiplier3)
Signal Generation: Produces overbought/oversold signals when VQI reaches extreme levels (±200 in normalized mode).
Formula:
Bar Range = True Range (TR)
Weighted Volatility = Bar Range × (Close > Open ? 1 : Close < Open ? -1 : 0)
VQI Raw = EMA(Weighted Volatility, VQI Length)
VQI Smoothed = EMA(VQI Raw, Smoothing Length)
VQI Normalized = ((VQI Smoothed - Lowest VQI) / (Highest VQI - Lowest VQI) - 0.5) × 200
Upper Band N = VQI Smoothed + (StdDev(VQI Smoothed, VQI Length) × Multiplier N)
Lower Band N = VQI Smoothed - (StdDev(VQI Smoothed, VQI Length) × Multiplier N)
🔶 DETAILS
Visual Features:
VQI Plot: Displays VQI as a line or histogram (lime for positive, red for negative).
Standard Deviation Bands: Plots three upper and lower bands (teal for upper, grayscale for lower) to indicate volatility thresholds.
Reference Levels: Horizontal lines at 0 (neutral), +100, and -100 (in normalized mode) for context.
Zone Highlighting: Overbought (⋎ above bars) and oversold (⋏ below bars) signals for extreme VQI levels (±200 in normalized mode).
Candle Coloring: Optional candle overlay colored by VQI direction (lime for positive, red for negative).
Interpretation:
VQI ≥ 200 (Normalized): Overbought condition, strong sell signal.
VQI 100–200: High volatility, potential selling opportunity.
VQI 0–100: Neutral bullish momentum.
VQI 0 to -100: Neutral bearish momentum.
VQI -100 to -200: High volatility, strong bearish momentum.
VQI ≤ -200 (Normalized): Oversold condition, strong buy signal.
🔶 EXAMPLES
Overbought Signal Detection: When VQI exceeds 200 (normalized), the indicator flags potential market tops with a red ⋎ symbol.
Example: During strong uptrends, VQI reaching 200 has historically preceded corrections, allowing traders to secure profits.
Oversold Signal Detection: When VQI falls below -200 (normalized), a lime ⋏ symbol highlights potential buying opportunities.
Example: In bearish markets, VQI dropping below -200 has marked reversal points for profitable long entries.
Volatility Trend Tracking: The VQI plot and bands help traders visualize shifts in market momentum.
Example: A rising VQI crossing above zero with widening bands indicates strengthening bullish momentum, guiding traders to hold or enter long positions.
Dynamic Support/Resistance: Standard deviation bands act as dynamic volatility thresholds during price movements.
Example: Price reversals often occur near the third standard deviation bands, providing reliable entry/exit points during volatile periods.
🔶 SETTINGS
Customization Options:
VQI Length: Adjust the EMA period for VQI calculation (default: 14, range: 1–50).
Smoothing Length: Set the EMA period for smoothing (default: 5, range: 1–50).
Standard Deviation Multipliers: Customize multipliers for bands (defaults: 1.0, 2.0, 3.0).
Normalization: Toggle normalization to -100/+100 scale and adjust lookback period (default: 200, min: 50).
Display Style: Switch between line or histogram plot for VQI.
Candle Overlay: Enable/disable VQI-colored candles (lime for positive, red for negative).
The Alpha-Extract Volatility Quality Indicator empowers traders with a robust tool to navigate market volatility. By combining directional price range analysis with smoothed volatility metrics, it identifies overbought and oversold conditions, offering clear buy and sell signals. The customizable standard deviation bands and optional normalization provide precise context for market conditions, enabling traders to make informed decisions across various market cycles.
10 MA > 21 MA HighlightWhen the 10 day is above the 21 MA , this script will show a light green color on the screen
Multifractal Forecast [ScorsoneEnterprises]Multifractal Forecast Indicator
The Multifractal Forecast is an indicator designed to model and forecast asset price movements using a multifractal framework. It uses concepts from fractal geometry and stochastic processes, specifically the Multifractal Model of Asset Returns (MMAR) and fractional Brownian motion (fBm), to generate price forecasts based on historical price data. The indicator visualizes potential future price paths as colored lines, providing traders with a probabilistic view of price trends over a specified trading time scale. Below is a detailed breakdown of the indicator’s functionality, inputs, calculations, and visualization.
Overview
Purpose: The indicator forecasts future price movements by simulating multiple price paths based on a multifractal model, which accounts for the complex, non-linear behavior of financial markets.
Key Concepts:
Multifractal Model of Asset Returns (MMAR): Models price movements as a multifractal process, capturing varying degrees of volatility and self-similarity across different time scales.
Fractional Brownian Motion (fBm): A generalization of Brownian motion that incorporates long-range dependence and self-similarity, controlled by the Hurst exponent.
Binomial Cascade: Used to model trading time, introducing heterogeneity in time scales to reflect market activity bursts.
Hurst Exponent: Measures the degree of long-term memory in the price series (persistence, randomness, or mean-reversion).
Rescaled Range (R/S) Analysis: Estimates the Hurst exponent to quantify the fractal nature of the price series.
Inputs
The indicator allows users to customize its behavior through several input parameters, each influencing the multifractal model and forecast generation:
Maximum Lag (max_lag):
Type: Integer
Default: 50
Minimum: 5
Purpose: Determines the maximum lag used in the rescaled range (R/S) analysis to calculate the Hurst exponent. A higher lag increases the sample size for Hurst estimation but may smooth out short-term dynamics.
2 to the n values in the Multifractal Model (n):
Type: Integer
Default: 4
Purpose: Defines the resolution of the multifractal model by setting the size of arrays used in calculations (N = 2^n). For example, n=4 results in N=16 data points. Larger n increases computational complexity and detail but may exceed Pine Script’s array size limits (capped at 100,000).
Multiplier for Binomial Cascade (m):
Type: Float
Default: 0.8
Purpose: Controls the asymmetry in the binomial cascade, which models trading time. The multiplier m (and its complement 2.0 - m) determines how mass is distributed across time scales. Values closer to 1 create more balanced cascades, while values further from 1 introduce more variability.
Length Scale for fBm (L):
Type: Float
Default: 100,000.0
Purpose: Scales the fractional Brownian motion output, affecting the amplitude of simulated price paths. Larger values increase the magnitude of forecasted price movements.
Cumulative Sum (cum):
Type: Integer (0 or 1)
Default: 1
Purpose: Toggles whether the fBm output is cumulatively summed (1=On, 0=Off). When enabled, the fBm series is accumulated to simulate a price path with memory, resembling a random walk with long-range dependence.
Trading Time Scale (T):
Type: Integer
Default: 5
Purpose: Defines the forecast horizon in bars (20 bars into the future). It also scales the binomial cascade’s output to align with the desired trading time frame.
Number of Simulations (num_simulations):
Type: Integer
Default: 5
Minimum: 1
Purpose: Specifies how many forecast paths are simulated and plotted. More simulations provide a broader range of possible price outcomes but increase computational load.
Core Calculations
The indicator combines several mathematical and statistical techniques to generate price forecasts. Below is a step-by-step explanation of its calculations:
Log Returns (lgr):
The indicator calculates log returns as math.log(close / close ) when both the current and previous close prices are positive. This measures the relative price change in a logarithmic scale, which is standard for financial time series analysis to stabilize variance.
Hurst Exponent Estimation (get_hurst_exponent):
Purpose: Estimates the Hurst exponent (H) to quantify the degree of long-term memory in the price series.
Method: Uses rescaled range (R/S) analysis:
For each lag from 2 to max_lag, the function calc_rescaled_range computes the rescaled range:
Calculate the mean of the log returns over the lag period.
Compute the cumulative deviation from the mean.
Find the range (max - min) of the cumulative deviation.
Divide the range by the standard deviation of the log returns to get the rescaled range.
The log of the rescaled range (log(R/S)) is regressed against the log of the lag (log(lag)) using the polyfit_slope function.
The slope of this regression is the Hurst exponent (H).
Interpretation:
H = 0.5: Random walk (no memory, like standard Brownian motion).
H > 0.5: Persistent behavior (trends tend to continue).
H < 0.5: Mean-reverting behavior (price tends to revert to the mean).
Fractional Brownian Motion (get_fbm):
Purpose: Generates a fractional Brownian motion series to model price movements with long-range dependence.
Inputs: n (array size 2^n), H (Hurst exponent), L (length scale), cum (cumulative sum toggle).
Method:
Computes covariance for fBm using the formula: 0.5 * (|i+1|^(2H) - 2 * |i|^(2H) + |i-1|^(2H)).
Uses Hosking’s method (referenced from Columbia University’s implementation) to generate fBm:
Initializes arrays for covariance (cov), intermediate calculations (phi, psi), and output.
Iteratively computes the fBm series by incorporating a random term scaled by the variance (v) and covariance structure.
Applies scaling based on L / N^H to adjust the amplitude.
Optionally applies cumulative summation if cum = 1 to produce a path with memory.
Output: An array of 2^n values representing the fBm series.
Binomial Cascade (get_binomial_cascade):
Purpose: Models trading time (theta) to account for non-uniform market activity (e.g., bursts of volatility).
Inputs: n (array size 2^n), m (multiplier), T (trading time scale).
Method:
Initializes an array of size 2^n with values of 1.0.
Iteratively applies a binomial cascade:
For each block (from 0 to n-1), splits the array into segments.
Randomly assigns a multiplier (m or 2.0 - m) to each segment, redistributing mass.
Normalizes the array by dividing by its sum and scales by T.
Checks for array size limits to prevent Pine Script errors.
Output: An array (theta) representing the trading time, which warps the fBm to reflect market activity.
Interpolation (interpolate_fbm):
Purpose: Maps the fBm series to the trading time scale to produce a forecast.
Method:
Computes the cumulative sum of theta and normalizes it to .
Interpolates the fBm series linearly based on the normalized trading time.
Ensures the output aligns with the trading time scale (T).
Output: An array of interpolated fBm values representing log returns over the forecast horizon.
Price Path Generation:
For each simulation (up to num_simulations):
Generates an fBm series using get_fbm.
Interpolates it with the trading time (theta) using interpolate_fbm.
Converts log returns to price levels:
Starts with the current close price.
For each step i in the forecast horizon (T), computes the price as prev_price * exp(log_return).
Output: An array of price levels for each simulation.
Visualization:
Trigger: Updates every T bars when the bar state is confirmed (barstate.isconfirmed).
Process:
Clears previous lines from line_array.
For each simulation, plots a line from the current bar’s close price to the forecasted price at bar_index + T.
Colors the line using a gradient (color.from_gradient) based on the final forecasted price relative to the minimum and maximum forecasted prices across all simulations (red for lower prices, teal for higher prices).
Output: Multiple colored lines on the chart, each representing a possible price path over the next T bars.
How It Works on the Chart
Initialization: On each bar, the indicator calculates the Hurst exponent (H) using historical log returns and prepares the trading time (theta) using the binomial cascade.
Forecast Generation: Every T bars, it generates num_simulations price paths:
Each path starts at the current close price.
Uses fBm to model log returns, warped by the trading time.
Converts log returns to price levels.
Plotting: Draws lines from the current bar to the forecasted price T bars ahead, with colors indicating relative price levels.
Dynamic Updates: The forecast updates every T bars, replacing old lines with new ones based on the latest price data and calculations.
Key Features
Multifractal Modeling: Captures complex market dynamics by combining fBm (long-range dependence) with a binomial cascade (non-uniform time).
Customizable Parameters: Allows users to adjust the forecast horizon, model resolution, scaling, and number of simulations.
Probabilistic Forecast: Multiple simulations provide a range of possible price outcomes, helping traders assess uncertainty.
Visual Clarity: Gradient-colored lines make it easy to distinguish bullish (teal) and bearish (red) forecasts.
Potential Use Cases
Trend Analysis: Identify potential price trends or reversals based on the direction and spread of forecast lines.
Risk Assessment: Evaluate the range of possible price outcomes to gauge market uncertainty.
Volatility Analysis: The Hurst exponent and binomial cascade provide insights into market persistence and volatility clustering.
Limitations
Computational Intensity: Large values of n or num_simulations may slow down execution or hit Pine Script’s array size limits.
Randomness: The binomial cascade and fBm rely on random terms (math.random), which may lead to variability between runs.
Assumptions: The model assumes log-normal price movements and fractal behavior, which may not always hold in extreme market conditions.
Adjusting Inputs:
Set max_lag based on the desired depth of historical analysis.
Adjust n for model resolution (start with 4–6 to avoid performance issues).
Tune m to control trading time variability (0.5–1.5 is typical).
Set L to scale the forecast amplitude (experiment with values like 10,000–1,000,000).
Choose T based on your trading horizon (20 for short-term, 50 for longer-term for example).
Select num_simulations for the number of forecast paths (5–10 is reasonable for visualization).
Interpret Output:
Teal lines suggest bullish scenarios, red lines suggest bearish scenarios.
A wide spread of lines indicates high uncertainty; convergence suggests a stronger trend.
Monitor Updates: Forecasts update every T bars, so check the chart periodically for new projections.
Chart Examples
This is a daily AMEX:SPY chart with default settings. We see the simulations being done every T bars and they provide a range for us to analyze with a few simulations still in the range.
On this intraday PEPPERSTONE:COCOA chart I modified the Length Scale for fBm, L, parameter to be 1000 from 100000. Adjusting the parameter as you switch between timeframes can give you more contextual simulations.
On BITSTAMP:ETHUSD I modified the L to be 1000000 to have a more contextual set of simulations with crypto's volatile nature.
With L at 100000 we see the range for NASDAQ:TLT is correctly simulated. The recent pop stays within the bounds of the highest simulation. Note this is a cherry picked example to show the power and potential of these simulations.
Technical Notes
Error Handling: The script includes checks for array size limits and division by zero (math.abs(denominator) > 1e-10, v := math.max(v, 1e-10)).
External Reference: The fBm implementation is based on Hosking’s method (www.columbia.edu), ensuring a robust algorithm.
Conclusion
The Multifractal Forecast is a powerful tool for traders seeking to model complex market dynamics using a multifractal framework. By combining fBm, binomial cascades, and Hurst exponent analysis, it generates probabilistic price forecasts that account for long-range dependence and non-uniform market activity. Its customizable inputs and clear visualizations make it suitable for both technical analysis and strategy development, though users should be mindful of its computational demands and parameter sensitivity. For optimal use, experiment with input settings and validate forecasts against other technical indicators or market conditions.
Eliora Phase 4.2.2 – Precision Bloom Mode | DAX 5minPhase shifts and market cohesion using math. Sure! Let’s break down the **simple trading bot concept** for **TradingView** step by step, focusing on the logic, purpose, and key elements of the strategy. This bot uses a **trend-following strategy** combined with **risk management** to automate trades based on moving averages and the RSI indicator.
---
### **Trading Bot Concept:**
#### **Objective:**
The primary objective of this bot is to **identify trends** and **execute buy and sell orders** based on those trends, while also ensuring **risk management** through stop-loss and take-profit levels.
The bot uses two **core indicators**:
* **Exponential Moving Averages (EMAs)**: To identify the trend direction.
* **Relative Strength Index (RSI)**: To filter out overbought and oversold conditions, helping avoid entering trades during extreme market conditions.
---
### **Key Components:**
#### 1. **Exponential Moving Averages (EMA)**
* **50-period EMA** (Short-Term Trend): Tracks the price's movement in the recent past, offering more weight to recent prices. This helps the bot react quicker to short-term market shifts.
* **200-period EMA** (Long-Term Trend): Represents the broader market trend, helping the bot assess the overall market direction.
**Buy Signal**:
* A buy signal is triggered when the **50-period EMA crosses above** the **200-period EMA** (a **bullish crossover**), suggesting that the market is entering an uptrend.
**Sell Signal**:
* A sell signal is triggered when the **50-period EMA crosses below** the **200-period EMA** (a **bearish crossover**), indicating that the market might be reversing into a downtrend.
#### 2. **Relative Strength Index (RSI)**
* **RSI** is a momentum oscillator that measures the speed and change of price movements, indicating whether an asset is overbought or oversold.
* **Buy Condition**: The bot only takes buy trades if the **RSI is above 30**. This ensures that the market isn't in an **oversold** condition, which could indicate a potential reversal.
* **Sell Condition**: The bot will only take sell actions if the **RSI is below 70**, avoiding trades during **overbought** conditions where prices might be excessively high.
---
### **How the Bot Works:**
1. **Buy Signal Conditions:**
* The **50-period EMA** crosses **above** the **200-period EMA** (bullish crossover), indicating the potential start of an uptrend.
* The **RSI is above 30**, ensuring that the market isn’t oversold and a reversal isn’t imminent.
* If both of these conditions are true, the bot will **enter a long (buy) position**.
2. **Sell Signal Conditions:**
* The **50-period EMA** crosses **below** the **200-period EMA** (bearish crossover), signaling that the market might be transitioning into a downtrend.
* The **RSI is below 70**, meaning the market isn’t in an overbought state and the sell-off is not due to excessive bullish momentum.
* If both of these conditions are met, the bot will **exit** any long position (i.e., sell).
---
### **Risk Management:**
To protect against significant losses, the bot includes two essential features of **risk management**:
1. **Stop-Loss**:
* The bot will automatically **exit the trade if the price moves against it by 2%** (or another user-defined percentage). This minimizes potential losses in case the market moves unfavorably after entry.
2. **Take-Profit**:
* The bot will automatically **exit the trade once it reaches a profit of 5%** (or another user-defined percentage). This locks in profits if the market moves favorably.
---
### **Script Breakdown:**
Here’s the **key flow** of the Pine Script:
1. **Define Parameters**: The script begins by defining input values for the **EMA periods** and **RSI length**. It also defines the **RSI overbought (70)** and **RSI oversold (30)** levels.
2. **Calculate the EMAs and RSI**:
* The 50-period and 200-period **EMAs** are calculated using the `ta.ema()` function.
* The **RSI** is calculated using `ta.rsi()`, and it helps determine if the asset is overbought or oversold.
3. **Trading Conditions**:
* A buy signal is generated when the **short-term EMA crosses above** the **long-term EMA** and the RSI is **above 30**.
* A sell signal is triggered when the **short-term EMA crosses below** the **long-term EMA** and the RSI is **below 70**.
4. **Strategy Execution**:
* When the buy condition is met, the bot **enters a long position** using `strategy.entry()`.
* When the sell condition is met, the bot **closes the position** using `strategy.close()`.
5. **Risk Management**:
* The `strategy.exit()` function is used to set **stop-loss** and **take-profit** values. If the price moves **2% against** the trade, the bot will exit. If it moves **5% in favor**, it will lock in profits.
---
### **Visual Elements**:
1. **EMAs**:
* The **50-period EMA** is plotted in **green**.
* The **200-period EMA** is plotted in **red**.
2. **RSI**:
* The **RSI line** is plotted in **blue** on a separate pane below the main chart.
* Horizontal lines mark the **overbought** (70) and **oversold** (30) levels, helping visualize potential reversal zones.
3. **Buy and Sell Signals**:
* When the bot triggers a buy, a **green arrow** appears on the chart.
* When it triggers a sell, a **red arrow** appears on the chart.
---
### **How to Use the Bot on TradingView:**
1. **Go to TradingView** and open a chart of the asset you want to trade.
2. **Click on the "Pine Editor"** tab at the bottom.
3. **Paste the script** provided into the editor.
4. **Click "Add to Chart"** to see the strategy in action.
5. The bot will begin executing trades based on the logic described and display buy/sell signals directly on the chart.
---
### **Advantages of This Strategy**:
* **Trend-Following**: This bot is based on the classic moving average crossover strategy, which is effective in trending markets.
* **Simple and Clear**: The logic is easy to follow and understand, making it beginner-friendly.
* **Built-in Risk Management**: The stop-loss and take-profit functionality ensures that the bot limits potential losses and locks in profits automatically.
* **Customizable**: You can easily tweak the parameters (e.g., EMA periods, RSI levels, stop-loss, take-profit) to fit different timeframes or market conditions.
---
### **Limitations**:
* **Sideways Markets**: The bot might struggle in flat or sideways markets because moving average crossovers can produce false signals.
* **No Advanced Features**: It doesn’t incorporate more advanced strategies like **momentum indicators**, **news sentiment**, or **machine learning models** for decision-making.
---
### **In Conclusion:**
This is a **basic but effective trend-following trading bot** that you can deploy on TradingView with minimal effort. It provides a great foundation for traders who want to automate a simple strategy with **risk management**, while offering plenty of room for customization and improvement.
Let me know if you want to explore more complex features or strategies, or if you need help tweaking the bot for specific assets or markets!