Squeeze Momentum Indicator Version3This is an efficient plugin based on the squeeze kinetic energy theory.
这是一个基于挤压动能理论的有效插件
1,Determining Fast and Slow Lines
快慢线判断
When the fast line (blue) crosses above the slow line (red), forming a golden cross, it is considered a bullish signal.
当快线(蓝色)穿过红线(慢线)时候,既发生金叉的时候,看多。
When the slow line (red) crosses below the fast line (blue), it is known as a "death cross," and is typically considered a bearish signal.
当慢线(红色)穿过蓝线(快线)时候,既发生金叉的时候,看空。
2,Judgment of Bullish and Bearish Areas
空头多头区域判断
When the two lines are above the center point, the overall trend is bullish. Even if a death cross occurs, the downward momentum is relatively weak.
当两条线在中心点上方时整体是多头趋势,就算发生死叉也相对没那么大动能跌。
Conversely, when the two lines are below the center point, the overall trend is bearish. Even if a golden cross occurs, the upward momentum is relatively weak.
反之当两条线在中心点下方时整体是多头趋势,就算发生金叉也相对没那么大动能突破。
3,Judgment of Compressed Momentum Dots
压缩动能圆点判断
Center Point Dot Judgment Method
中心点园点判断法
When a gray dot appears, it indicates that the momentum is very weak, and the trend has dissipated, with changes possible at any time. (Note! A change in trend does not mean a shift from bullish to bearish or from bearish to bullish; it simply suggests that the market may enter a consolidation phase and will no longer exhibit high-intensity trend movements.)
当灰色圆点出现时代表动能很弱,趋势已经消失,随时变化(注!趋势随时变化并不是由多头变为空头或者空头转为多头的意思,只是说可能接下来将进入震荡区间。不在继续高强度趋势动作。)
当中间圆点出现白色时代表,趋势开始越来越强劲,开始单边行情,
When a white dot appears in the middle, it indicates that the trend is becoming stronger and a one-sided market is beginning.
当中间圆点出现白色时代表,趋势开始越来越强劲,开始单边行情,
Usage Method
使用方法
First, judge the entry conditions for momentum, then assess the area, and finally consider golden and death crosses for entry.
先判断动能进场条件,后判断区域,再考虑金叉死叉进场。
3 > 2 > 1
When the compressed momentum dot changes from white to gray, consider exiting and wait for the consolidation phase to end before re-entering.
当压缩动能圆点从白色转为灰色后考虑离场,等待震荡行情结束后再进场
广量指标
OI + Intraday Levels Tool for HoonMheeThis tool is designed specifically for drawing horizontal lines based on Hoonmhee trading data. It is not a complete trading strategy and does not generate any buy or sell signals.
MACD + RSI Strategy//@version=5
indicator("MACD + RSI Strategy", overlay=true)
// Parameter untuk MACD
macdShort = input.int(12, title="MACD Short Period")
macdLong = input.int(26, title="MACD Long Period")
macdSignal = input.int(9, title="MACD Signal Period")
// Parameter untuk RSI
rsiLength = input.int(14, title="RSI Period")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// Hitung MACD dan RSI
= ta.macd(close, macdShort, macdLong, macdSignal)
rsi = ta.rsi(close, rsiLength)
// Sinyal Beli dan Jual
buySignal = ta.crossover(macdLine, signalLine) and rsi < rsiOversold
sellSignal = ta.crossunder(macdLine, signalLine) and rsi > rsiOverbought
// Plot sinyal di chart
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")
// Plot MACD dan Signal
plot(macdLine, color=color.blue, title="MACD Line")
plot(signalLine, color=color.orange, title="Signal Line")
hline(0, "Zero Line", color=color.gray)
Stock vs SPY % ChangeStock vs SPY % Change Indicator
This Pine Script indicator helps you compare a stock's price performance to the S&P 500 (using SPY ETF) over a user-defined period. It calculates the percentage price change of the stock and SPY, then displays the difference as a relative performance metric. A positive value (plotted in green) indicates the stock is outperforming SPY (e.g., dropping only 3% while SPY drops 10%), while a negative value (plotted in red) shows underperformance.
Features:
Adjustable lookback period (default: 20 days) to analyze recent performance.
Visual plot with green/red coloring for quick interpretation.
Zero line to clearly separate outperformance from underperformance.
How to Use:
Apply the indicator to your stock's chart.
Set the "Lookback Period" in the settings (e.g., 20 for ~1 month).
Check the plot:
Green (above 0) = Stock's % change is better than SPY's.
Red (below 0) = Stock's % change is worse than SPY's.
Use on daily or weekly charts for best results.
Ideal for identifying stocks that hold up better during market downturns or outperform in uptrends. Perfect for relative strength analysis and to spot accumulation.
Multi RSI IndicatorRSI is one of the best indicator for measuring the momentum and trend of any tradable asset, be it Stocks, crypto currencies, commodities, forex or their derivatives.
Higher period RSIs tells the trend and have lower sensitivity towards momentum while lower period RSIs are more sensitive towards momentum.
So a combination of different periods and different time frame RSIs will measure trend and momentum both.
For example if in 15 minute time frame, 35 period RSI is above 50, the trend is bullish and vice versa. But if 7 period RSI is above 70 means momentum is high. Along with that if 14 period RSI in 30 minute time frame is above 60 that means in higher time frame also momentum is high. So chances of success in bullish trade becomes high.
So this Multiple RSI indicator is a combination of 8 RSIs. 4 RSIs are of different periods such as 7,14, 21 and 28 (periods can be selected as per choice). Another 4 RSIs are of different time frames to measure the major trend and momentum. Such as on 5 minute chart, apart from different period RSIs of 5 minutes, you can also place 14 period RSIs of 15 minutes, 30 minutes, hourly and day time frames to give broader spectrum of trend and momentum. In this way you can get a clear picture of trend and momentum both and can trade in trend direction more accurately, thus enhancing you trade accuracy and profitability.
Market Breadth Ratios OverlayThis overlay indicator displays the up/down volume breadth ratio for both the NYSE and NASDAQ directly on your chart.
Ratios are calculated using volume data from:
USI:UVOL, USI:DVOL (NYSE)
USI:UVOLQ, USI:DVOLQ (NASDAQ)
A green label indicates more up volume than down volume (bullish breadth).
A red label indicates more down volume than up volume (bearish breadth).
Labels update every 10 bars and are anchored to the candle’s high (NYSE) and low (NASDAQ).
Negative ratios are inverted and displayed as -D:U to maintain a consistent “X:1” format.
Use this tool to assess whether institutional buying pressure is broad-based across exchanges — a valuable layer of confirmation for directional bias.
SFT ChartPowerRSIThis RSI indicator from SixFourTrading (SFT) is not your typical indicator. It give the edge on additional confluence to your trading strategy. Signals and Alerts to give you the knowledge to make quick decisions for your trading strategy. It's time to step up your game! Subscribe Now!
RSI Indicator
Two SFT Moving Averages SLOW and FAST
Moving Average Cloud for Bullish or Bearish Detection
MA Bullish/Buy and Bearish/Sell Signals
RSI Pro Sell and Buy Signals
RSI Overbought and Oversold Cloud
RSI Overbought and Oversold Indicators
Fully Customizable
SMA or EMA Plots
Adjustable RSI High/Low Range
Adjustable RSI Timeframes
RSI Customizable Alerts
MA Customizable Alerts
Consistent, Reliable Strategy Indicator so you can focus on trading and let the system do the alerting for you
Signals to Enter Long or Short
Regular Updates on New Features Area
DISCLAIMER: You hereby understand, agree, and acknowledge that your use or misuse of the site, any products, goods, or services on the site, including, without limitation, information and materials from the site, is solely at your own discretion and risk and that SixFourTrading, Inc. and its directors, officers, shareholders, employees, contractors, moderators, and affiliates have no liability whatsoever for your use or misuse of this site. You hereby understand, agree, and acknowledge that you are solely responsible for any liability, claim, damages, losses, cost, or expenses that may arise or result from your use or misuse of the site.
Market Cipher B@_user8844 on X
✅ Functional Summary:
Element Role
Fast / Slow waves Bullish/Bearish Momentum (blue lines)
VWAP (here) Momentum Wave Spread (yellow line)
Custom MFI Incoming/Outgoing Money Flow (green/red zone)
RSI / Stochastic Overbought/Oversold Condition Detection
Buy/Sell Crossover Signals (circles + alerts)
Horizontal Lines Visual Trigger Zones (53, 60, etc.)
👑 KRAL’in Morning Star Radari (Tam Donanimli)Hello friends. Standing before you, this indicator is an indicator that detects a "morning star" candle formation in which the decline %, falling candle number and volume are higher than the previous one and gives this as a warning. Enjoy it.
Elliott Waves Auto (Waves 1–3)//@version=5
indicator("Elliott Waves Auto (Waves 1–3)", overlay=true)
pivotLen = input.int(5, "Pivot Lookback", minval=1)
// === كشف القمم والقيعان ===
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
var float wave1Low = na
var float wave1High = na
var float wave2Low = na
var float wave3High = na
var int wave1LowBar = na
var int wave1HighBar = na
var int wave2LowBar = na
var int wave3HighBar = na
// === اكتشاف موجة 1 ===
if pl and na(wave1Low)
wave1Low := low
wave1LowBar := bar_index - pivotLen
if ph and not na(wave1Low) and na(wave1High)
wave1High := high
wave1HighBar := bar_index - pivotLen
// === اكتشاف موجة 2 ===
if pl and not na(wave1High) and na(wave2Low)
wave2Low := low
wave2LowBar := bar_index - pivotLen
// === اكتشاف موجة 3 ===
if ph and not na(wave2Low) and na(wave3High)
possibleWave3 = high
if possibleWave3 > wave1High
wave3High := possibleWave3
wave3HighBar := bar_index - pivotLen
// === رسم الموجات ===
if not na(wave1Low) and not na(wave1High)
line.new(wave1LowBar, wave1Low, wave1HighBar, wave1High, color=color.blue, width=2)
label.new(wave1LowBar, wave1Low, text="Wave 1", style=label.style_label_up, color=color.blue, textcolor=color.white)
if not na(wave1High) and not na(wave2Low)
line.new(wave1HighBar, wave1High, wave2LowBar, wave2Low, color=color.orange, width=2)
label.new(wave2LowBar, wave2Low, text="Wave 2", style=label.style_label_down, color=color.orange, textcolor=color.white)
if not na(wave2Low) and not na(wave3High)
line.new(wave2LowBar, wave2Low, wave3HighBar, wave3High, color=color.green, width=2)
label.new(wave3HighBar, wave3High, text="Wave 3", style=label.style_label_up, color=color.green, textcolor=color.white)
Ultimate Crossover Indicator (Tablolu & Bar Hizalı)Komut dosyası tüm geçerli indikatörleri orta ve kısa vade için toplu olarak grafik üzerinde gösteriyor. tablo üzerinde çizgi açıklamaları var. İnceleyip kullanabilirsiniz. :)
Ultimate Crossover Indicator (EMA, MACD, RSI, QQE, ATR)
📌 This indicator analyzes trend direction and momentum crossovers to generate the most reliable buy and sell signals.
✅ A live indicator panel is displayed at the top center of the chart showing real-time EMA, MACD, RSI, QQE, and ATR values.
✅ Indicators are aligned with price levels for better readability and accuracy.
✅ MACD and QQE crossovers confirm trend reversals with greater precision.
✅ RSI identifies overbought and oversold conditions to filter out false signals.
✅ ATR measures volatility, helping set safer stop-loss levels.
💡 Optimized for minute and hourly charts! This is a perfect tool for traders looking to enhance their market analysis on TradingView.
🚀 Use this indicator on TradingView to identify buy and sell opportunities more clearly! 📊
✅ This description is ready for publishing! Let me know if you need any refinements. 🚀😃
Volume Pulse con segnali e DashboardThe Volume Pulse indicator is designed for scalping strategies, helping traders identify quick, high-probability trading opportunities based on two main factors:
Range Breakout: When the price breaks above or below a key level (the highest or lowest point of a specified range).
Volume Confirmation: The breakout is validated if the volume is significantly higher than the average (multiplied by a customizable factor) to confirm that the move is strong and not a false breakout.
How It Works:
BUY Signals: Triggered when the price breaks above the high of a defined range (range 1 or 2), with volume exceeding the average by the specified multiplier (vol_threshold).
SELL Signals: Triggered when the price falls below the low of a defined range, with volume confirming the move.
The BUY signals are shown as green upward arrows below the candle, while the SELL signals appear as red downward arrows above the candle.
Sidebar Dashboard:
The sidebar dashboard provides real-time market conditions:
Signal Status: Displays whether a BUY or SELL signal is active.
Volume: Shows the current candle's volume.
Volatility: Indicates the volatility, calculated as the standard deviation of the closing prices, useful for assessing market pressure.
Alerts:
Alerts are set up to notify the trader when a BUY or SELL signal occurs, allowing for quick reaction to market conditions.
Customization:
You can adjust the volume multiplier to make the signals more or less selective.
The dashboard can be customized to show additional information or adjust its placement on the chart.
Conclusion:
This scalping indicator combines breakout analysis with volume confirmation, offering a quick and effective way to spot short-term trading opportunities. It provides clear visual signals and an intuitive dashboard to help scalpers analyze the market and act swiftly.
MR CHAU🔍 MR CHAU — Trend & Reversal Smart Indicator
MR CHAU is a smart price action-based tool that helps you spot trend direction and key reversal signals. It colors candles based on strength, detects bullish/bearish pinbars and engulfing patterns, and highlights retest zones where price often turns.
📊 Built for traders who value clean visuals and actionable signals — no clutter, just clarity.
✅ Buy/Sell alerts included
✅ Works on all timeframes
✅ Perfect for trend-followers and reversal traders
Comercial Trader -Vol. Desvio PadrãoScript criado para fazer a distribuição de volatilidade do ativo pelo desvio padrão
PDH/PDL HUD (Final, Always Visible)This script creates a simple, reliable heads-up display (HUD) in the top-right corner of the chart that shows:
Previous Day High (PDH)
Previous Day Low (PDL)
It uses session rollover (detected via daily time change) to lock in values from the prior trading day. The data is displayed in a single, always-visible table—no chart overlays, no line clutter, no in-bar labels.
OptimumTrader SignalsOptimumTrader Signals is a user-friendly indicator that generates BUY and SELL signals based on moving average crossovers (default: 9-period and 21-period MAs). It features customizable candle colors, signal labels, and dashed signal lines to help traders identify trends easily.
Small Cap Momentum Entry System✅ Features Included:
Momentum entry detection
Trailing stop overlay
Alert for entry and exit
Pre-market high line (optional display toggle)
Chandelier Exit 優化版//@version=5
indicator('Chandelier Exit 優化版', shorttitle='CE優化', overlay=true)
var string calcGroup = 'Calculation'
length = input.int(title='ATR週期', defval=22, group=calcGroup)
mult = input.float(title='ATR倍數', step=0.1, defval=3.0, group=calcGroup)
useClose = input.bool(title='使用收盤價計算高低點', defval=true, group=calcGroup)
var string visualGroup = '視覺設定'
showLabels = input.bool(title='顯示買/賣標籤', defval=true, group=visualGroup)
highlightState = input.bool(title='高亮趨勢區域', defval=true, group=visualGroup)
var string alertGroup = '警報設定'
awaitBarConfirmation = input.bool(title="等待K棒收定再確認訊號", defval=false, group=alertGroup)
atr = mult * ta.atr(length)
longStop = (useClose ? ta.highest(close, length) : ta.highest(length)) - atr
longStopPrev = nz(longStop , longStop)
longStop := close > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = (useClose ? ta.lowest(close, length) : ta.lowest(length)) + atr
shortStopPrev = nz(shortStop , shortStop)
shortStop := close < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
var int dir = 1
dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dir
var color longColor = color.green
var color shortColor = color.red
var color longFillColor = color.new(color.green, 90)
var color shortFillColor = color.new(color.red, 90)
var color textColor = color.white
longStopPlot = plot(dir == 1 ? longStop : na, title='多方停損', style=plot.style_linebr, linewidth=2, color=longColor)
buySignal = dir == 1 and dir == -1
plotshape(buySignal ? longStop : na, title='買進訊號', location=location.absolute, style=shape.circle, size=size.tiny, color=longColor)
plotshape(buySignal and showLabels ? longStop : na, title='買標籤', text='買', location=location.absolute, style=shape.labelup, size=size.tiny, color=longColor, textcolor=textColor)
shortStopPlot = plot(dir == 1 ? na : shortStop, title='空方停損', style=plot.style_linebr, linewidth=2, color=shortColor)
sellSignal = dir == -1 and dir == 1
plotshape(sellSignal ? shortStop : na, title='賣出訊號', location=location.absolute, style=shape.circle, size=size.tiny, color=shortColor)
plotshape(sellSignal and showLabels ? shortStop : na, title='賣標籤', text='賣', location=location.absolute, style=shape.labeldown, size=size.tiny, color=shortColor, textcolor=textColor)
midPricePlot = plot(ohlc4, title='', style=plot.style_circles, linewidth=0, display=display.none, editable=false)
longStateFillColor = highlightState ? dir == 1 ? longFillColor : na : na
shortStateFillColor = highlightState ? dir == -1 ? shortFillColor : na : na
fill(midPricePlot, longStopPlot, title='多方區域', color=longStateFillColor)
fill(midPricePlot, shortStopPlot, title='空方區域', color=shortStateFillColor)
await = true // 立即通知快訊,無需等K棒收定
alertcondition(dir != dir and await, title='警報: 趨勢改變', message='Chandelier Exit 趨勢改變!')
alertcondition(buySignal and await, title='警報: 買進訊號', message='Chandelier Exit 買進訊號!')
alertcondition(sellSignal and await, title='警報: 賣出訊號', message='Chandelier Exit 賣出訊號!')
Premium Lux AlgoCombining multiple indicators to receive buy and sell signals and create support and resistance levels and cloud space
Zweig Breadth Thrust (%)Zweig Breadth Thrust Indicator for US Markets (NYSE, NASDAQ, AMEX, All Markets)
The formula for calculating the Zweig Breadth Thrust involves several steps. Here’s a simplified version of the calculation:
1. Calculate the number of advancing stocks (those that increased in price) over a specified period, usually the past 10 trading days.
2. Calculate the number of declining stocks (those that decreased in price) over the same period.
3. Calculate the 10-day moving average (either SMA or EMA) of the advancing stocks.
4. Calculate the 10-day moving average (either SMA orEMA) of the declining stocks.
5. Calculate the ZBT value by dividing the 10-day EMA of advancing issues by the sum of the 10-day EMA of advancing issues and the 10-day EMA of declining issues, then multiplying by 100 to convert it to a percentage.
Merged: Range Filter & Smart Envelope//@version=5
indicator("Merged: Range Filter & Smart Envelope", overlay=true, max_lines_count=500, max_labels_count=500)
// ==================== Range Filter Settings ====================
// Color variables
upColor = color.white
midColor = #90bff9
downColor = color.blue
// Source
src = input(defval=close, title="Source")
// Sampling Period
per = input.int(defval=100, minval=1, title="Sampling Period")
// Range Multiplier
mult = input.float(defval=3.0, minval=0.1, title="Range Multiplier")
// Smooth Average Range
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrng = ta.ema(avrng, wper) * m
smoothrng
smrng = smoothrng(src, per, mult)
// Range Filter
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt ) ? x - r < nz(rngfilt ) ? nz(rngfilt ) : x - r :
x + r > nz(rngfilt ) ? nz(rngfilt ) : x + r
rngfilt
filt = rngfilt(src, smrng)
// Filter Direction
upward = 0.0
upward := filt > filt ? nz(upward ) + 1 : filt < filt ? 0 : nz(upward )
downward = 0.0
downward := filt < filt ? nz(downward ) + 1 : filt > filt ? 0 : nz(downward )
// Target Bands
hband = filt + smrng
lband = filt - smrng
// Colors
filtcolor = upward > 0 ? upColor : downward > 0 ? downColor : midColor
barcolor = src > filt and src > src and upward > 0 ? upColor :
src > filt and src < src and upward > 0 ? upColor :
src < filt and src < src and downward > 0 ? downColor :
src < filt and src > src and downward > 0 ? downColor : midColor
filtplot = plot(filt, color=filtcolor, linewidth=2, title="Range Filter")
// Target
hbandplot = plot(hband, color=color.new(upColor, 70), title="High Target")
lbandplot = plot(lband, color=color.new(downColor, 70), title="Low Target")
// Fills
fill(hbandplot, filtplot, color=color.new(upColor, 90), title="High Target Range")
fill(lbandplot, filtplot, color=color.new(downColor, 90), title="Low Target Range")
// Bar Color
barcolor(barcolor)
// Break Outs
longCond = bool(na)
shortCond = bool(na)
longCond := src > filt and src > src and upward > 0 or
src > filt and src < src and upward > 0
shortCond := src < filt and src < src and downward > 0 or
src < filt and src > src and downward > 0
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni
longCondition = longCond and CondIni == -1
shortCondition = shortCond and CondIni == 1
// ==================== Smart Envelope with Stochastic RSI ====================
h_env = input.float(8., 'Bandwidth', minval = 0)
mult_env = input.float(3., minval = 0)
repaint = input(true, 'Repainting Smoothing')
// Stochastic RSI Settings
smoothK = input.int(3, "K", minval=1)
smoothD = input.int(3, "D", minval=1)
lengthRSI = input.int(14, "RSI Length", minval=1)
lengthStoch = input.int(14, "Stochastic Length", minval=1)
rsi1 = ta.rsi(src, lengthRSI)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = ta.sma(k, smoothD)
// Nadaraya-Watson Envelope Functions
gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2)))
var coefs = array.new_float(0)
var den = 0.
if barstate.isfirst and not repaint
for i = 0 to 499
w = gauss(i, h_env)
coefs.push(w)
den := coefs.sum()
out = 0.
if not repaint
for i = 0 to 499
out += src * coefs.get(i)
out /= den
mae = ta.sma(math.abs(src - out), 499) * mult_env
upper_env = out + mae
lower_env = out - mae
// Compute and display NWE
n = bar_index
var float y2 = na
var float y1 = na
nwe = array.new(0)
if barstate.islast and repaint
sae = 0.
for i = 0 to math.min(499,n - 1)
sum = 0.
sumw = 0.
for j = 0 to math.min(499,n - 1)
w = gauss(i - j, h_env)
sum += src * w
sumw += w
y2 := sum / sumw
sae += math.abs(src - y2)
nwe.push(y2)
sae := sae / math.min(499,n - 1) * mult_env
for i = 0 to math.min(499,n - 1)
if i % 2
line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color=color.teal)
line.new(n-i+1, y1 - sae, n-i, nwe.get(i) - sae, color=color.red)
y1 := nwe.get(i)
// Plot Nadaraya-Watson Envelope
plot(repaint ? na : out + mae, 'Upper Envelope', color=color.teal)
plot(repaint ? na : out - mae, 'Lower Envelope', color=color.red)
// Stochastic RSI Plot
plot(k, "Stochastic RSI K", color=color.blue)
plot(d, "Stochastic RSI D", color=color.orange)
h0 = hline(80, "Upper Band", color=color.gray)
hline(50, "Middle Band", color=color.new(color.gray, 50))
h1 = hline(20, "Lower Band", color=color.gray)
fill(h0, h1, color=color.rgb(33, 150, 243, 90), title="Stochastic RSI Background")
// ==================== Combined Signal Logic ====================
// Enhanced Signal Confirmation
ma_length = input.int(20, "Filter Moving Average Length", minval=1)
ma = ta.sma(close, ma_length)
// Combined Buy Signal: Range Filter + Stochastic RSI + Envelope
combined_buy = (longCondition or (ta.crossover(k, d) and close > upper_env)) and close > ma
combined_sell = (shortCondition or (ta.crossunder(k, d) and close < lower_env)) and close < ma
// Plot combined signals with higher priority
plotshape(combined_buy, "Combined Buy", shape.labelup, location.belowbar, color=color.green, size=size.normal, text="STRONG BUY")
plotshape(combined_sell, "Combined Sell", shape.labeldown, location.abovebar, color=color.red, size=size.normal, text="STRONG SELL")
// Original signals (lower priority)
plotshape(longCondition and not combined_buy, "Buy Signal", shape.labelup, location.belowbar, color=color.lime, size=size.small, text="BUY")
plotshape(shortCondition and not combined_sell, "Sell Signal", shape.labeldown, location.abovebar, color=color.maroon, size=size.small, text="SELL")
// Plot the moving average filter line
plot(ma, "Filter MA", color=color.purple, linewidth=2)
// Alerts
alertcondition(combined_buy, title="Strong Buy Alert", message="Strong Buy Signal")
alertcondition(combined_sell, title="Strong Sell Alert", message="Strong Sell Signal")