Bollinger Bands Trading Signals with Win Rate AnalysisAdvanced Bollinger Bands Analysis System
English Description
This comprehensive Bollinger Bands analysis system incorporates multiple advanced techniques beyond basic price crossings, providing a sophisticated approach to market analysis and signal generation.
Advanced Analysis Methods:
Multi-Level Bollinger Bands
Inner Bands (1σ): Early warning zones
Standard Bands (2σ): Traditional support/resistance
Outer Bands (2.5σ): Extreme levels
BB Width Analysis
Measures market volatility in real-time
Percentile ranking over 100 periods
Identifies low volatility periods before breakouts
Percent B (%B) Indicator
Shows price position within BB range (0-100%)
More precise than simple band touches
Values >80% = overbought, <20% = oversold
Bollinger Squeeze Detection
Identifies periods of extremely low volatility
Predicts imminent large price moves
Automatic squeeze ending alerts
Pattern Recognition
W Pattern: Double bottom at lower band (bullish reversal)
M Pattern: Double top at upper band (bearish reversal)
Band bounce detection with threshold filtering
Multi-Timeframe Confirmation
Higher timeframe trend filter
Reduces false signals in counter-trend setups
Signal Generation Strategies:
Basic Crosses: Traditional band crossing signals
BB Width: Volatility-based entry timing
Percent B: Precise overbought/oversold signals
Squeeze Breakout: Post-consolidation momentum
Pattern Recognition: Reversal pattern signals
Advanced Combined: Multi-factor confirmation system
Key Features:
Real-time %B and BB Width monitoring
Squeeze status visualization
Pattern recognition with visual markers
Comprehensive win rate statistics for each method
Multi-timeframe analysis capabilities
Volume confirmation filtering
中文介绍
这是一个全面的布林带分析系统,融合了超越基础价格穿越的多种高级技术,提供了复杂的市场分析和信号生成方法。
高级分析方法:
多层布林带
内轨(1σ):早期预警区域
标准轨(2σ):传统支撑阻力
外轨(2.5σ):极端水平
布林带宽度分析
实时测量市场波动性
100周期百分位排名
识别突破前的低波动期
%B指标
显示价格在布林带范围内的位置(0-100%)
比简单的轨道触及更精确
数值>80%=超买,<20%=超卖
布林带挤压检测
识别极低波动性期间
预测即将到来的大幅价格变动
自动挤压结束警报
形态识别
W型:下轨双底(看涨反转)
M型:上轨双顶(看跌反转)
带阈值过滤的轨道反弹检测
多时间周期确认
更高时间周期趋势过滤
减少逆趋势设置中的假信号
信号生成策略:
基础穿越:传统轨道穿越信号
布林带宽度:基于波动性的入场时机
%B指标:精确的超买超卖信号
挤压突破:整理后动量信号
形态识别:反转形态信号
高级组合:多因子确认系统
核心特性:
实时%B和布林带宽度监控
挤压状态可视化
带可视标记的形态识别
每种方法的全面胜率统计
多时间周期分析能力
成交量确认过滤
应用场景:
波动性交易:利用挤压期后的爆发
均值回归:在极端位置寻找反转
趋势跟踪:通过%B和宽度确认趋势
风险管理:基于统计数据优化策略
市场状态分析:全面了解当前市场环境
지표 및 전략
Chebyshev-Gauss RSIThe Chebyshev-Gauss RSI is a variant of the standard Relative Strength Index (RSI) that uses the Chebyshev-Gauss Moving Average (CG-MA) for smoothing gains and losses instead of a traditional Simple or Exponential Moving Average. This results in a more responsive and potentially smoother RSI line.
This version is enhanced with features from the built-in TradingView RSI indicator, including:
A selectable smoothing moving average of the RSI line.
Bollinger Bands based on the smoothing MA.
Automatic divergence detection.
How it works:
It calculates the upward and downward price changes (gains and losses).
It applies the Chebyshev-Gauss Moving Average to smooth these gains and losses over a specified lookback period.
The smoothed values are used to calculate the Relative Strength (RS) and then the final RSI value.
Chebyshev-Gauss Convergence DivergenceThe Chebyshev-Gauss Convergence Divergence is a momentum indicator that leverages the Chebyshev-Gauss Moving Average (CG-MA) to provide a smoother and more responsive alternative to traditional oscillators like the MACD. For more information see the moving average script:
How it works:
It calculates a fast CG-MA and a slow CG-MA. The CG-MA uses Gauss-Chebyshev quadrature to compute a weighted average, which can offer a better trade-off between lag and smoothness compared to simple or exponential MAs.
The Oscillator line is the difference between the fast CG-MA and the slow CG-MA.
A Signal Line, which is a simple moving average of the Oscillator line, is plotted to show the average trend of the oscillator.
A Histogram is plotted, representing the difference between the Oscillator and the Signal Line. The color of the histogram bars changes to indicate whether momentum is strengthening or weakening.
How to use:
Crossovers: A buy signal can be generated when the Oscillator line crosses above the Signal line. A sell signal can be generated when it crosses below.
Zero Line: When the Oscillator crosses above the zero line, it indicates upward momentum (fast MA is above slow MA).When it crosses below zero, it indicates downward momentum.
Divergence: Like with the MACD, look for divergences between the oscillator and price action to spot potential reversals.
Histogram: The histogram provides a visual representation of the momentum. When the bars are growing, momentum is increasing. When they are shrinking, momentum is fading.
VWAP Supply & Demand Zones with Trading SignalsVWAP Supply & Demand Zones with Trading Signals & Win Rate Stats
English Description
This advanced VWAP Supply & Demand indicator combines volume-weighted average price analysis with dynamic supply/demand zone detection to generate high-probability trading signals. The indicator offers four distinct signal generation methods:
Signal Methods:
Zone Bounce: Identifies reversal signals when price rejects from established supply/demand zones
VWAP Cross: Generates signals based on price crossing above or below the VWAP line
Zone Break: Captures breakout signals when price breaks through key supply/demand levels
Combined: Utilizes multiple confirmation factors for enhanced signal reliability
Key Features:
Real-time supply/demand zone creation and management
Zone strength validation through touch counting
Volume and momentum confirmation filters
Strong signal identification for zones with multiple tests
Comprehensive 10-minute win rate statistics tracking
Visual zone display with automatic extension and break detection
Signal Quality Levels:
Regular Signals: Meet basic criteria with optional volume confirmation
Strong Signals: Generated from zones with multiple touches (≥2 by default), indicating higher reliability
The indicator automatically tracks signal performance over 10-minute intervals using precise time-based calculations, providing detailed win rate statistics for overall performance, long/short signals, strong signals, and individual signal methods.
中文介绍
这是一个结合成交量加权平均价格(VWAP)分析和动态供需区域检测的高级交易指标,用于生成高概率交易信号。该指标提供四种不同的信号生成方法:
信号方法:
区域反弹: 当价格从已建立的供需区域反弹时识别反转信号
VWAP穿越: 基于价格穿越VWAP线生成信号
区域突破: 当价格突破关键供需水平时捕获突破信号
组合方法: 利用多重确认因子增强信号可靠性
核心特性:
实时供需区域创建和管理
通过触及次数验证区域强度
成交量和动量确认过滤器
识别多次测试区域的强势信号
全面的10分钟胜率统计追踪
可视化区域显示,自动延伸和突破检测
信号质量等级:
普通信号: 满足基本条件,可选成交量确认
强势信号: 来自多次触及的区域(默认≥2次),表示更高可靠性
该指标使用精确的时间基础计算自动追踪10分钟间隔的信号表现,提供总体表现、多空信号、强势信号和各种信号方法的详细胜率统计。
CGMALibrary "CGMA"
This library provides a function to calculate a moving average based on Chebyshev-Gauss Quadrature. This method samples price data more intensely from the beginning and end of the lookback window, giving it a unique character that responds quickly to recent changes while also having a long "memory" of the trend's start. Inspired by reading rohangautam.github.io
What is Chebyshev-Gauss Quadrature?
It's a numerical method to approximate the integral of a function f(x) that is weighted by 1/sqrt(1-x^2) over the interval . The approximation is a simple sum: ∫ f(x)/sqrt(1-x^2) dx ≈ (π/n) * Σ f(xᵢ) where xᵢ are special points called Chebyshev nodes.
How is this applied to a Moving Average?
A moving average can be seen as the "mean value" of the price over a lookback window. The mean value of a function with the Chebyshev weight is calculated as:
Mean = /
The math simplifies beautifully, resulting in the mean being the simple arithmetic average of the function evaluated at the Chebyshev nodes:
Mean = (1/n) * Σ f(xᵢ)
What's unique about this MA?
The Chebyshev nodes xᵢ are not evenly spaced. They are clustered towards the ends of the interval . We map this interval to our lookback period. This means the moving average samples prices more intensely from the beginning and the end of the lookback window, and less intensely from the middle. This gives it a unique character, responding quickly to recent changes while also having a long "memory" of the start of the trend.
Chebyshev-Gauss Moving AverageThis indicator applies the principles of Chebyshev-Gauss Quadrature to create a novel type of moving average. Inspired by reading rohangautam.github.io
What is Chebyshev-Gauss Quadrature?
It's a numerical method to approximate the integral of a function f(x) that is weighted by 1/sqrt(1-x^2) over the interval . The approximation is a simple sum: ∫ f(x)/sqrt(1-x^2) dx ≈ (π/n) * Σ f(xᵢ) where xᵢ are special points called Chebyshev nodes.
How is this applied to a Moving Average?
A moving average can be seen as the "mean value" of the price over a lookback window. The mean value of a function with the Chebyshev weight is calculated as:
Mean = /
The math simplifies beautifully, resulting in the mean being the simple arithmetic average of the function evaluated at the Chebyshev nodes:
Mean = (1/n) * Σ f(xᵢ)
What's unique about this MA?
The Chebyshev nodes xᵢ are not evenly spaced. They are clustered towards the ends of the interval . We map this interval to our lookback period. This means the moving average samples prices more intensely from the beginning and the end of the lookback window, and less intensely from the middle. This gives it a unique character, responding quickly to recent changes while also having a long "memory" of the start of the trend.
Power IndicatorThe Power Indicator is a customizable EMA (Exponential Moving Average) overlay designed to help traders visually assess market trends across short-, medium-, and long-term timeframes. It plots five key EMAs — 10, 20, 50, 100, and 200 — directly on your price chart, providing a quick glance at the overall momentum and structure of the market.
Functionality:
This indicator includes the following features:
Five EMAs Plotted:
- EMA 10 → Short-term trend
- EMA 20 → Near-term trend
- EMA 50 → Medium-term trend
- EMA 100 → Intermediate trend
- EMA 200 → Long-term trend
User-defined Colors:
Each EMA has its own color setting, allowing full customization for better visibility and style matching.
🖥️Overlay on Price Chart:
EMAs are drawn directly over candles to align with your trading chart.
Real-Time Updates:
EMAs update dynamically with every new price bar.
⚙️ How to Use & Modify Settings
To customize the indicator:
- Add the indicator to your chart.
- Click the gear icon (⚙️) next to the script name.
- Under the Inputs tab, you'll see:
- EMA 10 Color – Choose your preferred color
- EMA 20 Color – Choose your preferred color
- EMA 50 Color – Choose your preferred color
- EMA 100 Color – Choose your preferred color
- EMA 200 Color – Choose your preferred color
You can adjust the colors to match your theme or emphasize specific EMAs.
MACDelta Scalping Indicator – AI-Tuned for Indian IndicesThis indicator is designed for intraday scalping on Indian indices such as the Nifty Metal Index. It fuses momentum analysis through MACD with dynamic Fibonacci retracement zones derived from recent price pivots, forming a "Delta Wave" region that acts as a price pressure zone.
Core Logic and Workflow:
Momentum Signal via MACD:
The indicator uses a customized MACD setup with parameters (fast length 14, slow length 25, signal length 9) to detect shifts in momentum. It tracks MACD crossover events (both bullish and bearish) to time potential reversals.
Delta Wave Fibonacci Zone:
Using a rolling window of 10 bars, it calculates recent pivot highs and lows, defining a dynamic price range. From this, it determines key Fibonacci retracement levels at 50% and 61.8%. This “golden zone” identifies a price region where reversals are more probable.
Signal Confirmation Window:
To ensure relevance, the indicator only triggers sell signals within a strict 3-bar window after a bearish MACD crossover. It also confirms that the price crosses below the upper Fibonacci boundary (50% retracement) within this timeframe, indicating confirmed downside pressure.
Visual Alerts:
When conditions align, the indicator plots clear “SELL” markers above the bars on the chart for easy identification by the trader.
AI Fine-Tuning:
The original logic was further optimized using Agentic AI, which refined parameter values and timing windows, minimizing false signals and enhancing trade signal quality.
Backtesting & Performance:
Extensive backtesting from 2009 to 2022 on Indian indices shows the indicator reliably signals significant corrections and short-term downswings. Notably, it outperformed the Nifty Metal Index during periods of technical correction, validating its practical utility for scalping strategies.
Key Levels + IB + VAH/VAL + FVG The full TradingView Pine Script with:
⏰ Session time zone selection
🟩 Initial Balance (IB) with parameterized duration
📦 Fair Value Gaps (FVG)
📊 Simulated Volume Profile: VAH / VAL / POC
🔁 Extended key levels across full session
SmartPulse: Advanced Intraday Signal Strategy for Indian IndicesSmartPulse is a robust and intelligent intraday trading strategy tailored specifically for Indian indices (such as Nifty and Bank Nifty) on the 15-minute timeframe. It is built to provide high-probability reversal signals by combining price action with volatility, momentum, and trend-based filters.
This strategy leverages a multi-layered approach to filter out noise and low-quality setups by analyzing:
Candle wick-to-body ratios to detect potential exhaustion zones
ATR-based consolidation detection to avoid trades in choppy markets
EMA trend alignment (EMA 20 vs EMA 50) to trade in the direction of strength
Optional RSI and volume filters to add momentum confirmation and improve accuracy
Intraday time filtering, aligned with Indian market session hours (9:05 AM to 3:20 PM IST)
It identifies reversal setups using prior candle analysis (e.g., long top wick on bearish candles or long bottom wick on bullish candles), followed by confirmation from the current candle and real-time indicators like ATR and volume. Traders can choose between basic signals (candlestick-based) and enhanced signals (with filters), or even restrict to trend-aligned signals for additional safety.
🟢 Long Signals are generated when:
Previous candle shows signs of seller exhaustion (long upper wick on a red candle)
Current candle confirms bullish momentum
Market is not consolidating
Volume and RSI (optional) support the move
Optionally aligned with an uptrend (EMA 20 > EMA 50)
🔴 Short Signals are generated when:
Previous candle shows signs of buyer exhaustion (long lower wick on a green candle)
Current candle confirms bearish momentum
Market is not consolidating
Volume and RSI (optional) support the move
Optionally aligned with a downtrend (EMA 20 < EMA 50)
✅ Key Features:
High-precision reversal signal detection
ATR-based consolidation filter to avoid chop
Optional volume and RSI-based signal validation
EMA-based trend alignment for safer entries
Real-time visual signals, alert conditions, and an info table showing market status
Fully aligned with Indian intraday trading hours
This strategy is ideal for scalpers, momentum traders, and intraday swing traders who seek reliable, filtered entries with minimal false signals in the fast-paced Indian stock market environment.
AP Session Liquidity with EQH/EQL and Previous DayThis indicator plots key intraday session highs and lows, along with essential market structure levels, to help traders identify areas of interest, potential liquidity zones, and high-probability trade setups. It includes the Asia Session High and Low (typically 00:00–08:00 UTC), London Session High and Low (08:00–12:00 UTC), New York AM Session High and Low (12:00–15:00 UTC), and New York Lunch High and Low (15:00–17:00 UTC). Additionally, it displays the Previous Day’s High and Low for context on recent price action, as well as automatically detected Equal Highs and Lows based on configurable proximity settings to highlight potential liquidity pools or engineered price levels. These session levels are widely used by institutional traders and are critical for analyzing market behavior during time-based volatility windows. Traders can use this indicator to anticipate breakouts, fakeouts, and reversals around session boundaries—such as liquidity grabs at Asia highs/lows before the London or New York sessions—or to identify key consolidation and expansion zones. Equal Highs and Lows serve as magnets for price, offering insight into potential stop hunts or inducement zones. This tool is ideal for day traders, scalpers, and smart money concept practitioners, and includes full customization for session timings, color schemes, line styles, and alert conditions. Whether you're trading price action, ICT concepts, or supply and demand, this indicator provides a powerful framework for intraday analysis.
Internal Bar Strength (IBS)This script calculates the Internal Bar Strength (IBS), a mean-reversion indicator defined as (Close - Low) / (High - Low). IBS values range from 0 to 1, with lower values indicating potential oversold conditions and higher values suggesting overbought conditions. Useful for intraday reversal strategies.
Candle Color and Wick Size CounterI had a need to know how many green vs red candles happen during a specific visual window. After usage I decided to add in an extra check for candle wick lengths. The reason for this is I want to know that if it’s a red candle, how many of them retrace back up by 1/3. Conversly I wanted to know if its a green candle did it get push back down by 1/3
WTS by M.GWTS is a trading approach designed to identify potential market reversals and entries by analyzing price action through wick patterns. It focuses on spotting key signals without relying heavily on complex indicators, aiming to provide traders with clear and actionable setups.
Donchian x WMA Crossover (2025 Only, Adjustable TP, Real OHLC)Short Description:
Long-only breakout system that goes long when the Donchian Low crosses up through a Weighted Moving Average, and closes when it crosses back down (with an optional take-profit), restricted to calendar year 2025. All signals use the instrument’s true OHLC data (even on Heikin-Ashi charts), start with 1 000 AUD of capital, and deploy 100 % equity per trade.
Ideal parameters configured for Temple & Webster on ASX 30 minute candles. Adjust parameter to suit however best to download candle interval data and have GPT test the pine script for optimum parameters for your trading symbol.
Detailed Description
1. Strategy Concept
This strategy captures trend-driven breakouts off the bottom of a Donchian channel. By combining the Donchian Low with a WMA filter, it aims to:
Enter when volatility compresses and price breaks above the recent Donchian Low while the longer‐term WMA confirms upward momentum.
Exit when price falls back below that same WMA (i.e. when the Donchian Low crosses back down through WMA), but only if the WMA itself has stopped rising.
Optional Take-Profit: you can specify a profit target in decimal form (e.g. 0.01 = 1 %).
2. Timeframe & Universe
In-sample period: only bars stamped between Jan 1 2025 00:00 UTC and Dec 31 2025 23:59 UTC are considered.
Any resolution (e.g. 30 m, 1 h, D, etc.) is supported—just set your preferred timeframe in the TradingView UI.
3. True-Price Execution
All indicator calculations (Donchian Low, WMA, crossover checks, take-profit) are sourced from the chart’s underlying OHLC via request.security(). This guarantees that:
You can view Heikin-Ashi or other styled candles, but your strategy will execute on the real OHLC bars.
Chart styling never suppresses or distorts your backtest results.
4. Position Sizing & Equity
Initial capital: 1 000 AUD
Size per trade: 100 % of available equity
No pyramiding: one open position at a time
5. Inputs (all exposed in the “Inputs” tab):
Input Default Description
Donchian Length 7 Number of bars to calculate the Donchian channel low
WMA Length 62 Period of the Weighted Moving Average filter
Take Profit (decimal) 0.01 Exit when price ≥ entry × (1 + take_profit_perc)
6. How It Works
Donchian Low: ta.lowest(low, DonchianLength) over the specified look-back.
WMA: ta.wma(close, WMALength) applied to true closes.
Entry: ta.crossover(DonchianLow, WMA) AND barTime ∈ 2025.
Exit:
Cross-down exit: ta.crossunder(DonchianLow, WMA) and WMA is not rising (i.e. momentum has stalled).
Take-profit exit: price ≥ entry × (1 + take_profit_perc).
Calendar exit: barTime falls outside 2025.
7. Usage Notes
After adding to your chart, open the Strategy Tester tab to review performance metrics, list of trades, equity curve, etc.
You can toggle your chart to Heikin-Ashi for visual clarity without affecting execution, thanks to the real-OHLC calls.
FxInside你这段代码整体逻辑是正确的,但如果**实际运行后看不到空头信号(`short_signal`)**,那大概率是因为条件太苛刻,在你当前查看的图表、时间周期和币种上**并没有符合这些严格空头条件的K线**。
---
### ✅ 逐项检查你的 `short_signal` 条件:
```pinescript
short_signal = do_tick/st >= 2 and st / (high - low ) >= 0.05 and up_tick/st <= 0.75 and close < low
```
#### 解释:
1. `do_tick / st >= 2`:前一根K线下影线明显大于实体(**下影线 >= 实体的2倍**)✅
2. `st / (high - low ) >= 0.05`:实体不能太小(至少占K线5%)✅
3. `up_tick / st <= 0.75`:上影线不能太大 ✅
4. `close < low `:当前K线收盘价要**跌破前一根K线最低价**(这可能比较苛刻❗)
---
### 🔍 为什么很少或没有出现空头信号?
通常是因为 **`close < low `** 是比较少见的情况(意味着当前K线**收盘直接创新低**),在大部分正常震荡或下跌过程中,K线更多是影线破位而不是**实体收盘破位**。
---
### ✅ 如何验证问题?
你可以临时在图表中添加一个调试输出,例如:
```pinescript
label.new(bar_index, high, text="✓", color=color.red) if short_signal
```
或者添加调试 `plot`:
```pinescript
plot(close < low ? 1 : na, title="收盘破前低", color=color.red)
```
你会发现这个条件非常少成立。
---
### ✅ 两个可选改进方式:
#### ✅ 方式1:放宽空头条件的“收盘破低”为“最低价破低”
```pinescript
short_signal = do_tick/st >= 2 and st / (high - low ) >= 0.05 and up_tick/st <= 0.75 and low < low
```
这样只要**当前K线最低价跌破前低**就算空头信号,触发率大幅提升。
---
#### ✅ 方式2:同时显示条件组件,方便你调试
```pinescript
plotshape(do_tick/st >= 2, title="下影线够长", location=location.top, color=color.blue, style=shape.circle)
plotshape(st / (high - low ) >= 0.05, title="实体不小", location=location.top, color=color.yellow, style=shape.circle)
plotshape(up_tick/st <= 0.75, title="上影线不大", location=location.top, color=color.orange, style=shape.circle)
plotshape(close < low , title="收盘破低", location=location.top, color=color.red, style=shape.triangledown)
```
这样可以清晰地看到哪一个条件没有被满足。
---
如果你愿意,我也可以根据你的交易风格(比如追空激进 or 保守),重新优化空头条件。是否要我为你设计一个更高触发率的版本?
GBPUSD V2"GBPUSD V2" is a multi-confirmation trading strategy built specifically for GBP/USD, but adaptable to other major forex pairs. It combines Heikin-Ashi candles with EMA, MACD, RSI, and ADX filters to generate high-probability long and short signals.
Key Features:
📊 Heikin-Ashi EMA Trend Filter to smooth price action and filter direction
📈 MACD Crossovers confirm momentum entry points
🔍 RSI Thresholds for overbought/oversold validation
📉 ADX Filter ensures entries only occur in strong trending conditions
🕒 Customizable Time Session and Weekday Filters – trade only during preferred hours and days
🔁 Optional Multi-Timeframe Confirmation to align lower timeframe signals with higher timeframe EMA trends
📏 ATR-Based TP/SL Calculations with optional candle quality check
✅ Backtested and optimized on the 10-minute timeframe (M10), making it well-suited for short-term intraday strategies.
This strategy is suitable for both manual and automated trading approaches, especially for intraday and swing traders who prioritize precision and signal quality.
ATR-Distance Helper (manual ref level)Average True Range is not a buy–sell signal by itself; it is a measuring tape for price movement. Use it to size trades, set adaptive stops, or decide whether a breakout or poke past a reference level (such as yesterday’s POC) is meaningful—e.g., “price dipped 0.1 ATR below POC, so the sweep was genuine, not a two-tick head-fake.”
RCI Ribbon with Cross Signals (Filtered)nothing to say just use itnothing to say just use itnothing to say just use itnothing to say just use it
AlphaTrend AutoTrade PRO v3.1//@version=5
// ---------------------------------------------------------------------------
// AlphaTrend AutoTrade PRO v3.1 (compile‑safe, dynamic lot)
// ---------------------------------------------------------------------------
// – Fixed Lot OR %Equity sizing via runtime `qty` parameter
// – ATR-based SL/TP + optional Trailing
// – Optional filters (HTF-RSI, Session, Weekday)
// – Webhook JSON + Debug Shapes
// ---------------------------------------------------------------------------
//──────────────────────── ① Order Size Mode ─────────────────────────
accountMode = input.string("Fixed", "Order Size Mode", options= )
fixedLot = input.float(1.0, "Fixed Lot Size", step=0.1)
riskPct = input.float(1.0, "% Equity Risk per Trade (if Percent)", step=0.1)
// Strategy header must use constant; we pick FIXED 1 lot as default placeholder
strategy("AlphaTrend AutoTrade PRO v3.1", overlay=true,
default_qty_type=strategy.fixed,
default_qty_value=1,
initial_capital=10000,
currency=currency.USD,
calc_on_every_tick=false,
max_bars_back=500)
// Helper to compute dynamic qty each entry
calcQty(bool isLong) =>
accountMode == "Fixed" ? fixedLot :
// Percent equity: qty = (equity * pct) / price
(strategy.equity * (riskPct/100.0)) / close
//──────────────────────── ② AlphaTrend & Risk Inputs ───────────────
atrMult = input.float(1.0, "ATR Multiplier", step=0.05)
atrLen = input.int(14, "ATR Period")
slATR = input.float(1.2, "SL × ATR")
tpATR = input.float(1.8, "TP × ATR")
trailOn = input.bool(true, "Enable Trailing")
trailStart= input.float(1.5, "Trail Start × ATR")
trailOffset= input.float(1.0, "Trail Offset × ATR")
//──────────────────────── ③ Filters ────────────────────────────────
htfEnable = input.bool(false, "Higher‑TF RSI filter")
htfTF = input.timeframe("15", "Higher‑TF TF")
rsithreshold= input.int(50, "HTF RSI Threshold", minval=10, maxval=90)
sessEnable = input.bool(false, "Session filter (Bangkok)")
sessionStr = input.session("1300-2300", "Active HHMM‑HHMM")
dowEnable = input.bool(false, "Filter by Weekday")
tradeDays = input.string("12345", "Trade days (1=Mon)")
showDebug = input.bool(true, "Show Debug Shapes")
secretToken = input.string("MYSECRET", "Webhook Token")
//──────────────────────── ④ AlphaTrend Calc ───────────────────────
atr = ta.sma(ta.tr, atrLen)
upT = low - atr*atrMult
dnT = high + atr*atrMult
var float at = na
condUp = ta.rsi(close, atrLen) >= 50
at := condUp ? math.max(nz(at , upT), upT) : math.min(nz(at , dnT), dnT)
rawLong = ta.crossover(at, at )
rawShort = ta.crossunder(at, at )
htfPassLong = not htfEnable or request.security(syminfo.tickerid, htfTF, ta.rsi(close, atrLen) > rsithreshold)
htfPassShort = not htfEnable or request.security(syminfo.tickerid, htfTF, ta.rsi(close, atrLen) < rsithreshold)
sessPass = not sessEnable or not na(time(timeframe.period, sessionStr))
dowPass = not dowEnable or str.contains(tradeDays, str.tostring(dayofweek))
longCond = rawLong and htfPassLong and sessPass and dowPass
shortCond = rawShort and htfPassShort and sessPass and dowPass
//──────────────────────── ⑤ Risk Params ───────────────────────────
slPts = atr*slATR
tpPts = atr*tpATR
trailP = trailOn ? atr*trailStart : na
trailO = trailOn ? atr*trailOffset : na
lotDesc = accountMode=="Fixed" ? str.tostring(fixedLot) : str.tostring(riskPct)+"%"
//──────────────────────── ⑥ Execute & Webhook ─────────────────────
if longCond
lot = calcQty(true)
strategy.entry("L", strategy.long, qty=lot)
strategy.exit("XL", from_entry="L", stop=close-slPts, limit=close+tpPts, trail_points=trailP, trail_offset=trailO)
if barstate.isconfirmed and barstate.isrealtime
msg = '{"token":"'+secretToken+'","action":"buy","symbol":"'+syminfo.ticker+'","price":'+str.tostring(close)+',"sl":'+str.tostring(close-slPts)+',"tp":'+str.tostring(close+tpPts)+',"lot":"'+lotDesc+'"}'
alert(msg, alert.freq_once_per_bar_close)
if shortCond
lot = calcQty(false)
strategy.entry("S", strategy.short, qty=lot)
strategy.exit("XS", from_entry="S", stop=close+slPts, limit=close-tpPts, trail_points=trailP, trail_offset=trailO)
if barstate.isconfirmed and barstate.isrealtime
msg = '{"token":"'+secretToken+'","action":"sell","symbol":"'+syminfo.ticker+'","price":'+str.tostring(close)+',"sl":'+str.tostring(close+slPts)+',"tp":'+str.tostring(close-tpPts)+',"lot":"'+lotDesc+'"}'
alert(msg, alert.freq_once_per_bar_close)
//──────────────────────── ⑦ Debug Shapes ──────────────────────────
plotshape(rawLong and showDebug, title="RawLong", style=shape.circle, location=location.belowbar, color=color.aqua, size=size.tiny)
plotshape(rawShort and showDebug, title="RawShort", style=shape.circle, location=location.abovebar, color=color.purple, size=size.tiny)
plotshape(longCond and showDebug, title="LongOK", style=shape.arrowup, location=location.belowbar, color=color.green)
plotshape(shortCond and showDebug, title="ShortOK", style=shape.arrowdown, location=location.abovebar, color=color.red)
//──────────────────────── ⑧ Plot AlphaTrend ───────────────────────
col = at > at ? color.green : color.red
plot(at, "AlphaTrend", color=col, linewidth=3)
plot(at , "AlphaTrendLag", color=color.new(col,70), linewidth=2)
RSI-GringoRSI-Gringo — Stochastic RSI with Advanced Smoothing Averages
Overview:
RSI-Gringo is an advanced technical indicator that combines the concept of the Stochastic RSI with multiple smoothing options using various moving averages. It is designed for traders seeking greater precision in momentum analysis, while offering the flexibility to select the type of moving average that best suits their trading style.
Disclaimer: This script is not investment advice. Its use is entirely at your own risk. My responsibility is to provide a fully functional indicator, but it is not my role to guide how to trade, adjust, or use this tool in any specific strategy.
The JMA (Jurik Moving Average) version used in this script is a custom implementation based on publicly shared code by TradingView users, and it is not the original licensed version from Jurik Research.
What This Indicator Does
RSI-Gringo applies the Stochastic Oscillator logic to the RSI itself (rather than price), helping to identify overbought and oversold conditions within the RSI. This often leads to more responsive and accurate momentum signals.
This indicator displays:
%K: the main Stochastic RSI line
%D: smoothed signal line of %K
Upper/Lower horizontal reference lines at 80 and 20
Features and Settings
Available smoothing methods (selectable from dropdown):
SMA — Simple Moving Average
SMMA — Smoothed Moving Average (equivalent to RMA)
EMA — Exponential Moving Average
WMA — Weighted Moving Average
HMA — Hull Moving Average (manually implemented)
JMA — Jurik Moving Average (custom approximation)
KAMA — Kaufman Adaptive Moving Average
T3 — Triple Smoothed Moving Average with adjustable hot factor
How to Adjust Advanced Averages
T3 – Triple Smoothed MA
Parameter: T3 Hot Factor
Valid range: 0.1 to 2.0
Tuning:
Lower values (e.g., 0.1) make it faster but noisier
Higher values (e.g., 2.0) make it smoother but slower
Balanced range: 0.7 to 1.0 (recommended)
JMA – Jurik Moving Average (Custom)
Parameters:
Phase: adjusts responsiveness and smoothness (-100 to 100)
Power: controls smoothing intensity (default: 1)
Tuning:
Phase = 0: neutral behavior
Phase > 0: more reactive
Phase < 0: smoother, more delayed
Power = 1: recommended default for most uses
Note: The JMA used here is not the proprietary version by Jurik Research, but an educational approximation available in the public domain on TradingView.
How to Use
Crossover Signals
Buy signal: %K crosses above %D from below the 20 line
Sell signal: %K crosses below %D from above the 80 line
Momentum Strength
%K and %D above 80: strong bullish momentum
%K and %D below 20: strong bearish momentum
With Trend Filters
Combine this indicator with trend-following tools (like moving averages on price)
Fast smoothing types (like EMA or HMA) are better for scalping and day trading
Slower types (like T3 or KAMA) are better for swing and long-term trading
Final Tips
Tweak RSI and smoothing periods depending on the time frame you're trading.
Try different combinations of moving averages to find what works best for your strategy.
This indicator is intended as a supporting tool for technical analysis — not a standalone decision-making system.
Euclidean Range [InvestorUnknown]The Euclidean Range indicator visualizes price deviation from a moving average using a geometric concept Euclidean distance. It helps traders identify trend strength, volatility shifts, and potential overextensions in price behavior.
Euclidean Distance
Euclidean distance is a fundamental concept in geometry and machine learning. It measures the "straight-line distance" between two points in space. In time series analysis, it can be used to measure how far one sequence deviates from another over a fixed window.
euclidean_distance(src, ref, len) =>
var float sum_sq_diff = na
sum_sq_diff := 0.0
for i = 0 to len - 1
diff = src - ref
sum_sq_diff += diff * diff
math.sqrt(sum_sq_diff)
In this script, we calculate the Euclidean distance between the price (source) and a smoothed average (reference) over a user-defined window. This gives us a single scalar that reflects the overall divergence between price and trend.
How It Works
Moving Average Calculation: You can choose between SMA, EMA, or HMA as your reference line. This becomes the "baseline" against which the actual price is compared.
Distance Band Construction: The Euclidean distance between the price and the reference is calculated over the Window Length. This value is then added to and subtracted from the average to form dynamic upper and lower bands, visually framing the range of deviation.
Distance Ratios and Z-Scores: Two distance ratios are computed: dist_r = distance / price (sensitivity to volatility); dist_v = price / distance (sensitivity to compression or low-volatility states)
Both ratios are normalized using a Z-score to standardize their behavior and allow for easier interpretation across different assets and timeframes.
Z-Score Plots: Z_r (white line) highlights instances of high volatility or strong price deviation; Z_v (red line) highlights low volatility or compressed price ranges.
Background Highlighting (Optional): When Z_v is dominant and increasing, the background is colored using a gradient. This signals a possible build-up in low volatility, which may precede a breakout.
Use Cases
Detect volatile expansions and calm compression zones.
Identify mean reversion setups when price returns to the average.
Anticipate breakout conditions by observing rising Z_v values.
Use dynamic distance bands as adaptive support/resistance zones.
Notes
The indicator is best used with liquid assets and medium-to-long windows.
Background coloring helps visually filter for squeeze setups.
Disclaimer
This indicator is provided for speculative analysis and educational purposes only. It is not financial advice. Always backtest and evaluate in a simulated environment before live trading.