Enhanced Market Structure & Trading SignalsEnhanced Market Structure & Trading Signals
A Smart Support/Resistance Indicator with Buy/Sell Alerts
This indicator identifies key support & resistance levels and generates high-probability buy/sell signals based on price action and candle structure. It helps traders spot potential reversals at critical levels, just like manual analysis but with algorithmic precision.
🔹 Key Features
✅ Clean Support/Resistance Lines – Draws horizontal levels like manual charting
✅ Smart Buy/Sell Signals – Detects reversals at key levels with confirmation
✅ Price Action Filter – Only triggers signals on strong bullish/bearish candles
✅ ATR-Based Proximity Check – Ensures signals occur near valid S/R zones
✅ Customizable Settings – Adjust sensitivity, confirmation bars, and visibility
🔹 How It Works
Support/Resistance Detection – Uses pivot highs/lows to mark key levels
Bullish Signals (Green ▲) – Triggers near support after a strong bullish candle + confirmation
Bearish Signals (Red ▼) – Triggers near resistance after a strong bearish candle + confirmation
🔹 Recommended Settings
Timeframe: 1H or higher (works best on swing trading)
Confirmation Bars: 2-3 (for stricter signals)
Left/Right Bars: 10-20 (adjust based on market volatility)
🔹 How to Trade with This Indicator
Go Long when a green ▲ appears near support
Go Short when a red ▼ appears near resistance
Combine with: Trend analysis, volume confirmation, or RSI for higher accuracy
📌 Note: Works best in trending or ranging markets. Avoid using in choppy/low-liquidity conditions.
Indicators and strategies
Custom WT Price Signals with MomentumThis script provides modified signals fine-tuned for QQQ on the daily timeframe. It combines WaveTrend crossovers with momentum confirmation and bull/bear trend filtering.
• Yellow: Potential buy signal
• Orange: Accumulation/load signal (optional)
• Purple: Sell signal
Note:
• Some buy signals can be misleading. It’s recommended to use them alongside other indicators.
• Sell signals tend to be more reliable. However, if the fast and slow WaveTrend lines are nearly parallel, false signals may occur.
• While this script is tuned for QQQ daily data, I did not use automated parameter search to avoid overfitting. Recent backtests have shown promising results.
Enjoy and use responsibly!
Logarithmischer Trendkanal (sichtbar, in Preisskala + Stilwahl)Logarithmischer frei einstellbarer Trendkanal mit Wachstum p.a. über Trendphase
Why EMA Isn't What You Think It IsMany new traders adopt the Exponential Moving Average (EMA) believing it's simply a "better Simple Moving Average (SMA)". This common misconception leads to fundamental misunderstandings about how EMA works and when to use it.
EMA and SMA differ at their core. SMA use a window of finite number of data points, giving equal weight to each data point in the calculation period. This makes SMA a Finite Impulse Response (FIR) filter in signal processing terms. Remember that FIR means that "all that we need is the 'period' number of data points" to calculate the filter value. Anything beyond the given period is not relevant to FIR filters – much like how a security camera with 14-day storage automatically overwrites older footage, making last month's activity completely invisible regardless of how important it might have been.
EMA, however, is an Infinite Impulse Response (IIR) filter. It uses ALL historical data, with each past price having a diminishing - but never zero - influence on the calculated value. This creates an EMA response that extends infinitely into the past—not just for the last N periods. IIR filters cannot be precise if we give them only a 'period' number of data to work on - they will be off-target significantly due to lack of context, like trying to understand Game of Thrones by watching only the final season and wondering why everyone's so upset about that dragon lady going full pyromaniac.
If we only consider a number of data points equal to the EMA's period, we are capturing no more than 86.5% of the total weight of the EMA calculation. Relying on he period window alone (the warm-up period) will provide only 1 - (1 / e^2) weights, which is approximately 1−0.1353 = 0.8647 = 86.5%. That's like claiming you've read a book when you've skipped the first few chapters – technically, you got most of it, but you probably miss some crucial early context.
▶️ What is period in EMA used for?
What does a period parameter really mean for EMA? When we select a 15-period EMA, we're not selecting a window of 15 data points as with an SMA. Instead, we are using that number to calculate a decay factor (α) that determines how quickly older data loses influence in EMA result. Every trader knows EMA calculation: α = 1 / (1+period) – or at least every trader claims to know this while secretly checking the formula when they need it.
Thinking in terms of "period" seriously restricts EMA. The α parameter can be - should be! - any value between 0.0 and 1.0, offering infinite tuning possibilities of the indicator. When we limit ourselves to whole-number periods that we use in FIR indicators, we can only access a small subset of possible IIR calculations – it's like having access to the entire RGB color spectrum with 16.7 million possible colors but stubbornly sticking to the 8 basic crayons in a child's first art set because the coloring book only mentioned those by name.
For example:
Period 10 → alpha = 0.1818
Period 11 → alpha = 0.1667
What about wanting an alpha of 0.17, which might yield superior returns in your strategy that uses EMA? No whole-number period can provide this! Direct α parameterization offers more precision, much like how an analog tuner lets you find the perfect radio frequency while digital presets force you to choose only from predetermined stations, potentially missing the clearest signal sitting right between channels.
Sidenote: the choice of α = 1 / (1+period) is just a convention from 1970s, probably started by J. Welles Wilder, who popularized the use of the 14-day EMA. It was designed to create an approximate equivalence between EMA and SMA over the same number of periods, even thought SMA needs a period window (as it is FIR filter) and EMA doesn't. In reality, the decay factor α in EMA should be allowed any valye between 0.0 and 1.0, not just some discrete values derived from an integer-based period! Algorithmic systems should find the best α decay for EMA directly, allowing the system to fine-tune at will and not through conversion of integer period to float α decay – though this might put a few traditionalist traders into early retirement. Well, to prevent that, most traditionalist implementations of EMA only use period and no alpha at all. Heaven forbid we disturb people who print their charts on paper, draw trendlines with rulers, and insist the market "feels different" since computers do algotrading!
▶️ Calculating EMAs Efficiently
The standard textbook formula for EMA is:
EMA = CurrentPrice × alpha + PreviousEMA × (1 - alpha)
But did you know that a more efficient version exists, once you apply a tiny bit of high school algebra:
EMA = alpha × (CurrentPrice - PreviousEMA) + PreviousEMA
The first one requires three operations: 2 multiplications + 1 addition. The second one also requires three ops: 1 multiplication + 1 addition + 1 subtraction.
That's pathetic, you say? Not worth implementing? In most computational models, multiplications cost much more than additions/subtractions – much like how ordering dessert costs more than asking for a water refill at restaurants.
Relative CPU cost of float operations :
Addition/Subtraction: ~1 cycle
Multiplication: ~5 cycles (depending on precision and architecture)
Now you see the difference? 2 * 5 + 1 = 11 against 5 + 1 + 1 = 7. That is ≈ 36.36% efficiency gain just by swapping formulas around! And making your high school math teacher proud enough to finally put your test on the refrigerator.
▶️ The Warmup Problem: how to start the EMA sequence right
How do we calculate the first EMA value when there's no previous EMA available? Let's see some possible options used throughout the history:
Start with zero : EMA(0) = 0. This creates stupidly large distortion until enough bars pass for the horrible effect to diminish – like starting a trading account with zero balance but backdating a year of missed trades, then watching your balance struggle to climb out of a phantom debt for months.
Start with first price : EMA(0) = first price. This is better than starting with zero, but still causes initial distortion that will be extra-bad if the first price is an outlier – like forming your entire opinion of a stock based solely on its IPO day price, then wondering why your model is tanking for weeks afterward.
Use SMA for warmup : This is the tradition from the pencil-and-paper era of technical analysis – when calculators were luxury items and "algorithmic trading" meant your broker had neat handwriting. We first calculate an SMA over the initial period, then kickstart the EMA with this average value. It's widely used due to tradition, not merit, creating a mathematical Frankenstein that uses an FIR filter (SMA) during the initial period before abruptly switching to an IIR filter (EMA). This methodology is so aesthetically offensive (abrupt kink on the transition from SMA to EMA) that charting platforms hide these early values entirely, pretending EMA simply doesn't exist until the warmup period passes – the technical analysis equivalent of sweeping dust under the rug.
Use WMA for warmup : This one was never popular because it is harder to calculate with a pencil - compared to using simple SMA for warmup. Weighted Moving Average provides a much better approximation of a starting value as its linear descending profile is much closer to the EMA's decay profile.
These methods all share one problem: they produce inaccurate initial values that traders often hide or discard, much like how hedge funds conveniently report awesome performance "since strategy inception" only after their disastrous first quarter has been surgically removed from the track record.
▶️ A Better Way to start EMA: Decaying compensation
Think of it this way: An ideal EMA uses an infinite history of prices, but we only have data starting from a specific point. This creates a problem - our EMA starts with an incorrect assumption that all previous prices were all zero, all close, or all average – like trying to write someone's biography but only having information about their life since last Tuesday.
But there is a better way. It requires more than high school math comprehension and is more computationally intensive, but is mathematically correct and numerically stable. This approach involves compensating calculated EMA values for the "phantom data" that would have existed before our first price point.
Here's how phantom data compensation works:
We start our normal EMA calculation:
EMA_today = EMA_yesterday + α × (Price_today - EMA_yesterday)
But we add a correction factor that adjusts for the missing history:
Correction = 1 at the start
Correction = Correction × (1-α) after each calculation
We then apply this correction:
True_EMA = Raw_EMA / (1-Correction)
This correction factor starts at 1 (full compensation effect) and gets exponentially smaller with each new price bar. After enough data points, the correction becomes so small (i.e., below 0.0000000001) that we can stop applying it as it is no longer relevant.
Let's see how this works in practice:
For the first price bar:
Raw_EMA = 0
Correction = 1
True_EMA = Price (since 0 ÷ (1-1) is undefined, we use the first price)
For the second price bar:
Raw_EMA = α × (Price_2 - 0) + 0 = α × Price_2
Correction = 1 × (1-α) = (1-α)
True_EMA = α × Price_2 ÷ (1-(1-α)) = Price_2
For the third price bar:
Raw_EMA updates using the standard formula
Correction = (1-α) × (1-α) = (1-α)²
True_EMA = Raw_EMA ÷ (1-(1-α)²)
With each new price, the correction factor shrinks exponentially. After about -log₁₀(1e-10)/log₁₀(1-α) bars, the correction becomes negligible, and our EMA calculation matches what we would get if we had infinite historical data.
This approach provides accurate EMA values from the very first calculation. There's no need to use SMA for warmup or discard early values before output converges - EMA is mathematically correct from first value, ready to party without the awkward warmup phase.
Here is Pine Script 6 implementation of EMA that can take alpha parameter directly (or period if desired), returns valid values from the start, is resilient to dirty input values, uses decaying compensator instead of SMA, and uses the least amount of computational cycles possible.
// Enhanced EMA function with proper initialization and efficient calculation
ema(series float source, simple int period=0, simple float alpha=0)=>
// Input validation - one of alpha or period must be provided
if alpha<=0 and period<=0
runtime.error("Alpha or period must be provided")
// Calculate alpha from period if alpha not directly specified
float a = alpha > 0 ? alpha : 2.0 / math.max(period, 1)
// Initialize variables for EMA calculation
var float ema = na // Stores raw EMA value
var float result = na // Stores final corrected EMA
var float e = 1.0 // Decay compensation factor
var bool warmup = true // Flag for warmup phase
if not na(source)
if na(ema)
// First value case - initialize EMA to zero
// (we'll correct this immediately with the compensation)
ema := 0
result := source
else
// Standard EMA calculation (optimized formula)
ema := a * (source - ema) + ema
if warmup
// During warmup phase, apply decay compensation
e *= (1-a) // Update decay factor
float c = 1.0 / (1.0 - e) // Calculate correction multiplier
result := c * ema // Apply correction
// Stop warmup phase when correction becomes negligible
if e <= 1e-10
warmup := false
else
// After warmup, EMA operates without correction
result := ema
result // Return the properly compensated EMA value
▶️ CONCLUSION
EMA isn't just a "better SMA"—it is a fundamentally different tool, like how a submarine differs from a sailboat – both float, but the similarities end there. EMA responds to inputs differently, weighs historical data differently, and requires different initialization techniques.
By understanding these differences, traders can make more informed decisions about when and how to use EMA in trading strategies. And as EMA is embedded in so many other complex and compound indicators and strategies, if system uses tainted and inferior EMA calculatiomn, it is doing a disservice to all derivative indicators too – like building a skyscraper on a foundation of Jell-O.
The next time you add an EMA to your chart, remember: you're not just looking at a "faster moving average." You're using an INFINITE IMPULSE RESPONSE filter that carries the echo of all previous price actions, properly weighted to help make better trading decisions.
EMA done right might significantly improve the quality of all signals, strategies, and trades that rely on EMA somewhere deep in its algorithmic bowels – proving once again that math skills are indeed useful after high school, no matter what your guidance counselor told you.
Buy/Sell Signals (Dynamic v2)//@version=5
indicator(title="Buy/Sell Signals (Dynamic v2)", shorttitle="Buy/Sell Dyn v2", overlay=true)
// Input for moving average lengths
lengthMA = input.int(20, title="Moving Average Length")
lengthEMA = input.int(5, title="Exponential Moving Average Length")
// Calculate Moving Averages
ma = ta.sma(close, lengthMA)
ema = ta.ema(close, lengthEMA)
// --- Buy Signal Conditions ---
buyMarketBelowMA = close < ma
buyMarketBelowEMA = close < ema
buyEMABelowMA = ema < ma
buyMarketCondition = buyMarketBelowMA and buyMarketBelowEMA and buyEMABelowMA
buyFollowingHighNotTouchedEMA = high < ema
buyCurrentCrossCloseAboveFollowingHigh = high > high and close > high
buySignalCondition = buyMarketCondition and buyFollowingHighNotTouchedEMA and buyCurrentCrossCloseAboveFollowingHigh
// Plot Buy Signal
plotshape(buySignalCondition, title="Buy Signal", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
// --- Sell Signal Conditions (Occurring After a Buy Signal Sequence) ---
sellMarketAboveMA = close > ma
sellMarketAboveEMA = close > ema
sellEMAAboveMA = ema > ma
sellMarketConditionSell = sellMarketAboveMA and sellMarketAboveEMA and sellEMAAboveMA
var bool buySignalOccurredRecently = false
if buySignalCondition
buySignalOccurredRecently := true
sellSignalCondition = buySignalOccurredRecently and sellMarketConditionSell and close < close
// Plot Sell Signal
plotshape(sellSignalCondition, title="Sell Signal", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Reset the buySignalOccurredRecently only after a sell signal
if sellSignalCondition
buySignalOccurredRecently := false
// Plot the Moving Averages for visual reference
plot(ma, color=color.blue, title="MA")
plot(ema, color=color.red, title="EMA")
ITG Scalper + Supertrend + VWAP (Minimal v6)IT USES TRIPE EMA ALONG WITH VWAP AND SUPERTREND AND ALSO //@version=5
indicator(title="ITG Scalper + Supertrend + VWAP (Minimal v6)", shorttitle="ITG_SUPER_VWAP_MIN", overlay=true)
// === Inputs ===
temaLen = input.int(14, title="TEMA Period")
showTEMA = input.bool(true, title="Show TEMA Line?")
showSignals = input.bool(true, title="Show Buy/Sell Signals?")
macdFast = input.int(12, title="MACD Fast")
macdSlow = input.int(26, title="MACD Slow")
macdSignal = input.int(9, title="MACD Signal")
factor = input.float(3.0, title="Supertrend Factor")
atrlen = input.int(10, title="Supertrend ATR")
// === TEMA ===
ema1 = ta.ema(close, temaLen)
ema2 = ta.ema(ema1, temaLen)
ema3 = ta.ema(ema2, temaLen)
tema = 3 * (ema1 - ema2) + ema3
trendUp = tema >= tema
trendDown = tema < tema
// === MACD ===
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdBuy = macdLine >= signalLine
macdSell = macdLine < signalLine
// === Supertrend ===
atr_ = ta.atr(atrlen)
src = (high + low) / 2
upperBasic = src + factor * atr_
lowerBasic = src - factor * atr_
var float upperBand = na
var float lowerBand = na
var int superDir = na
upperBand := na(upperBand ) ? upperBasic : close > upperBand ? math.max(upperBasic, upperBand ) : upperBasic
lowerBand := na(lowerBand ) ? lowerBasic : close < lowerBand ? math.min(lowerBasic, lowerBand ) : lowerBasic
superDir := na(superDir ) ? 1 : close > lowerBand ? 1 : close < upperBand ? -1 : superDir
superBull = superDir == 1
superBear = superDir == -1
// === VWAP ===
vwapValue = ta.vwap
// === Combo Logic (no duplicate signals) ===
var int lastSignal = na // 1 for Buy, -1 for Sell
buyCond = trendUp and macdBuy and superBull and close > vwapValue
sellCond = trendDown and macdSell and superBear and close < vwapValue
newBuy = buyCond and (na(lastSignal) or lastSignal == -1)
newSell = sellCond and (na(lastSignal) or lastSignal == 1)
if newBuy
lastSignal := 1
if newSell
lastSignal := -1
// === Plotting ===
plot(showTEMA ? tema : na, color=trendUp ? color.lime : color.red, linewidth=2)
plot(vwapValue, color=color.orange, linewidth=1)
bgcolor(superBull ? color.new(color.green,90) : superBear ? color.new(color.red,90) : na)
plotshape(showSignals and newBuy, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(showSignals and newSell, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
Indicador Opciones Mejorado con S/R y Alertasnueva version de mi primer script, ahora recibe indicaciones mas precisas
TPMCustom Script for the TPM Strategy
This indicator graphically and in real time displays the parameters of a Bear Put Spread strategy with active management and additional naked options. It is designed to provide a complete and immediate overview directly on the underlying chart.
🔹 Key Features
• Customizable entry point: can be specified by date and time, displayed with a vertical blue line and an “ENTRY” label.
• Automatic calculation of the management level: shown as an orange horizontal line at -13% from the entry price. When the price drops below this threshold:
• an alert is triggered
• an active management label appears
• Visualization of bought and sold options:
• Strike prices of Buy Put and Sell Put are drawn as horizontal colored lines (red and green)
• Strike of an extra sold Put (-23%) shown in purple
• “Today” line (dashed red or blue) with a day counter from the entry date
• Active period box: highlighted area between the entry day and today, visible across the chart
• Dynamic theoretical expiration (based on VIX):
• 60 / 30 / 15 days depending on the current VIX value
• Yellow vertical line with estimated date and descriptive label, always visible even if in the future
• Golden Scenario (optional):
• Analysis of % variation over a configurable number of days
• Icons 🟤 ⚪ 🟡 drawn on the chart to identify significant drops (-2% / -3% / -5%)
• Visual dashboard (optional):
• Fixed table at the bottom right with color-coded sections for:
• Bull Put: strike and expiration (12 months)
• Management Level
• Extra Sell Put: strike and expiration (9 months)
• Values rounded down and well-formatted for readability
⸻
🔧 Customization
Every parameter of the strategy (strike, entry, levels, period) is customizable via input. The script’s behavior adapts in real time to the chart context and VIX conditions.
Chattes-SwingCount Chattes-SwingCount
// This indicator detects swings using a custom ZigZag algorithm and calculates:
// - Average pip movement per swing
// - Standard deviation of pip movement
// - Average number of candles per swing
// - Standard deviation of candle count
//
// The stats are displayed in a compact box at the top-right corner of the chart.
//
// An alert is triggered when a swing's pip size exceeds 1.5× the standard deviation,
// helping identify unusual volatility or significant market moves.
//
// Inputs allow customization of ZigZag detection parameters and swing sample size.
MACDtechnical analysis. It consists of three components:
MACD Line: Calculated by subtracting the 26-period EMA from the 12-period EMA.
Signal Line: A 9-period EMA of the MACD Line (acts as a trigger).
Histogram: Visualizes the difference between the MACD and Signal lines.
Key interpretations:
Bullish Signal: When the MACD line crosses above the Signal line.
Bearish Signal: When the MACD line crosses below the Signal line.
Divergence: Price and MACD moving opposite directions may indicate trend reversal.
Developed by Gerald Appel in the 1970s, it combines trend and momentum analysis. Traders use it for entries/exits and confirming trends.
Volumen + Agotamiento + Tendencia Vol ↓This script detects potential exhaustion zones based on volume behavior, ideal for intraday trading on the 5-minute timeframe.
🔍 What it highlights:
- **Exhaustion signals** (bullish or bearish) when:
- Current volume is **below the 30-period moving average**.
- The previous candle had higher volume.
- Price attempts to continue in one direction but shows weakness.
📉 It also displays:
- A subtle "Vol ↓" label when there is a **volume downtrend**, defined as at least 60% of the last 5 candles showing decreasing volume.
🕒 Time filter:
- Signals only appear between **9:00 AM and 2:00 PM (New York time)**, aligning with the most liquid trading hours.
✅ Recommended usage:
- Best suited for **5-minute charts** and **intraday setups**.
- Works great as a confirmation layer for support/resistance levels, VWAP zones, or trend exhaustion.
- Can be combined with order flow tools like Bookmap or delta-based analysis for precise execution.
⚠️ Note:
This is not a delta or absorption-based indicator. It simplifies visual exhaustion detection based on volume structure. Use it as a **contextual alert**, not a standalone signal generator.
📎 Script by: Daniel Gonzalez
🔁 100% open-source and customizable
IFVG WITH SignalsTitle: Inverted Fair Value Gaps with Alerts – Smart Liquidity Zones
Description:
This script identifies Inverted Fair Value Gaps (IFVGs) – a concept derived from liquidity theory and price inefficiencies, often associated with smart money trading strategies. Unlike traditional FVGs, inverted gaps point to potential liquidity traps or reversal zones, where price may revisit to rebalance or hunt stops.
Key Features:
Automatic detection of Inverted Fair Value Gaps
Visual zones plotted on chart for easy reference
Customizable alerts when a new IFVG is created or price re-enters one
Works on any timeframe or asset
PDHL + Current Day HL Tracker V1.1PDHL + Current Day HL Tracker — Release Notes
Version: 1.1
Date: 2025-05-17
Summary
This update improves the timing accuracy of the current day high/low (CDH/CDL) lines drawing logic by syncing it precisely to the chart’s exchange timezone, including automatic handling of daylight saving time (DST). This ensures the 30-minute post-open trigger fires exactly as expected in all time zones.
Key Changes
30-Minute Trigger Accuracy:
The current day high/low lines are now drawn exactly 30 minutes after the market open (e.g., 10:00 AM Eastern for US markets), regardless of the user’s location or DST.
Behavior Preservation:
Original behavior of prior day high/low (PDH/PDL) lines and their breach logic remain unchanged. Current day lines still appear either on breach or automatically after 30 minutes.
Impact
More reliable visualization of intraday support/resistance levels based on prior and current day price extremes.
Avoids late or early drawing of current day lines due to timezone mismatches.
Improves usability for traders operating in different time zones or during DST transitions.
Notes
No other functional or stylistic changes have been made.
The indicator remains lightweight and easy to read on charts.
Works on any symbol and timeframe supported by TradingView.
Indicateur de tradingKDJ Alert
Strategy Advice
1- Cautious
Frame the alert candle
Buy = yellow
Sell = blue
Follow the market trend and go
Set a 20-day moving average.
Be careful, the alert sometimes occurs quite high above the moving average
Wait for it to return to the moving average before opening.
2- Risky
Follow the alert candle immediately
Set a fairly large SL, however, if you want to implement this risky method
Wave Trend + Fearzone + Signal Combo with ReversalIn this example, you need to replace variables like wt1, wt2, fearZoneTop, fearZoneBottom with the actual WaveTrend and FearZone calculations.
You can place and use your full WaveTrend and FearZone code in the code above.
If you want, I can add this logic to the WaveTrend + FearZone code you gave me, complete and working, and give it to you. If you want, I can do that right away.
ROC Spike Detector by Jaani//@version=5
indicator("ROC Spike Detector by Jaani", overlay=true)
// === User Inputs ===
rocLength = input.int(9, minval=1, title="ROC Length")
spikeThreshold = input.float(2.0, minval=0.1, title="Spike Threshold (%)")
// === ROC Calculation ===
roc = 100 * (close - close ) / close
// === Spike Conditions ===
bullishSpike = roc > spikeThreshold
bearishSpike = roc < -spikeThreshold
// === Plotting Signals ===
plotshape(bullishSpike, title="Bullish ROC Spike", location=location.belowbar,
color=color.green, style=shape.triangleup, size=size.small, text="Buy")
plotshape(bearishSpike, title="Bearish ROC Spike", location=location.abovebar,
color=color.red, style=shape.triangledown, size=size.small, text="Sell")
// === Alerts ===
alertcondition(bullishSpike, title="Bullish ROC Alert", message="🚀 ROC Spike UP Detected!")
alertcondition(bearishSpike, title="Bearish ROC Alert", message="🔻 ROC Spike DOWN Detected!")
FibSync - DynamicFibSupportWhat is this indicator?
FibSync – DynamicFibSupport overlays your chart with both static and dynamic Fibonacci retracement levels, making it easy to spot potential areas of support and resistance.
Static Fibs: Calculated from the highest and lowest price over a user-defined lookback period.
Dynamic Fibs: Calculated from the most recent swing high and swing low, automatically adapting as new swings form.
How to use
Add the indicator to your chart.
Configure the settings:
Static Fib Period: Sets the lookback window for static fib levels.
Show Dynamic Fibonacci Levels: Toggle dynamic fibs on/off.
Dynamic Fib Swing Search Window: How far back to search for valid swing highs/lows.
Swing Strength (bars left/right): How many bars define a swing high/low (higher = stronger swing).
Interpret the levels:
Solid lines are static fibs.
Transparent lines are dynamic fibs (if enabled).
Colors match standard fib conventions (yellow = 0.236, red = 0.382, blue = 0.618, green = 0.786, gray = 0.5).
Tips
Static and dynamic fibs can overlap-this often highlights especially important support/resistance zones.
Adjust the swing strength for your trading style: lower values for short-term, higher for long-term swings.
Hide/show individual lines using the indicator’s style settings in TradingView.
Trading Ideas (for higher timeframes and static fibs)
Close above the blue line (0.618 static fib):
This can be interpreted as a potential long (buy) signal, suggesting the market is breaking above a key resistance level.
Close below the red line (0.382 static fib):
This can be interpreted as a potential short (sell) signal, indicating the market is breaking below a key support level.
Note: These signals are most meaningful on higher timeframes and when using the static fib lines. Always confirm with your own strategy and risk management.
Enhance Short Squeeze Detector gilClearer Short Squeeze Indicator Contains 3 Conditions RSI>50 Volume Above Average and SQZMOM Indicator
Focuses the Days and Doesn't Spread Them Out
My script//@version=6
strategy("Ultimate Combined Buy/Sell Strategy - 4$ Profit", overlay=true)
// تنظیمات ورودی
maFastLength = input.int(5, title="Fast MA Length", minval=1)
maSlowLength = input.int(13, title="Slow MA Length", minval=1)
rsiLength = input.int(14, title="RSI Length", minval=1)
bbLength = input.int(20, title="Bollinger Length", minval=1)
bbMult = input.float(2.0, title="Bollinger Multiplier", minval=0.1, step=0.1)
stochK = input.int(14, title="Stochastic K", minval=1)
stochD = input.int(3, title="Stochastic D", minval=1)
stochSmooth = input.int(3, title="Stochastic Smooth", minval=1)
atrThreshold = input.float(0.10, title="ATR Threshold (Pips)", minval=0.01)
volumeLookback = input.int(20, title="Volume Lookback", minval=1)
profitTargetPips = input.float(40, title="Profit Target (Pips)", minval=1)
stopLossPips = input.float(20, title="Stop Loss (Pips)", minval=1)
// محاسبه اندیکاتورها
maFast = ta.sma(close, maFastLength)
maSlow = ta.sma(close, maSlowLength)
rsi = ta.rsi(close, rsiLength)
= ta.macd(close, 5, 13, 1)
= ta.bb(close, bbLength, bbMult)
= ta.stoch(close, high, low, stochK, stochD, stochSmooth)
atr = ta.atr(14)
avgVolume = ta.sma(volume, volumeLookback)
// سیستم امتیازدهی
buyScore = 0.0
sellScore = 0.0
// امتیاز MA
if maFast > maSlow
buyScore := buyScore + 1.5
if maFast < maSlow
sellScore := sellScore + 1.5
// امتیاز RSI
if rsi < 70
buyScore := buyScore + 1.0
if rsi > 30
sellScore := sellScore + 1.0
if rsi < 30
buyScore := buyScore + 1.5 // اشباع فروش
if rsi > 70
sellScore := sellScore + 1.5 // اشباع خرید
// امتیاز MACD
if macdLine > signalLine
buyScore := buyScore + 1.0
if macdLine < signalLine
sellScore := sellScore + 1.0
// امتیاز Bollinger Bands
if close > bbUpper
buyScore := buyScore + 1.0
if close < bbLower
sellScore := sellScore + 1.0
// امتیاز Stochastic
if stochKVal > stochDVal and stochKVal < 80
buyScore := buyScore + 1.0
if stochKVal < stochDVal and stochKVal > 20
sellScore := sellScore + 1.0
// امتیاز ATR
if atr > atrThreshold
buyScore := buyScore + 1.0
sellScore := sellScore + 1.0
// امتیاز Volume
if volume > avgVolume
buyScore := buyScore + 1.0
sellScore := sellScore + 1.0
// تصمیمگیری
buyCondition = buyScore >= 4.5 and buyScore > sellScore
sellCondition = sellScore >= 4.5 and sellScore > buyScore
// ورود به ترید
if buyCondition
strategy.entry("Buy", strategy.long)
if sellCondition
strategy.entry("Sell", strategy.short)
// خروج با هدف سود و حد ضرر
strategy.exit("Exit Buy", "Buy", profit=profitTargetPips * 10, loss=stopLossPips * 10) // هر پیپ = 0.1 دلار با 0.1 لات
strategy.exit("Exit Sell", "Sell", profit=profitTargetPips * 10, loss=stopLossPips * 10)
// رسم سیگنالها (برای نمایش بصری)
plotshape(buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// رسم MA
plot(maFast, "Fast MA", color=color.green, linewidth=1)
plot(maSlow, "Slow MA", color=color.red, linewidth=1)
ST + Multi-EMASuperTrend with multiple EMAs.
The indicator includes Supertrend and 10 EMAs. Hope it helps those who are looking for multiple EMAs in one indicator.
First 15-Min Candle High/Low### 📘 Description of the Script
This Pine Script indicator draws **horizontal lines** at the **high and low of the first 15-minute candle after the market opens at 9:30 AM (New York time)**. It is designed for use on **intraday charts** (e.g., 1m, 5m) for U.S. stock markets.
---
### 🔍 What the Script Does
* **Fetches 15-minute candle data** using `request.security()` from the `"15"` timeframe.
* **Detects the first 15-minute candle starting at 9:30 AM** (i.e., the 9:30–9:45 candle).
* **Saves the high and low** of that first 15-minute candle.
* **Plots horizontal lines** at those high/low levels for the rest of the trading day.
* **Resets at the start of each new day**, so the levels are updated fresh each morning.
---
### 🕒 When It Updates
* At exactly 9:45 AM (when the first 15-minute candle closes), it captures the high/low.
* Lines remain plotted for the rest of the day until the script resets on a new day.
---
### 🧠 Why This Is Useful
Traders often watch the **initial 15-minute range** as a key zone for:
* Breakouts or breakdowns
* Trend direction confirmation
* Entry or exit signals
This script helps visualize that range clearly and automatically.
---
Let me know if you want to:
* Extend the line beyond today
* Add alerts for breakouts
* Support different market open times (e.g., futures or forex markets)
MACD AaronVersionAutomatically changes color to help you better assess trend strength, suitable for use with breakout or range trading strategies.
Fast Line (MACD):
🔸 Higher than yesterday → Yellow
🔹 Lower than yesterday → Gray
Slow Line (Signal Line):
🟢 After a Golden Cross occurs → stays Green until a Death Cross
🔴 After a Death Cross occurs → stays Red until the next Golden Cross