Options Confluence Overlay - Stocks (1D) The Options Confluence Overlay — Stocks is a daily timeframe indicator designed for equities and ETFs, with a focus on timing, structure, and risk clarity rather than frequent signals.
This tool combines price structure, volatility, and momentum timing into a single visual framework that helps traders decide when to trade, when to stand aside, and where risk and exits are clearly defined.
Unlike fast-signal indicators, this script emphasizes trade quality over trade quantity.
🔍 What the indicator does
The indicator evaluates four core components on the daily chart, with an optional weekly trend filter:
• Mean + Deviation Band (Band 1) to define structure
• ATR-based targets to project realistic price expansion
• Momentum timing using Stochastic RSI (cross or approach)
• Confluence scoring to allow or block trades
Only when these elements align does the indicator permit a CALL, PUT, or display NO-TRADE.
🟩 Preferred Entry Zone (PEZ)
When a CALL or PUT is allowed, the indicator highlights a Preferred Entry Zone (PEZ):
• CALL PEZ: Mean → Lower Band
• PUT PEZ: Mean → Upper Band
This zone represents areas where risk is better defined and entries are typically more favorable.
🎯 Primary Exit (Partial ATR)
Instead of encouraging traders to chase full volatility expansion, the indicator includes a Primary Exit level:
• A configurable percentage of ATR
• Designed to capture early, high-probability movement
• Especially useful for shorter-term trades or profit protection
Full ATR targets are still shown, but the Primary Exit is intended as the first decision point, not a promise of full extension.
🧠 Entry Quality (Informational)
When enabled, the dashboard displays an Entry Quality hint:
• PEZ Deep — price is deeper into the zone (higher potential, higher patience required)
• PEZ Shallow — price is closer to the mean (faster, but less extended setups)
This is informational only and does not block trades.
🚦 Trade states
The dashboard clearly communicates one of three states:
• CALL allowed
• PUT allowed
• NO-TRADE (conditions are mixed or incomplete)
The indicator is intentionally conservative during NO-TRADE periods.
⚠️ Important notes
• Designed for stocks and ETFs, not crypto
• Intended for daily timeframe analysis
• Not financial advice
• Always combine with proper risk management
📘 Model Trade Example (CALL)
The dashboard shows CALL allowed
Price pulls back into the green PEZ
Weekly filter confirms bullish direction
Enter near the PEZ (no chasing breakouts)
Risk: below Band 1 low
Primary Exit: at the yellow Primary Exit level
Optional: hold partial size toward full ATR target if momentum remains strong
If the dashboard changes to NO-TRADE, no new entries are taken.
📕 Model Trade Example (PUT)
The dashboard shows PUT allowed
Price rallies into the red PEZ
Weekly filter confirms bearish direction
Enter near resistance inside PEZ
Risk: above Band 1 high
Primary Exit: at the yellow Primary Exit level
Avoid holding through momentum exhaustion
Wskaźniki i strategie
Segment 4h modifiable via inputsSegment 4h modifiable via inputs : pour positionner un segment n'importe ou en modifiant le prix pour la hauteur dans la configuration et déplaçable facilement à la souris temporellement.
4-hour segment modifiable via inputs: to position a segment anywhere by modifying the price for the height in the configuration and easily movable with the mouse in terms of time
Levels by EVThis indicator plots a clean set of commonly used reference levels on the chart, including the prior day high and low (PDH/PDL), the current day open (DO), prior week high and low (PWH/PWL), prior month high and low (PMH/PML).
Daily, weekly, and monthly levels are sourced from their respective higher timeframes to keep the values stable and consistent across intraday charts. Session ranges are calculated using a selectable timezone and are updated in a controlled way to avoid unnecessary object creation and chart clutter. An optional setting allows developing session highs and lows to update while the session is active, or you can keep session levels fixed once the session ends.
Use these levels as context for liquidity, support/resistance, and session structure. Labels can be enabled or disabled, and can optionally be kept on the right edge so the chart remains readable on any zoom level.
Rolling DrawdownRolling Drawdown, trying to get an auto updating drawdown. work in progress. will edit in future
EMA Touch Alert Realtime (Once Per Bar)This alert notifies you when the price touches the EMA you set. Once it notifies you, it is designed not to notify you again on that same candlestick.
FlowMaster 4H - Avanced Volume & Pip Analyzer“Visualize market flow like an institutional trader – track buy/sell volume, pip per tick, and candle efficiency in one table.”
“Visualize market flow like an institutional trader – track buy/sell volume, pip per tick, and candle efficiency in one table.”
Short Description (Marketplace-Friendly):
Aggregated 4H candle analysis with buy/sell volume breakdown.
Pip/Tick calculation with weighted averages for smarter entry/exit signals.
Compare current candle volume to previous candle and 20-bar average.
All key metrics in a compact, easy-to-read table below the chart.
Ideal for Forex swing & position traders seeking institutional-style insights directly in TradingView.
Long Description / Full Product Info:
FlowMaster 4H is a professional-grade trading indicator designed to provide quantitative order flow analysis on Forex markets using 4-hour candles. By aggregating volume data, tick information, and pip movements, FlowMaster gives traders a unique perspective on market dynamics typically reserved for institutional participants.
Key Features:
Volume Relative Metrics: Compare the current candle volume to the previous candle and to the average of the last 20 candles.
Pip/Tick Analysis: Calculates pip per tick using a scaled price approach, giving insights into the efficiency of price moves.
Weighted Pip/Tick Averages: Tracks volume-weighted pip/tick over the last 20 candles for both buyers and sellers.
Percentage Metrics: Visualize the proportion of buy and sell volume relative to total ticks, helping identify absorption and impulse movements.
User-Friendly Table: All key indicators displayed in a compact, easy-to-read table below the chart.
Why use FlowMaster 4H:
Identify market absorption and impulse using reliable volume and pip metrics.
Optimize trade entry and exit decisions based on quantitative order flow data.
Works directly in TradingView, offering a professional order flow view without needing access to Level 2 order book data.
Pioneering approach in aggregating 4H candle data with detailed pip/tick insights.
Ideal For: Swing and position traders, Forex traders seeking institutional-style volume analysis, and anyone looking to improve order flow reasoning using TradingView.
Heikin Ashi SMA 9 / 20 / 50 (MTF + Selectable Source)This is simple Heikin ashi value three moving average as 9 / 20 / 50 for clear trend identification . use it wisely with other confirmation .
14SMA13 20/30/50 First Order AppearanceIn white, it's a buy signal, and in orange, it's a sell signal.
The signal is given when the simple moving averages 20+30+50 cross.
To confirm entry, wait for a volume candle that breaks through the 50-period simple moving average of volume, whether for buying or selling.
You set your selling targets according to your own analysis method.
LogTrend Retest EngineLogTrend Retest Engine (LTRE)
LogTrend Retest Engine (LTRE) is an advanced trend-continuation overlay designed to identify high-probability breakout retests using logarithmic regression , volatility-adjusted deviation bands , and market regime filtering .
Unlike traditional channels or moving averages, LTRE models price behavior in log space , allowing it to adapt naturally to exponential market moves common in crypto, indices, and long-term trends.
🔹 How It Works
Logarithmic Regression Core
Performs linear regression on log-transformed price and time
Produces a structurally accurate trend midline that scales with price growth
Volatility-Adjusted Deviation Bands
Dynamic upper and lower zones based on statistical deviation
ATR weighting expands or contracts bands as volatility changes
Adaptive Lookback (Optional)
Automatically adjusts regression length using volatility pressure
Faster response in high-volatility environments, smoother in consolidation
🔹 Market Regime Detection
LTRE actively filters conditions using:
R² trend strength (trend quality, not just slope)
Volatility compression vs expansion
User-defined minimum trend strength threshold
Signals are disabled during ranging or low-quality conditions .
🔹 Breakout → Retest Signal Logic
LTRE does not chase breakouts.
Signals trigger only when:
1. Price breaks cleanly outside the deviation band
2. Market regime is confirmed as trending
3. Price performs a controlled retest within a user-defined tolerance
BUY
Break above upper band → retest → trend confirmed
SELL
Break below lower band → retest → trend confirmed
This structure is designed to reduce false breakouts and late entries.
🔹 Visual & Projection Tools
Clean midline and deviation bands
Optional filled zones
Optional future trend projection for forward structure planning
On-chart statistics for trend strength and volatility compression
🔹 Best Use Cases
Trend continuation & pullback strategies
Crypto, Forex, Indices, and equities
Works best on 15m and higher timeframes
⚠️ Disclaimer
LTRE is a decision-support tool , not a complete trading system. Always use proper risk management and confirm signals with additional structure, volume, or higher-timeframe context.
Built for traders who wait for structure — not noise.
SMA by EVEV Simple Moving Average (SMA) is a lightweight, open-source SMA indicator with configurable length, price source, and visual offset. It is designed to provide a clean moving-average reference for trend context and mean reversion workflows on any market and timeframe. The offset parameter shifts the plotted line for visualization only and does not affect the underlying calculation.
EMA + PDH/PDL 2 Days [Scalping-Algo]🎯 Overview
A clean, focused scalping indicator designed for 2-minute and 4-minute stock charts. Combines trend-following EMAs with key daily support/resistance zones to identify high-probability scalp entries.
🛠️ What's Included
ComponentDescription🟡 EMA 13Fast momentum line🟣 EMA 48Medium trend filter🔴 EMA 200Major trend direction🔵 PDH/PDLPrevious day high & low zones🟠 PDH-2/PDL-22 days ago high & low zones
⏰ Session Filter
Only displays levels during regular trading hours (9:30 AM - 4:00 PM EST) to keep your chart clean during pre/post market.
📊 How to Use for Scalping
✅ Long Setup (2m/4m chart)
Price above EMA 200 (bullish bias)
Price pulls back to PDH/PDL zone or EMA 48
EMA 13 crosses above EMA 48
Enter on bounce from zone
Target: next resistance zone or 1:2 R/R
❌ Short Setup (2m/4m chart)
Price below EMA 200 (bearish bias)
Price rallies into PDH/PDL zone or EMA 48
EMA 13 crosses below EMA 48
Enter on rejection from zone
Target: next support zone or 1:2 R/R
💡 Pro Tips
TipWhy🔥 Trade the first hourMost volume & volatility🎯 Zone confluenceBest setups when PDH/PDL aligns with EMAs⚡ Quick exitsScalping = small gains, don't overstay🚫 Avoid chopSkip trades when price is stuck between zones📉 Respect EMA 200Don't long below it, don't short above it
🔵 Zone Colors Explained
Blue zones → Yesterday's high/low (stronger levels)
Orange zones → 2 days ago high/low (secondary levels)
Zone thickness → 20 ticks buffer for natural price noise
⚙️ Best Settings
TimeframeBest For2 minuteQuick scalps, 5-15 cent targets4 minuteSlightly larger moves, less noise
📌 Recommended Pairs
Works best on liquid stocks with tight spreads:
SPY, QQQ, AAPL, TSLA, AMD, NVDA, META, AMZN
⚠️ Risk Management
RuleSuggestion🛑 Stop lossBelow/above the zone (tight)🎯 Take profit1:2 or 1:3 risk/reward minimum📏 Position sizeMax 1-2% account risk per trade
🚀 Quick Start
Add indicator to 2m or 4m chart
Wait for price to reach a colored zone
Confirm trend direction with EMA 200
Look for EMA 13/48 alignment
Enter with tight stop, scale out at targets
The Island RSI MasteryComplete Breakdown of the Indicator.
Let me walk you through every component of this trading indicator to help you fully understand its logic and application. Overall PurposeThis indicator combines momentum analysis (RSI) with volume-based price levels to identify high-probability trading opportunities.
It answers three key questions:
When is momentum shifting? (RSI crossovers).
Where are institutional zones? (High-volume S/R levels).
Is a breakout confirmed? (Price closing beyond key levels).
CIRRUS strategyVWAP EMA CROSS VOLUME STRATEGY WITH TIME FILTER
with this indicator you will be able to use a free strategy using selected volume , emas and vwaps using the timeframe filter too
Daily Extension from 50DMA (adjustable) in ATR%Indicator to easily spot over extended prices in relation to ATR.
ATR or ADR easily referenced
BD SessionsSession boxes indicator for intraday charts.
Highlights up to four customizable market sessions using transparent boxes with clearly defined high/low ranges and labels.
Each session can be individually configured by name, time, timezone, and color.
Free cash flow yield (Quarterly)Indicator: Free Cash Flow Yield (Quarterly) — Technical Description
Purpose
This indicator plots Free Cash Flow Yield (FCF Yield) using quarterly fundamentals and optionally adjusts it for dilution. It also computes trailing averages over multiple horizons (in quarters) to give a long-term valuation context.
Data Sources
All fundamentals are pulled from TradingView’s financial dataset using:
request.financial(syminfo.tickerid, , "FQ", barmerge.gaps_on)
Where:
"FQ" = Quarterly frequency
barmerge.gaps_on = keeps values as step-like series (updates only when new quarterly data is available)
Financial fields used:
FREE_CASH_FLOW (FCF)
ENTERPRISE_VALUE (EV)
TOTAL_SHARES_OUTSTANDING
DILUTED_SHARES_OUTSTANDING
Market cap is derived (not pulled directly in this version):
marketCap = totalSharesOutstanding * close
(Only used as a reference in the script; the yield itself is based on EV.)
Core Calculation
1) FCF Yield (Net)
The base yield is:
FCF Yield
(
%
)
=
FCF
Enterprise Value
×
100
FCF Yield(%)=
Enterprise Value
FCF
×100
Implementation detail:
If FCF is na or EV is na or EV == 0, the result is set to na to avoid division errors.
Dilution Adjustment (Optional Series)
2) Dilution Ratio
The script estimates dilution impact using:
dilutionRatio
=
Total Shares Outstanding
Diluted Shares Outstanding
dilutionRatio=
Diluted Shares Outstanding
Total Shares Outstanding
Notes:
If dilutedSharesOutstanding is missing or zero, the ratio becomes na.
3) Diluted FCF Yield
If the ratio indicates dilution (<= 1), yield is scaled down:
FCF Yield Diluted
=
FCF Yield
×
dilutionRatio
FCF Yield Diluted=FCF Yield×dilutionRatio
Else (ratio > 1 or na), the script defaults to the net yield:
FCF Yield Diluted
=
FCF Yield
FCF Yield Diluted=FCF Yield
Practical interpretation:
More dilution → lower ratio → lower diluted yield.
If dilution fields are not reliable for a ticker, the script falls back to the base yield.
Plotting
Two series are shown:
FCF Yield Net: plotted as columns (bars)
FCF Yield Diluted: plotted as an area overlay
This makes it easy to see:
Step changes when new quarter data arrives
Whether dilution meaningfully reduces the yield
Labels (Per-bar)
When fcfYieldDiluted > 0, the script prints the value as a percentage label at the yield level.
Important technical point:
Since fcfYieldDiluted is computed as a number like 8.5 for 8.5%, labels convert to percent format by dividing by 100 before formatting:
str.tostring(fcfYieldDiluted / 100, format.percent)
Rolling History & Averages
1) Rolling storage
The script maintains a rolling array of the most recent 40 quarterly values:
40 quarters ≈ 10 years
Each time a non-NA quarterly yield appears:
It pushes it into the array
If array length exceeds 40, it removes the oldest value
2) Trailing averages (quarter windows)
Averages are computed over the most recent N quarters:
1Q (latest quarter value)
4Q ≈ 1 year
8Q ≈ 2 years
20Q ≈ 5 years
40Q ≈ 10 years
If fewer than N values exist, that average is na.
End-of-chart Summary Label
On the last bar (barstate.islast), the script draws a summary label containing the trailing averages listed above.
Placement logic
The label is positioned slightly to the right of the current bar:
Uses frequencyUnit (estimated number of chart bars per quarter) to offset the label into the future.
frequencyUnit is computed as:
frequencyUnit
≈
Seconds in 12 months
Seconds per chart bar
÷
4
frequencyUnit≈
Seconds per chart bar
Seconds in 12 months
÷4
This is only for visual spacing, not calculation correctness.
Limitations / Notes
The yield series is “step-like” and updates only when new quarterly fundamentals are available.
For some tickers, TradingView fundamentals (especially diluted shares) can be missing or inconsistent; the script protects against this by returning na or falling back to the net yield.
EV-based yield can differ from market-cap-based yield; EV includes debt and cash effects, so it’s closer to an “all-capital” valuation measure.
Cloud Gold TrendTrend Filter (Ichimoku): If the price is above the cloud (Kumo), look only for "Long" signals. If it is below, look only for "Short" signals.
Entry Signal (Bollinger): When the price touches the Lower Band while you are above the Cloud, it could be a great buying point in an uptrend.
Volatility Confirmation: If the Bollinger Bands squeeze within the cloud, get ready for a strong directional move as soon as the price breaks one of the two levels.
Crash Prevention OpenSource by exp3rtsOpen Source Version - no updates!
Crash Prevention OpenSource by exp3rts – Automated Exit Strategy for TradingView
This indicator allows you to automatically close positions based on dynamic price levels derived from the previous candle with a configurable offset. Perfect for risk management and automated “hard stop” exits.
Key Features:
Flexible Exit Directions: Choose to trigger exits for Long, Short, or Both directions.
Dynamic Exit Levels: Lines are automatically calculated above/below the previous candle plus/minus a user-defined offset in points.
Visual Cues: Clear arrows indicate the exact bar where price touched the exit line.
Session-Independent: Works on any chart and timeframe without manual adjustments.
Webhook Alerts: Sends JSON alerts on touch, enabling integration with external systems or bots.
Auto-Close Logic: Ensures positions are closed immediately when the threshold is breached, keeping trades in check.
How it works:
For Long exits, the line is drawn below the previous bar’s low minus the offset.
For Short exits, the line is drawn above the previous bar’s high plus the offset.
When price crosses the line, the position is closed, an arrow is plotted on the chart, and an alert is fired.
Ideal for traders who want strict stop management or automated exit conditions while keeping visual clarity on the chart.
EDUVEST Lorentzian ClassificationEDUVEST Lorentzian Classification - Machine Learning Signal Detection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ORIGINALITY
This indicator enhances the original Lorentzian Classification concept by jdehorty with EduVest's visual modifications and alert system integration. The core innovation is using Lorentzian distance instead of Euclidean distance for k-NN classification, providing more robust pattern recognition in financial markets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WHAT IT DOES
- Generates BUY/SELL signals using machine learning classification
- Displays kernel regression estimate for trend visualization
- Shows prediction values on each bar
- Provides trade statistics (Win Rate, W/L Ratio)
- Includes multiple filter options (Volatility, Regime, ADX, EMA, SMA)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW IT WORKS
【Lorentzian Distance Calculation】
Unlike Euclidean distance, Lorentzian distance uses logarithmic transformation:
d = Σ log(1 + |xi - yi|)
This provides:
- Better handling of outliers
- More stable distance measurements
- Reduced sensitivity to extreme values
【Feature Engineering】
The classifier uses up to 5 configurable features:
- RSI (Relative Strength Index)
- WT (WaveTrend)
- CCI (Commodity Channel Index)
- ADX (Average Directional Index)
Each feature is normalized using the n_rsi, n_wt, n_cci, or n_adx functions.
【k-Nearest Neighbors Classification】
1. Calculate Lorentzian distance between current bar and historical bars
2. Find k nearest neighbors (default: 8)
3. Sum predictions from neighbors
4. Generate signal based on prediction sum (>0 = Long, <0 = Short)
【Kernel Regression】
Uses Rational Quadratic kernel for smooth trend estimation:
- Lookback Window: 8
- Relative Weighting: 8
- Regression Level: 25
【Filters】
- Volatility Filter: Filters signals during extreme volatility
- Regime Filter: Identifies market regime using threshold
- ADX Filter: Confirms trend strength
- EMA/SMA Filter: Trend direction confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW TO USE
【Recommended Settings】
- Timeframe: 15M, 1H, 4H, Daily
- Neighbors Count: 8 (default)
- Feature Count: 5 for comprehensive analysis
【Signal Interpretation】
- Green BUY label: Long entry signal
- Red SELL label: Short entry signal
- Bar colors: Green (bullish) / Red (bearish) prediction strength
【Trade Statistics Panel】
- Winrate: Historical win percentage
- Trades: Total (Wins|Losses)
- WL Ratio: Win/Loss ratio
- Early Signal Flips: Premature signal changes
【Filter Recommendations】
- Enable Volatility Filter for ranging markets
- Enable Regime Filter for trend confirmation
- Use EMA Filter (200) for higher timeframes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ CREDITS
Original Lorentzian Classification concept and MLExtensions library by jdehorty.
Enhanced with visual modifications and alert integration by EduVest.
License: Mozilla Public License 2.0
Aggro-15min Pro V4.2 [SMA200 + Vortex] (v6 Ready)🚀 Aggro-15min Pro
Aggro-15min Pro is a professional-grade algorithmic strategy optimized for the 15-minute timeframe. It combines structural trend analysis with aggressive momentum tracking to capture high-probability swings while filtering out market noise.
🛠️ How the Strategy Works
1. Structural Trend (The "Guardrail")
200 SMA: The strategy identifies the primary market direction. It only buys above the 200 SMA and only sells below it, ensuring you stay on the side of institutional flow.
2. Execution Trigger (The "Signal")
EMA Cross (9/50): A crossover of the 9-period Fast EMA and 50-period Slow EMA triggers the entry, identifying a confirmed shift in medium-term momentum.
3. Momentum Engine (The "Vortex")
Vortex Indicator (VI): Validates the "thrust" behind the move.
Dynamic Exit: Includes a "Vortex Reverse" logic that closes trades early if the directional energy fades, preserving capital before a full reversal occurs.
4. Risk & Volatility
ADX Filter: Prevents entries during low-volatility "sideways" periods.
ATR Risk Management: Uses the Average True Range to set dynamic Stop Loss and Take Profit levels that adapt to current market volatility.
-
-
# 📂 STRATEGY PACKAGE: AGGRO-15MIN PRO
**Version:** 4.2 (Pine Script v6 Ready)
**Asset Class:** Crypto, Forex, Indices
**Timeframe:** 15 Minutes
---
## 📘 1. OPERATIONS MANUAL (English)
### 🟢 Strategy Overview
Aggro-15min Pro is a momentum-based trend-following system. It uses a "Triple-Filter" logic to ensure that trades are only taken when long-term trend, medium-term momentum, and short-term volatility are perfectly aligned.
### 🟢 Technical Indicators Setup
* **Structural Filter:** 200-period Simple Moving Average (SMA).
* **Trigger Engine:** 9-period & 50-period Exponential Moving Averages (EMA).
* **Momentum Engine:** 14-period Vortex Indicator (VI).
* **Strength Filter:** 14-period Average Directional Index (ADX).
* **Volatility/Exits:** 14-period Average True Range (ATR).
### 🟢 Entry Checklist
#### LONG Position:
1. **Trend:** Price is **ABOVE** the 200 SMA.
2. **Trigger:** 9 EMA crosses **ABOVE** the 50 EMA.
3. **Vortex:** VIP (Positive) is **ABOVE** VIM (Negative).
4. **Strength:** ADX is **ABOVE** 20.
#### SHORT Position:
1. **Trend:** Price is **BELOW** the 200 SMA.
2. **Trigger:** 9 EMA crosses **BELOW** the 50 EMA.
3. **Vortex:** VIM (Negative) is **ABOVE** VIP (Positive).
4. **Strength:** ADX is **ABOVE** 20.
### 🟢 Exit Management
* **Take Profit (TP):** $3.0 \times ATR$ (Risk/Reward 1:2).
* **Stop Loss (SL):** $1.5 \times ATR$.
* **Dynamic Exit:** If the Vortex lines cross in the opposite direction (e.g., VIM > VIP during a Long), the strategy closes the position immediately to lock in profits or minimize loss.
---
Triple Confirmation with Alerts//@version=5
indicator("Triple Confirmation with Alerts", overlay=true)
// Confirmation 1: ADX Trend Strength
adxlen = input(14, "ADX Length")
dilen = input(14, "DI Length")
= ta.dmi(dilen, adxlen)
trendStrong = adx > 25
uptrend = diplus > diminus and trendStrong
downtrend = diminus > diplus and trendStrong
// Confirmation 2: Stochastic
k = ta.sma(ta.stoch(close, high, low, 14), 3)
d = ta.sma(k, 3)
stochBullish = k > d and k <= d and k < 80
stochBearish = k < d and k >= d and k > 20
// Confirmation 3: Bollinger Bands
bbLength = input(20, "BB Length")
bbMult = input(2.0, "BB Multiplier")
basis = ta.sma(close, bbLength)
dev = bbMult * ta.stdev(close, bbLength)
upper = basis + dev
lower = basis - dev
bbBullish = close > lower and close <= lower
bbBearish = close < upper and close >= upper
// Generate Signals
buySignal = uptrend and stochBullish and bbBullish
sellSignal = downtrend and stochBearish and bbBearish
// Plot
plotshape(buySignal, "Buy", shape.triangleup, location.belowbar, color.green, size=size.small)
plotshape(sellSignal, "Sell", shape.triangledown, location.abovebar, color.red, size=size.small)
// Alerts
alertcondition(buySignal, "Triple Confirmation Buy", "Buy signal generated")
alertcondition(sellSignal, "Triple Confirmation Sell", "Sell signal generated")






















