KAMA Trend Flip - SightLing LabsBuckle up, traders—this open-source KAMA Trend Flip indicator is your ticket to sniping trend reversals with a Kaufman Adaptive Moving Average (KAMA) that’s sharper than a Wall Street shark’s tooth. No voodoo, no fluff—just raw, volatility-adaptive math that dances with the market’s rhythm. It zips through trending rockets and chills in choppy waters, slashing false signals like a samurai. Not laggy like the others - this thing is the real deal!
Core Mechanics:
• Efficiency Ratio (ER): Reads the market’s pulse (0-1). High ER = turbo-charged MA, low ER = smooth operator.
• Adaptive Smoothing: Mixes fast (default power 2) and slow (default 30) constants to match market mood swings.
• Trend Signals: KAMA climbs = blue uptrend (bulls run wild). KAMA dips = yellow downtrend (bears take over). Flat = gray snooze-fest.
• Alerts: Instant pings on flips—“Trend Flip Up” for long plays, “Down” for shorts. Plug into bots for set-and-forget domination.
Why It Crushes:
• Smokes static MAs in volatile arenas (crypto, stocks, you name it). Backtests show 20-30% fewer fakeouts than SMA50.
• Visual Pop: Overlays price with bold blue/yellow signals. Slap it on BTC 1D to see trends light up like Times Square.
• Tweakable: Dial ER length (default 50) to your timeframe. Short for scalps, long for swing trades.
Example Settings in Action:
• 10s Chart (Hyper-Scalping): Set Source: Close, ER Length: 100, Fast Power: 1, Slow Power: 6. Catches micro-trends in crypto like a heat-seeking missile. Blue/yellow flips scream entry/exit on fast moves.
• 2m Chart (Quick Trades): Set Source: Close, ER Length: 14, Fast Power: 1, Slow Power: 6. Perfect for rapid trend shifts in stocks or forex. Signals align with momentum bursts—check historical flips for proof.
Deployment:
• Drop it on any chart. Backtest settings to match your asset’s volatility—tweak until it sings.
• Pair with RSI or volume spikes for killer confirmation. Pro move: Enter on flip + volume pop, exit on reverse.
• Strategy-Ready: Slap long/short logic on alerts to build a lean, mean trading machine.
Open source from SightLing Labs—grab it, hack it, profit from it. Share your tweaks in the comments and let’s outsmart the market together. Trade hard, win big!
Trend Analizi
Trendlines Oscillator [LuxAlgo]The Trendlines Oscillator helps traders identify trends and momentum based on the normalized distances between the current price and the most recently detected bullish and bearish trend lines.
The indicator features bullish and bearish momentum, a signal line with crossings, and multiple smoothing options.
🔶 USAGE
The indicator displays three lines: two for momentum and one for the signal. When one of the momentum lines (bullish or bearish) crosses the signal line, the tool displays a dot to indicate which momentum is gaining strength.
As a general rule, when the green bullish momentum line is above the red bearish momentum line, it indicates buyer strength. This means that the actual prices are farther from the support trend lines than the resistance trend lines. The opposite is true for seller strength.
To calculate bullish momentum, the tool first identifies bullish trend lines acting as support below the price. Then, it measures the delta between the price and those trend lines and normalizes the reading into the displayed momentum values.
The same process is used for bearish momentum, but with bearish trendlines acting as resistance above the price.
🔹 Length & Memory
Modifying the Length and Memory values will cause the tool to display different momentum values.
Traders can adjust the length to detect larger trendlines and adjust the memory to indicate how many trendlines the tool should consider.
As the chart above shows, smaller values make the tool more responsive, while larger values are useful for detecting larger trends.
🔹 Smoothing
By default, the data is not smoothed, and the signal uses a triangular moving average with a length of 10. Traders can smooth both the data and the signal line.
Traders can choose from up to ten different methods, or none. Some examples are shown on the chart above.
🔶 DETAILS
The steps for the calculations are as follows:
1. Gather the pivots, highs, and lows.
ph = fixnan(ta.pivothigh(lengthInput, lengthInput))
pl = fixnan(ta.pivotlow(lengthInput, lengthInput))
2. Calculate the slope and y-intercept for each trendline between contiguous lower highs (resistance) or higher lows (support).
if ph < ph
slope = (ph - ph )/(n-lengthInput - phx1)
res.unshift(l.new(ph - slope * phx1, slope))
if pl > pl
slope = (pl - pl )/(n-lengthInput - plx1)
sup.unshift(l.new(pl - slope * plx1, slope))
3. Calculate the value of each trendline on the current bar, then calculate the difference with the current price (delta). To calculate the relative sum of deltas, only consider trendlines below the price for support or above the price for resistance.
method get_point(l id, x)=>
id.slope * x + id.intercept
for element in sup
point = element.get_point(n)
if sourceInput > point
sup_sum += sourceInput - point
sup_den += math.abs(sourceInput - point)
for element in res
point = element.get_point(n)
if sourceInput < point
res_sum += point - sourceInput
res_den += math.abs(point - sourceInput)
4. Normalize the value from 0 to 100 by taking the sum of the relative values of the deltas divided by the sum of the absolute values of the deltas.
float supportLine = sup_sum / sup_den * 100
float resistanceLine = res_sum / res_den * 100
5. Smooth both values, then calculate the signal line as the difference between them.
float smoothSupport = smooth(supportLine,dataSmoothingInput,dataSmoothingLengthInput)
float smoothResistance = smooth(resistanceLine,dataSmoothingInput,dataSmoothingLengthInput)
float signal = math.abs(smoothSupport - smoothResistance)
float signalLine = smooth(signal,smoothingInput,smoothingLengthInput)
6. Calculate the crossing signals against the signal line, using only the first signal from each series of bullish or bearish crossings.
bullSignal = smoothSupport > signalLine and smoothSupport < signalLine
bearSignal = smoothResistance > signalLine and smoothResistance < signalLine
lastSignal := bullSignal and lastSignal == BEAR ? BULL : bearSignal and lastSignal == BULL ? BEAR : lastSignal
firstBull = ta.change(lastSignal) > 0
firstBear = ta.change(lastSignal) < 0
🔶 SETTINGS
Length: The size of the market structure used for trendline detection.
Memory: The number of trendlines used in calculations.
Source: The source for the calculations is closing prices by default.
🔹 Smoothing
Data Smoothing: Choose the smoothing method and length
Signal Smoothing: Choose the smoothing method and length
Tide Tracker ZonesTide Tracker Zones – Advanced Trend & Pullback Visualizer
Overview
Tide Tracker Zones is a sophisticated trading tool designed for traders who require clarity, precision, and actionable insights in real time. The indicator converts price action into dynamic trend zones, allowing users to instantly recognize market direction, potential reversals, and low-risk entry opportunities. By visualizing the market in this way, traders can focus on execution rather than deciphering complex charts.
Unlike static indicators, Tide Tracker Zones adapts to market volatility, providing a clear picture of bullish and bearish pressure across multiple timeframes. Its visual design, including color-coded trend zones, a prominent guide line, and carefully placed signals, ensures that market behavior is easy to interpret, making it suitable for scalping, swing trading, and longer-term strategies alike.
How It Works
The indicator relies on dynamic upper and lower bands derived from recent price ranges and a configurable multiplier. These bands expand during volatile periods and contract when price action stabilizes, creating flexible zones that reflect the dominant market tide.
A guide line tracks the active band, serving as a continuous reference for trend direction. Unlike traditional moving averages, the guide line does not clutter the chart but instead provides a subtle, intuitive indication of whether the market is in a bullish or bearish phase. Background shading reinforces this trend visually, highlighting bullish zones in one color and bearish zones in another, so the prevailing market flow is immediately clear.
The system continuously evaluates price relative to the bands to determine trend direction and detect potential reversals. When price crosses a band and flips the trend, the guide line updates, and signals are generated, providing traders with actionable information without overwhelming the chart.
Signals and Pullbacks
Tide Tracker Zones offers visual cues that make entry points more obvious and less speculative. Trend reversal arrows are plotted when the market changes direction: BUY arrows indicate a shift from bearish to bullish, and SELL arrows indicate a shift from bullish to bearish.
The indicator also highlights first pullbacks within an active trend. These pullback dots mark low-risk opportunities to enter a trend in progress, filtered to ensure that only the most relevant signals are displayed. The system uses ATR-based spacing to place arrows and dots vertically on the chart, preventing visual clutter and ensuring readability even during periods of high volatility.
Color-coded zones enhance situational awareness. Bullish zones are displayed in a customizable orange, while bearish zones are shown in green. Transparency is dynamically adjusted to maintain chart clarity while still providing a clear indication of trend strength.
Strategy Integration
Tide Tracker Zones can be used effectively for both trend-following and pullback strategies. Traders may enter positions in the direction of the guide line and colored zone, using trend reversal arrows for confirmation. First pullback dots offer tactical entries with reduced risk, allowing traders to enter a trend after a brief retracement.
Stop-loss levels can be placed just beyond the opposing trend zone, while take-profit targets may be determined using the width of the bands to account for market volatility. The indicator adapts seamlessly across multiple timeframes. Higher timeframes provide context and filter noise, while lower timeframes allow traders to refine entry timing. This makes it a versatile tool for scalping, swing trading, or longer-term positions.
Advanced Techniques
For traders seeking greater precision, Tide Tracker Zones can be combined with volume or momentum indicators to validate signals. Observing the sequence of trend arrows and pullback dots allows users to develop a systematic approach to entries and exits. Monitoring the width and behavior of the bands over time can also provide insights into periods of expanding or contracting volatility, helping traders anticipate market shifts.
Adjustments to the spread length and multiplier allow the indicator to be tuned for different assets and market conditions. By understanding the interaction between the guide line, trend zones, and pullback signals, traders can create a robust framework for decision-making, reducing guesswork and improving consistency.
Why Use Tide Tracker Zones
Tide Tracker Zones provides instant clarity and actionable insight in any market. Its dynamic zones and guide line give a clear visual understanding of trend direction, while trend reversal arrows and pullback dots highlight potential entry points. Unlike traditional indicators, it adapts to volatility and changing conditions, making it reliable across multiple asset classes and timeframes.
By combining trend detection, pullback analysis, and intuitive visual guidance, Tide Tracker Zones equips traders with a complete framework for disciplined, confident trading, transforming complex price action into a visual map of opportunity.
Trend CandlesTrend Candles
Overview
The Trend Candles indicator is a simple yet effective tool designed to help traders visually identify the prevailing market trend. By combining candle coloring with a trend-based Exponential Moving Average (EMA), it enhances chart readability and makes trend-following strategies easier to apply.
Concepts
Exponential Moving Average (EMA): The EMA is a moving average that places more weight on recent price data. It reacts faster to price changes compared to a Simple Moving Average (SMA), making it well-suited for trend detection.
Trend Determination:
- If the EMA is rising (current EMA > previous EMA), the market is considered bullish.
- If the EMA is falling (current EMA < previous EMA), the market is considered bearish.
- If the EMA is flat (no significant change), no trend color is applied.
Candle Coloring:
- Green candles = Uptrend
- Purple candles = Downtrend
- Default candles = Sideways/Flat EMA
Features
- Trend Visualization: Candles automatically change color based on EMA slope, making it easy to spot bullish and bearish phases.
- Customizable EMA Length: The trader can set the EMA period (default is 50), allowing flexibility for short-term or long-term trend analysis.
- Overlay EMA Line: An orange EMA line is plotted on the chart for additional confirmation of the trend.
- Clean & Minimalist: Focuses on trend clarity without cluttering the chart with unnecessary signals.
How to Use
1. Apply the indicator to your chart.
2. Adjust the EMA Length as per your trading style (shorter = faster signals, longer = smoother trend).
3. Follow the candle color:
- Green = Favor long entries.
- Purple = Favor short entries.
- No color = Stay cautious, as trend is unclear.
4. Use with other confirmation tools (support/resistance, volume, or oscillators).
5. Users are encouraged to experiment with different EMA lengths. The default length is 50, but you can explore other values based on your needs. In particular, try Fibonacci numbers such as 13, 21, 34, 55, 89, 144, and 233 to observe how trends behave differently.
Disclaimer
The information provided by the Trend Candles indicator is for educational purposes only. It should not be considered financial advice. Trading involves substantial risk, and past performance is not necessarily indicative of future results. Always do your own research and use risk management practices.
SmartPlusSmartPlus
Overview
The SmartPlus indicator is a complete framework for intraday traders. It combines key market reference points (VWAP, moving averages, and the first 15-minute high/low range) with predictive levels based on historical daily moves. Together, these elements allow traders to build directional bias, spot breakouts, and manage risk throughout the session.
Key Features
1. VWAP (Volume-Weighted Average Price)
- Plots the intraday VWAP in real time.
- VWAP acts as a central “fair value” reference point for institutional order flow.
- Price trading above VWAP generally suggests bullish bias, while below VWAP leans bearish.
2. Exponential Moving Averages (EMAs)
- Two configurable EMAs are included:
- Fast EMA (default: 21 periods)
- Slow EMA (default: 34 periods)
- Each EMA is plotted with a single, user-selectable color for clarity.
- Crossovers or alignment between price, VWAP, and EMAs help define market structure.
3. Smart Bar Coloring
- Candles automatically change color when conditions align:
- Bull Zone: Price above VWAP, Fast EMA, and Slow EMA.
- Bear Zone: Price below VWAP, Fast EMA, and Slow EMA.
- Fluorescent bar coloring helps highlight momentum zones visually without additional analysis.
4. First 15-Minute High/Low/Mid (Automatic)
- Automatically detects the first 15 minutes of each new trading day (no manual input required).
- Plots horizontal lines for:
- First 15-Minute High (green)
- First 15-Minute Low (red)
- Midpoint of that range (gray)
- Once the initial 15-minute window ends, these levels remain projected throughout the session as breakout or support/resistance zones.
- Alerts trigger when price breaks above the high or below the low after the window.
5. Daily Support/Resistance Forecast
- Uses a rolling lookback of recent daily ranges (default: 126 days).
- Tracks average up moves and down moves from the daily open.
- Optionally incorporates standard deviation for wider confidence bands.
- Plots forecast levels above/below the current day’s open for reference.
Trading Logic (How to Use)
- Bullish Bias:
- Price is above VWAP, above both EMAs, and ideally above the first 15-minute high.
- This setup suggests trend continuation or breakout opportunities on the long side.
- Bearish Bias:
- Price is below VWAP, below both EMAs, and ideally below the first 15-minute low.
- This setup suggests downward pressure or breakout opportunities on the short side.
- Neutral / Caution Zone:
- Price caught between VWAP, EMAs, or inside the 15-minute range often signals indecision.
- Best to wait for confirmation or breakout before committing to trades.
Expectations After Using It
- The script provides context and structure, not trading signals.
- It highlights where price is relative to meaningful market levels so traders can act with greater confidence.
- Combining VWAP, EMAs, and the 15-minute breakout framework helps traders stay aligned with the market’s natural rhythm.
Disclaimer
This script is a tool for market analysis and educational purposes only.
It does not constitute financial advice, trading recommendations, or guaranteed profitability.
Markets are inherently risky, and past patterns do not ensure future results.
Always combine this tool with sound risk management, personal research, and professional guidance before making any trading decisions.
Multi-TF Trend Table (Configurable)1) What this tool does (in one minute)
A compact, multi‑timeframe dashboard that stacks eight timeframes and tells you:
Trend (fast MA vs slow MA)
Where price sits relative to those MAs
How far price is from the fast MA in ATR terms
MA slope (rising, falling, flat)
Stochastic %K (with overbought/oversold heat)
MACD momentum (up or down)
A single score (0%–100%) per timeframe
Alignment tick when trend, structure, slope and momentum all agree
Use it to:
Frame bias top‑down (M→W→D→…→15m)
Time entries on your execution timeframe when the higher‑TF stack is aligned
Avoid counter‑trend traps when the table is mixed
2) Table anatomy (each column explained)
The table renders 9 columns × 8 rows (one row per timeframe label you define).
TF — The label you chose for that row (e.g., Month, Week, 4H). Cosmetic; helps you read the stack.
Trend — Arrow from fast MA vs slow MA: ↑ if fastMA > slowMA (up‑trend), ↓ otherwise (down‑trend). Cell is green for up, red for down.
Price Pos — One‑character structure cue:
🔼 if price is above both fast and slow MAs (bullish structure)
🔽 if price is below both (bearish structure)
– otherwise (between MAs / mixed)
MA Dist — Distance of price from the fast MA measured in ATR multiples:
XS < S < M < L < XL according to your thresholds (see §3.3). Useful for judging stretch/mean‑reversion risk and stop sizing.
MA Slope — The fast MA one‑bar slope:
↑ if fastMA - fastMA > 0
↓ if < 0
→ if = 0
Stoch %K — Rounded %K value (default 14‑1‑3). Background highlights when it aligns with the trend:
Green heat when trend up and %K ≤ oversold
Red heat when trend down and %K ≥ overbought Tooltip shows K and D values precisely.
Trend % — Composite score (0–100%), the dashboard’s confidence for that timeframe:
+20 if trendUp (fast>slow)
+20 if fast MA slope > 0
+20 if MACD up (signal definition in §2.8)
+20 if price above fast MA
+20 if price above slow MA
Background colours:
≥80 lime (strong alignment)
≥60 green (good)
≥40 orange (mixed)
<40 grey (weak/contrary)
MACD — 🟢 if EMA(12)−EMA(26) > its EMA(9), else 🔴. It’s a simple “momentum up/down” proxy.
Align — ✔ when everything is in gear for that trend direction:
For up: trendUp and price above both MAs and slope>0 and MACD up
For down: trendDown and price below both MAs and slope<0 and MACD down Tooltip spells this out.
3) Settings & how to tune them
3.1 Timeframes (TF1–TF8)
Inputs: TF1..TF8 hold the resolution strings used by request.security().
Defaults: M, W, D, 720, 480, 240, 60, 15 with display labels Month, Week, Day, 12H, 8H, 4H, 1H, 15m.
Tips
Keep a top‑down funnel (e.g., Month→Week→Day→H4→H1→M15) so you can cascade bias into entries.
If you scalp, consider D, 240, 120, 60, 30, 15, 5, 1.
Crypto weekends: consider 2D in place of W to reflect continuous trading.
3.2 Moving Average (MA) group
Type: EMA, SMA, WMA, RMA, HMA. Changes both fast & slow MA computations everywhere.
Fast Length: default 20. Shorten for snappier trend/slope & tighter “price above fast” signals.
Slow Length: default 200. Controls the structural trend and part of the score.
When to change
Swing FX/equities: EMA 20/200 is a solid baseline.
Mean‑reversion style: consider SMA 20/100 so trend flips slower.
Crypto/indices momentum: HMA 21 / EMA 200 will read slope more responsively.
3.3 ATR / Distance group
ATR Length: default 14; longer makes distance less jumpy.
XS/S/M/L thresholds: define the labels in column MA Dist. They are compared to |close − fastMA| / ATR.
Defaults: XS 0.25×, S 0.75×, M 1.5×, L 2.5×; anything ≥L is XL.
Usage
Entries late in a move often occur at L/XL; consider waiting for a pullback unless you are trading breakouts.
For stops, an initial SL around 0.75–1.5 ATR from fast MA often sits behind nearby noise; use your plan.
3.4 Stochastic group
%K Length / Smoothing / %D Smoothing: defaults 14 / 1 / 3.
Overbought / Oversold: defaults 70 / 30 (adjust to 80/20 for trendier assets).
Heat logic (column Stoch %K): highlights when a pullback aligns with the dominant trend (oversold in an uptrend, overbought in a downtrend).
3.5 View
Full Screen Table Mode: centers and enlarges the table (position.middle_center). Great for clean screenshots or multi‑monitor setups.
4) Signal logic (how each datapoint is computed)
Per‑TF data (via a single request.security()):
fastMA, slowMA → based on your MA Type and lengths
%K, %D → Stoch(High,Low,Close,kLen) smoothed by kSmooth, then %D smoothed by dSmooth
close, ATR(atrLen) → for structure and distance
MACD up → (EMA12−EMA26) > EMA9(EMA12−EMA26)
fastMA_prev → yesterday/previous‑bar fast MA for slope
TrendUp → fastMA > slowMA
Price Position → compares close to both MAs
MA Distance Label → thresholds on abs(close − fastMA)/ATR
Slope → fastMA − fastMA
Score (0–100) → sum of the five 20‑point checks listed in §2.7
Align tick → conjunction of trend, price vs both MAs, slope and MACD (see §2.9)
Important behaviour
HTF values are sampled at the execution chart’s bar close using Pine v6 defaults (no lookahead). So the daily row updates only when a daily bar actually closes.
5) How to trade with it (playbooks)
The table is a framework. Entries/exits still follow your plan (e.g., S/D zones, price action, risk rules). Use the table to know when to be aggressive vs patient.
Playbook A — Trend continuation (pullback entry)
Look for Align ✔ on your anchor TFs (e.g., Week+Day both ≥80 and green, Trend ↑, MACD 🟢).
On your execution TF (e.g., H1/H4), wait for Stoch heat with the trend (oversold in uptrend or overbought in downtrend), and MA Dist not at XL.
Enter on your trigger (break of pullback high/low, engulfing, retest of fast MA, or S/D first touch per your plan).
Risk: consider ATR‑based SL beyond structure; size so 0.25–0.5% account risk fits your rules.
Trail or scale at M/L distances or when score deteriorates (<60).
Playbook B — Breakout with confirmation
Mixed stack turns into broad green: Trend % jumps to ≥80 on Day and H4; MACD flips 🟢.
Price Pos shows 🔼 across H4/H1 (above both MAs). Slope arrows ↑.
Enter on the first clean base‑break with volume/impulse; avoid if MA Dist already XL.
Playbook C — Mean‑reversion fade (advanced)
Use only when higher TFs are not aligned and the row you trade shows XL distance against the higher‑TF context. Take quick targets back to fast MA. Lower win‑rate, faster management.
Playbook D — Top‑down filter for Supply/Demand strategy
Trade first retests only in the direction where anchor TFs (Week/Day) have Align ✔ and Trend % ≥60. Skip counter‑trend zones when the stack is red/green against you.
6) Reading examples
Strong bullish stack
Week: ↑, 🔼, S/M, slope ↑, %K=32 (green heat), Trend 100%, MACD 🟢, Align ✔
Day: ↑, 🔼, XS/S, slope ↑, %K=45, Trend 80%, MACD 🟢, Align ✔
Action: Look for H4/H1 pullback into demand or fast MA; buy continuation.
Late‑stage thrust
H1: ↑, 🔼, XL, slope ↑, %K=88
Day/H4: only 60–80%
Action: Likely overextended on H1; wait for mean reversion or multi‑TF alignment before chasing.
Bearish transition
Day flips from 60%→40%, Trend ↓, MACD turns 🔴, Price Pos “–” (between MAs)
Action: Stand aside for longs; watch for lower‑high + Align ✔ on H4/H1 to join shorts.
7) Practical tips & pitfalls
HTF closure: Don’t assume a daily row changed mid‑day; it won’t settle until the daily bar closes. For intraday anticipation, watch H4/H1 rows.
MA Type consistency: Changing MA Type changes slope/structure everywhere. If you compare screenshots, keep the same type.
ATR thresholds: Calibrate per asset class. FX may suit defaults; indices/crypto might need wider S/M/L.
Score ≠ signal: 100% does not mean “must buy now.” It means the environment is favourable. Still execute your trigger.
Mixed stacks: When rows disagree, reduce size or skip. The tool is telling you the market lacks consensus.
8) Customisation ideas
Timeframe presets: Save layouts (e.g., Swing, Intraday, Scalper) as indicator templates in TradingView.
Alternative momentum: Replace the MACD condition with RSI(>50/<50) if desired (would require code edit).
Alerts: You can add alert conditions for (a) Align ✔ changes, (b) Trend % crossing 60/80, (c) Stoch heat events. (Not shipped in this script, but easy to add.)
9) FAQ
Q: Why do I sometimes see a dash in Price Pos? A: Price is between fast and slow MAs. Structure is mixed; seek clarity before acting.
Q: Does it repaint? A: No, higher‑TF values update on the close of their own bars (standard request.security behaviour without lookahead). Intra‑bar they can fluctuate; decisions should be made at your bar close per your plan.
Q: Which columns matter most? A: For trend‑following: Trend, Price Pos, Slope, MACD, then Stoch heat for entries. The Score summarises, and Align enforces discipline.
Q: How do I integrate with ATR‑based risk? A: Use the MA Dist label to avoid chasing at extremes and to size stops in ATR terms (e.g., SL behind structure at ~1–1.5 ATR).
Control Point System📊 Control Zone Strategy - Trading System Summary
🎯 Core Concept
Trade based on control zone breaks where buyers take over seller zones (bullish) or sellers take over buyer zones (bearish).
📍 Key Levels Setup
Seller Control Zones (Resistance)
PMH (Pre Market High) - Where sellers stopped buyers
YDH (Yesterday High) - Where sellers stopped buyers
Buyer Control Zones (Support)
PML (Pre Market Low) - Where buyers stopped sellers
YDL (Yesterday Low) - Where buyers stopped sellers
📈 EMA System
200 EMA (Purple) - Trend Filter: Above = Bullish bias | Below = Bearish bias
48 EMA (Red) - Last line of defense for pullbacks/shorts
13 EMA (Green) - Pullback levels (if above 200) or Short levels (if below 200)
8 EMA (Orange) - Exit indicator
⚡ Entry Signals
BULLISH Setup (Buyers Take Control)
Condition: Price breaks above PMH or YDH (seller zones)
Confirmation: Above 200 EMA for bullish trend
Entry: Use 5-minute timeframe for precise entries
Logic: Buyers have overpowered seller control zones
BEARISH Setup (Sellers Take Control)
Condition: Price breaks below PML or YDL (buyer zones)
Confirmation: Below 200 EMA for bearish trend
Entry: Use 5-minute timeframe for precise entries
Logic: Sellers have overpowered buyer control zones
🚪 Exit Strategy
Main Exit Rule
Exit Signal: Full candle close above 8 EMA on 5 or 10-minute chart
Runners: Take partial profits along the way, let runners ride until 8 EMA exit
Profit Taking
Scale out at key resistance/support levels
Use Daily 13 EMA as potential exit target
Trail stops using 8 EMA
⏰ Timeframes
Entry: 5-minute chart
Exit Monitoring: 5-minute or 10-minute chart for 8 EMA signals
PMH/PML: Calculated from 4:00 AM - 8:29 AM EST premarket session
🎯 Quick Decision Matrix
ScenarioActionBiasBreak above PMH/YDH + Above 200 EMABUYBullishBreak below PML/YDL + Below 200 EMASELLBearishFull candle close above 8 EMAEXITNeutralPrice at 13/48 EMA + Trend intactAdd/ScaleContinue
💡 Key Rules
Trend is king - Always check 200 EMA first
Zone breaks = control shifts - Trade in direction of new control
8 EMA exit - Respect the exit signal to preserve profits
Scale profits - Don't exit everything at once, use runners
Bottom Line: Trade the battle for control between buyers and sellers at key levels, with trend as your guide and 8 EMA as your exit!
Locked 5m 13 EMA & 15m 20 EMA with Mid EMA & SignalsThis indicator overlays the 5-minute 13 EMA and the 15-minute 20 EMA on any chart timeframe up to 15 minutes, along with a mid EMA (5-minute 36-period) for reference.
Features include:
EMA Cross Detection: Shows bullish and bearish cross arrows when the 5m 13 EMA crosses the 15m 20 EMA.
EMA Fill: Highlights the area between the EMAs in green (bullish) or red (bearish).
Mid EMA Buy/Sell Signals: Generates buy signals when price touches the mid EMA in a bullish stack and sell signals in a bearish stack.
Custom Alerts: Alerts for EMA crosses, EMA stack direction, and mid EMA buy/sell triggers.
Timeframe Safety Warning: Alerts if applied on timeframes higher than 15 minutes.
Ideal For:
Traders who want a locked, non-repainting EMA setup for multi-timeframe analysis and clear entry/exit signals based on mid-range EMA interaction.
Inputs:
Show/Hide arrows for EMA crosses
Show/Hide fill between EMAs
Show/Hide mid EMA line
Show/Hide buy/sell signals
Fill transparency adjustment
Malama's KAYCAP Pre-Market Box# Pre-Market Single Candle Range Box
## What Makes This Script Original
While many scripts plot entire pre-market session ranges, this indicator focuses specifically on **a single user-defined candle** within the pre-market period rather than the entire session. This targeted approach allows traders to isolate the most relevant price action from a specific time (default: 4:00 AM EST) that often establishes key levels for the trading day.
## Core Methodology & Technical Implementation
**Single Candle Isolation:**
- Captures OHLC data from one specific minute within pre-market hours (user configurable)
- Differentiates between the candle's body (open/close range) and wicks (high/low extremes)
- Creates four distinct reference levels instead of traditional session high/low boxes
**Dual Box Structure:**
- **Inner Box (Body):** Plots the range between open and close prices of the target candle
- **Outer Boundaries:** Separately plots the high and low of that same candle
- **Visual Differentiation:** Uses different colors and line weights to distinguish body vs. wick levels
**Time-Specific Logic:**
The script uses precise time matching (`hour == boxHour and minute == boxMinute`) to capture data from exactly one candle, rather than aggregating an entire session. This creates four specific price levels:
- Box Top: Higher of open/close (body boundary)
- Box Bottom: Lower of open/close (body boundary)
- Box High: Candle high (wick extreme)
- Box Low: Candle low (wick extreme)
## Why This Approach Differs from Standard Session Boxes
**vs. Full Session Ranges:** Focuses on a single critical minute rather than entire pre-market period
**vs. Traditional S/R:** Creates both body and wick levels from one specific candle
**vs. Opening Range:** Uses pre-market data rather than regular session opening minutes
## Practical Application
The 4:00 AM EST default targets a time when institutional pre-market activity often establishes initial sentiment and key levels. By isolating this specific candle's range:
- **Body levels** often act as initial support/resistance during regular hours
- **Wick extremes** provide broader range boundaries for breakout analysis
- **Precise timing** allows focus on the most statistically relevant pre-market moment
## Technical Considerations
- Requires intraday timeframes (1-minute recommended) to capture specific candle data
- Time settings should match your broker's timezone for accurate candle selection
- Works best on liquid instruments where pre-market activity is meaningful
- The selected candle must exist in your data feed for the levels to plot
## Customization Options
All timing parameters are adjustable:
- Target candle hour and minute
- Pre-market session definition (for context)
- Visual styling for all four level types
This focused approach provides more granular analysis than broad session ranges while maintaining simplicity in execution.
Smarter Money Concepts - Wyckoff Springs & Upthrusts [PhenLabs]📊Smarter Money Concepts - Wyckoff Springs & Upthrusts
Version: PineScript™v6
📌Description
Discover institutional manipulation in real-time with this advanced Wyckoff indicator that detects Springs (accumulation phases) and Upthrusts (distribution phases). It identifies when price tests support or resistance on high volume, followed by a strong recovery, signaling potential reversals where smart money accumulates or distributes positions. This tool solves the common problem of missing these subtle phase transitions, helping traders anticipate trend changes and avoid traps in volatile markets.
By combining volume spike detection, ATR-normalized recovery strength, and a sigmoid probability model, it filters out weak signals and highlights only high-confidence setups. Whether you’re swing trading or day trading, this indicator provides clear visual cues to align with institutional flows, improving entry timing and risk management.
🚀Points of Innovation
Sigmoid-based probability threshold for signal filtering, ensuring only statistically significant Wyckoff patterns trigger alerts
ATR-normalized recovery measurement that adapts to market volatility, unlike static recovery checks in traditional indicators
Customizable volume spike multiplier to distinguish institutional volume from retail noise
Integrated dashboard legend with position and size options for personalized chart visualization
Hidden probability plots for advanced users to analyze underlying math without chart clutter
🔧Core Components
Support/Resistance Calculator: Scans a user-defined lookback period to establish dynamic levels for Spring and Upthrust detection
Volume Spike Detector: Compares current volume to a 10-period SMA, multiplied by a configurable factor to identify significant surges
Recovery Strength Analyzer: Uses ATR to measure price recovery after breaks, normalizing for different market conditions
Probability Model: Applies sigmoid function to combine volume and recovery data, generating a confidence score for each potential signal
🔥Key Features
Spring Detection: Spots accumulation when price dips below support but recovers strongly, helping traders enter longs at potential bottoms
Upthrust Detection: Identifies distribution when price spikes above resistance but falls back, alerting to possible short opportunities at tops
Customizable Inputs: Adjust lookback, volume multiplier, ATR period, and probability threshold to match your trading style and market
Visual Signals: Clear + (green) and - (red) labels on charts for instant recognition of accumulation and distribution phases
Alert System: Triggers notifications for signals and probability thresholds, keeping you informed without constant monitoring
🎨Visualization
Spring Signal: Green upward label (+) below the bar, indicating strong recovery after support break for accumulation
Upthrust Signal: Red downward label (-) above the bar, showing failed breakout above resistance for distribution
Dashboard Legend: Customizable table explaining signals, positioned anywhere on the chart for quick reference
📖Usage Guidelines
Core Settings
Support/Resistance Lookback
Default: 20
Range: 5-50
Description: Sets bars back for S/R levels; lower for recent sensitivity, higher for stable long-term zones – ideal for spotting Wyckoff phases
Volume Spike Multiplier
Default: 1.5
Range: 1.0-3.0
Description: Multiplies 10-period volume SMA; higher values filter to significant spikes, confirming institutional involvement in patterns
ATR for Recovery Measurement
Default: 5
Range: 2-20
Description: ATR period for recovery strength; shorter for volatile markets, longer for smoother analysis of post-break recoveries
Phase Transition Probability Threshold
Default: 0.9
Range: 0.5-0.99
Description: Minimum sigmoid probability for signals; higher for strict filtering, ensuring only high-confidence Wyckoff setups
Display Settings
Dashboard Position
Default: Top Right
Range: Various positions
Description: Places legend table on chart; choose based on layout to avoid overlapping price action
Dashboard Text Size
Default: Normal
Range: Auto to Huge
Description: Adjusts legend text; larger for visibility, smaller for minimal space use
✅Best Use Cases
Swing Trading: Identify Springs for long entries in downtrends turning to accumulation
Day Trading: Catch Upthrusts for short scalps during intraday distribution at resistance
Trend Reversal Confirmation: Use in conjunction with other indicators to validate phase shifts in ranging markets
Volatility Plays: Spot signals in high-volume environments like news events for quick reversals
⚠️Limitations
May produce false signals in low-volume or sideways markets where volume spikes are unreliable
Depends on historical data, so performance varies in unprecedented market conditions or gaps
Probability model is statistical, not predictive, and cannot account for external factors like news
💡What Makes This Unique
Probability-Driven Filtering: Sigmoid model combines multiple factors for superior signal quality over basic Wyckoff detectors
Adaptive Recovery: ATR normalization ensures reliability across assets and timeframes, unlike fixed-threshold tools
User-Centric Design: Tooltips, customizable dashboard, and alerts make it accessible yet powerful for all trader levels
🔬How It Works
Calculate S/R Levels:
Uses the highest high and the lowest low over the lookback period to set dynamic zones
Establishes baseline for detecting breaks in Wyckoff patterns
Detect Breaks and Recovery:
Checks for price breaking support/resistance, then recovering on volume
Measures recovery strength via ATR for volatility adjustment
Apply Probability Model:
Combines volume spike and recovery into a sigmoid function for confidence score
Triggers signal only if above threshold, plotting visuals and alerts
💡Note:
For optimal results, combine with price action analysis and test settings on historical charts. Remember, Wyckoff patterns are most effective in trending markets – use lower probability thresholds for practice, then increase for live trading to focus on high-quality setups.
Live Trading Metrics DashboardReal-Time Trading Data Table for Chart Analysis
This clean and professional dashboard displays essential trading metrics directly on your chart in an easy-to-read table format. Perfect for traders who need quick access to key volatility and momentum data without cluttering their chart with multiple indicators.
Key Metrics Displayed:
IBD Relative Strength (RS):
Professional Formula: Uses Investor's Business Daily methodology
Multi-Timeframe Analysis: Weighted calculation across 3, 6, 9, and 12-month periods
Performance Indicator: Shows how the instrument performs relative to its historical price action
Real-Time Updates: Values update with each bar for current market conditions
1.5 ATR (Average True Range):
Volatility Measurement: 14-period ATR multiplied by 1.5 for extended range analysis
Stop-Loss Placement: Ideal for setting dynamic stop-loss levels
Risk Management: Helps determine appropriate position sizing based on volatility
Breakout Targets: Useful for setting profit targets on breakout trades
1.5 ATR Percentage:
Relative Volatility: Shows 1.5 ATR as a percentage of current price
Cross-Asset Comparison: Enables volatility comparison across different instruments
Position Sizing: Helps calculate risk per trade as percentage of price
Market Context: Understand volatility relative to instrument value
How to Interpret:
Positive IBD RS: Instrument showing strength relative to historical performance
Negative IBD RS: Instrument showing weakness relative to historical performance
Higher ATR Values: Increased volatility, wider stops needed
Higher ATR %: Greater relative volatility for the instrument's price level
Perfect For:
Day traders needing quick volatility reference
Swing traders using IBD methodology
Position traders managing risk with ATR-based stops
Any trader wanting clean, organized data display
Average True Ranges with IBD RSAdvanced ATR Analysis with IBD Relative Strength
This comprehensive indicator combines Average True Range (ATR) analysis with IBD (Investor's Business Daily) Relative Strength calculation, providing both volatility measurement and momentum analysis in one powerful tool.
Key Features:
ATR Analysis:
Standard ATR: Customizable period (default 14) with multiple smoothing options
1.5x ATR: Extended range for wider stop-loss and target calculations
Smoothing Options: Choose between RMA, SMA, EMA, or WMA for ATR calculation
Customizable Colors: Distinct colors for easy visual identification
IBD Relative Strength:
Professional RS Formula: Uses the same calculation method as Investor's Business Daily
Multi-Timeframe Analysis: Compares current price to 3, 6, 9, and 12-month performance
Weighted Calculation: 40% weight on 3-month, 20% each on 6, 9, and 12-month performance
Zero-Based Scale: Values above 0 indicate outperformance, below 0 indicate underperformance
Trading Applications:
Volatility-Based Stops: Use ATR and 1.5x ATR for dynamic stop-loss placement
Position Sizing: ATR helps determine appropriate position size based on volatility
Relative Strength Analysis: IBD RS identifies stocks with superior momentum
Market Timing: High RS values often precede strong price moves
Risk Management: Combine volatility (ATR) with momentum (RS) for comprehensive analysis
Technical Details:
ATR Calculation: True Range smoothed over selected period with chosen method
IBD RS Formula: (40% × 3M) + (20% × 6M) + (20% × 9M) + (20% × 12M) - 100
Display: Separate pane indicator with customizable colors for each component
How to Interpret:
High ATR: Increased volatility, wider stops needed
Low ATR: Reduced volatility, tighter stops possible
Positive IBD RS: Stock outperforming market over measured periods
Negative IBD RS: Stock underperforming market over measured periods
Customizable Parameters:
ATR calculation length
Smoothing method for ATR
Individual colors for ATR, 1.5x ATR, and IBD RS lines
Perfect for swing traders and position traders who want to combine volatility analysis with relative strength momentum in their decision-making process. Particularly useful for stock selection and risk management.
Market Structure: HH/HL/LH/LL (v6, simple)What it does
Labels swing High/Low and classifies structure as HH / HL / LH / LL after confirmation.
Uses confirmed fractals (pivothigh/pivotlow) → no repaint after confirmation (there is a right-bar confirmation delay).
Optional swing connectors (lines), optional plain H/L when structure label is not applicable.
Plots last confirmed High/Low levels as reference.
Alerts when a new HH/HL/LH/LL is formed.
How it works
Swings are detected with ta.pivothigh() / ta.pivotlow() using user-defined left and right.
A pivot is confirmed only after right bars on the right—this is the only delay. Once confirmed, the label does not repaint.
Inputs
Left bars & Right bars – fractal sensitivity.
Connect swings with lines – draw lines between consecutive swings.
Show bullish (HH/HL) / Show bearish (LH/LL) – filter what to display.
Show plain H/L – draw H/L when classification is not HH/HL/LH/LL yet.
Recommended settings
1H–4H: left=2, right=2 (responsive).
1D+: left=3, right=3 (cleaner swing map).
Alerts provided
HH formed – new Higher High confirmed.
HL formed – new Higher Low confirmed.
LH formed – new Lower High confirmed.
LL formed – new Lower Low confirmed.
Use them to automate structure tracking or feed your strategy rules.
Tips
Trend up: a sequence of HH + HL; Trend down: LH + LL.
Combine with VWAP/EMA, liquidity zones, or volume/CVD to avoid chasing late signals.
The script is intentionally simple and lightweight; BOS/CHoCH can be added in a future update.
Limitations / Notes
Because the tool relies on confirmed pivots, signals are delayed by right bars.
This is not financial advice and not a buy/sell system on its own.
Changelog
v1.0 – Initial public release (Pine v6). Structure labels, swing connectors, last levels, and alert set.
Keywords
market structure, hh hl lh ll, swing, fractal, pivothigh, pivotlow, trend, structure labels, price action
Auto-Fit Growth Trendline# **Theoretical Algorithmic Principles of the Auto-Fit Growth Trendline (AFGT)**
## **🎯 What Does This Algorithm Do?**
The Auto-Fit Growth Trendline is an advanced technical analysis system that **automates the identification of long-term growth trends** and **projects future price levels** based on historical cyclical patterns.
### **Primary Functionality:**
- **Automatically detects** the most significant lows in regular periods (monthly, quarterly, semi-annually, annually)
- **Constructs a dynamic trendline** that connects these historical lows
- **Projects the trend into the future** with high mathematical precision
- **Generates Fibonacci bands** that act as dynamic support and resistance levels
- **Automatically adapts** to different timeframes and market conditions
### **Strategic Purpose:**
The algorithm is designed to identify **fundamental value zones** where price has historically found support, enabling traders to:
- Identify optimal entry points for long positions
- Establish realistic price targets based on mathematical projections
- Recognize dynamic support and resistance levels
- Anticipate long-term price movements
---
## **🧮 Core Mathematical Foundations**
### **Adaptive Temporal Segmentation Theory**
The algorithm is based on **dynamic temporal partition theory**, where time is divided into mathematically coherent uniform intervals. It uses modular transformations to create bijective mappings between continuous timestamps and discrete periods, ensuring each temporal point belongs uniquely to a specific period.
**What does this achieve?** It allows the algorithm to automatically identify natural market cycles (annual, quarterly, etc.) without manual intervention, adapting to the inherent periodicity of each asset.
The temporal mapping function implements a **discrete affine transformation** that normalizes different frequencies (monthly, quarterly, semi-annual, annual) to a space of unique identifiers, enabling consistent cross-temporal comparative analysis.
---
## **📊 Local Extrema Detection Theory**
### **Multi-Point Retrospective Validation Principle**
Local minima detection is founded on **relative extrema theory with sliding window**. Instead of using a simple minimum finder, it implements a cross-validation system that examines the persistence of the extremum across multiple historical periods.
**What problem does this solve?** It eliminates false minima caused by temporal volatility, identifying only those points that represent true historical support levels with statistical significance.
This approach is based on the **statistical confirmation principle**, where a minimum is only considered valid if it maintains its extremum condition during a defined observation period, significantly reducing false positives caused by transitory volatility.
---
## **🔬 Robust Interpolation Theory with Outlier Control**
### **Contextual Adaptive Interpolation Model**
The mathematical core uses **piecewise linear interpolation with adaptive outlier correction**. The key innovation lies in implementing a **contextual anomaly detector** that identifies not only absolute extreme values, but relative deviations to the local context.
**Why is this important?** Financial markets contain extreme events (crashes, bubbles) that can distort projections. This system identifies and appropriately weights them without completely eliminating them, preserving directional information while attenuating distortions.
### **Implicit Bayesian Smoothing Algorithm**
When an outlier is detected (deviation >300% of local average), the system applies a **simplified Kalman filter** that combines the current observation with a local trend estimation, using a weight factor that preserves directional information while attenuating extreme fluctuations.
---
## **📈 Stabilized Extrapolation Theory**
### **Exponential Growth Model with Dampening**
Extrapolation is based on a **modified exponential growth model with progressive dampening**. It uses multiple historical points to calculate local growth ratios, implements statistical filtering to eliminate outliers, and applies a dampening factor that increases with extrapolation distance.
**What advantage does this offer?** Long-term projections in finance tend to be exponentially unrealistic. This system maintains short-to-medium term accuracy while converging toward realistic long-term projections, avoiding the typical "exponential explosions" of other methods.
### **Asymptotic Convergence Principle**
For long-term projections, the algorithm implements **controlled asymptotic convergence**, where growth ratios gradually converge toward pre-established limits, avoiding unrealistic exponential projections while preserving short-to-medium term accuracy.
---
## **🌟 Dynamic Fibonacci Projection Theory**
### **Continuous Proportional Scaling Model**
Fibonacci bands are constructed through **uniform proportional scaling** of the base curve, where each level represents a linear transformation of the main curve by a constant factor derived from the Fibonacci sequence.
**What is its practical utility?** It provides dynamic resistance and support levels that move with the trend, offering price targets and profit-taking points that automatically adapt to market evolution.
### **Topological Preservation Principle**
The system maintains the **topological properties** of the base curve in all Fibonacci projections, ensuring that spatial and temporal relationships are consistently preserved across all resistance/support levels.
---
## **⚡ Adaptive Computational Optimization**
### **Multi-Scale Resolution Theory**
It implements **automatic multi-resolution analysis** where data granularity is dynamically adjusted according to the analysis timeframe. It uses the **adaptive Nyquist principle** to optimize the signal-to-noise ratio according to the temporal observation scale.
**Why is this necessary?** Different timeframes require different levels of detail. A 1-minute chart needs more granularity than a monthly one. This system automatically optimizes resolution for each case.
### **Adaptive Density Algorithm**
Calculation point density is optimized through **adaptive sampling theory**, where calculation frequency is adjusted according to local trend curvature and analysis timeframe, balancing visual precision with computational efficiency.
---
## **🛡️ Robustness and Fault Tolerance**
### **Graceful Degradation Theory**
The system implements **multi-level graceful degradation**, where under error conditions or insufficient data, the algorithm progressively falls back to simpler but reliable methods, maintaining basic functionality under any condition.
**What does this guarantee?** That the indicator functions consistently even with incomplete data, new symbols with limited history, or extreme market conditions.
### **State Consistency Principle**
It uses **mathematical invariants** to guarantee that the algorithm's internal state remains consistent between executions, implementing consistency checks that validate data structure integrity in each iteration.
---
## **🔍 Key Theoretical Innovations**
### **A. Contextual vs. Absolute Outlier Detection**
It revolutionizes traditional outlier detection by considering not only the absolute magnitude of deviations, but their relative significance within the local context of the time series.
**Practical impact:** It distinguishes between legitimate market movements and technical anomalies, preserving important events like breakouts while filtering noise.
### **B. Extrapolation with Weighted Historical Memory**
It implements a memory system that weights different historical periods according to their relevance for current prediction, creating projections more adaptable to market regime changes.
**Competitive advantage:** It automatically adapts to fundamental changes in asset dynamics without requiring manual recalibration.
### **C. Automatic Multi-Timeframe Adaptation**
It develops an automatic temporal resolution selection system that optimizes signal extraction according to the intrinsic characteristics of the analysis timeframe.
**Result:** A single indicator that functions optimally from 1-minute to monthly charts without manual adjustments.
### **D. Intelligent Asymptotic Convergence**
It introduces the concept of controlled asymptotic convergence in financial extrapolations, where long-term projections converge toward realistic limits based on historical fundamentals.
**Added value:** Mathematically sound long-term projections that avoid the unrealistic extremes typical of other extrapolation methods.
---
## **📊 Complexity and Scalability Theory**
### **Optimized Linear Complexity Model**
The algorithm maintains **linear computational complexity** O(n) in the number of historical data points, guaranteeing scalability for extensive time series analysis without performance degradation.
### **Temporal Locality Principle**
It implements **temporal locality**, where the most expensive operations are concentrated in the most relevant temporal regions (recent periods and near projections), optimizing computational resource usage.
---
## **🎯 Convergence and Stability**
### **Probabilistic Convergence Theory**
The system guarantees **probabilistic convergence** toward the real underlying trend, where projection accuracy increases with the amount of available historical data, following **law of large numbers** principles.
**Practical implication:** The more history an asset has, the more accurate the algorithm's projections will be.
### **Guaranteed Numerical Stability**
It implements **intrinsic numerical stability** through the use of robust floating-point arithmetic and validations that prevent overflow, underflow, and numerical error propagation.
**Result:** Reliable operation even with extreme-priced assets (from satoshis to thousand-dollar stocks).
---
## **💼 Comprehensive Practical Application**
**The algorithm functions as a "financial GPS"** that:
1. **Identifies where we've been** (significant historical lows)
2. **Determines where we are** (current position relative to the trend)
3. **Projects where we're going** (future trend with specific price levels)
4. **Provides alternative routes** (Fibonacci bands as alternative targets)
This theoretical framework represents an innovative synthesis of time series analysis, approximation theory, and computational optimization, specifically designed for long-term financial trend analysis with robust and mathematically grounded projections.
Market Outlook Score (MOS)Overview
The "Market Outlook Score (MOS)" is a custom technical indicator designed for TradingView, written in Pine Script version 6. It provides a quantitative assessment of market conditions by aggregating multiple factors, including trend strength across different timeframes, directional movement (via ADX), momentum (via RSI changes), volume dynamics, and volatility stability (via ATR). The MOS is calculated as a weighted score that ranges typically between -1 and +1 (though it can exceed these bounds in extreme conditions), where positive values suggest bullish (long) opportunities, negative values indicate bearish (short) setups, and values near zero imply neutral or indecisive markets.
This indicator is particularly useful for traders seeking a holistic "outlook" score to gauge potential entry points or market bias. It overlays on a separate pane (non-overlay mode) and visualizes the score through horizontal threshold lines and dynamic labels showing the numeric MOS value along with a simple trading decision ("Long", "Short", or "Neutral"). The script avoids using the plot function for compatibility reasons (e.g., potential TradingView bugs) and instead relies on hline for static lines and label.new for per-bar annotations.
Key features:
Multi-Timeframe Analysis: Incorporates slope data from 5-minute, 15-minute, and 30-minute charts to capture short-term trends.
Trend and Strength Integration: Uses ADX to weight trend bias, ensuring stronger signals in trending markets.
Momentum and Volume: Includes RSI momentum impulses and volume deviations for added confirmation.
Volatility Adjustment: Factors in ATR changes to assess market stability.
Customizable Inputs: Allows users to tweak periods for lookback, ADX, and ATR.
Decision Labels: Automatically classifies the MOS into actionable categories with visual labels.
This indicator is best suited for intraday or swing trading on volatile assets like stocks, forex, or cryptocurrencies. It does not generate buy/sell signals directly but can be combined with other tools (e.g., moving averages or oscillators) for comprehensive strategies.
Inputs
The script provides three user-configurable inputs via TradingView's input panel:
Lookback Period (lookback):
Type: Integer
Default: 20
Range: Minimum 10, Maximum 50
Purpose: Defines the number of bars used in slope calculations for trend analysis. A shorter lookback makes the indicator more sensitive to recent price action, while a longer one smooths out noise for longer-term trends.
ADX Period (adxPeriod):
Type: Integer
Default: 14
Range: Minimum 5, Maximum 30
Purpose: Sets the smoothing period for the Average Directional Index (ADX) and its components (DI+ and DI-). Standard value is 14, but shorter periods increase responsiveness, and longer ones reduce false signals.
ATR Period (atrPeriod):
Type: Integer
Default: 14
Range: Minimum 5, Maximum 30
Purpose: Determines the period for the Average True Range (ATR) calculation, which measures volatility. Adjust this to match your trading timeframe—shorter for scalping, longer for positional trading.
These inputs allow customization without editing the code, making the indicator adaptable to different market conditions or user preferences.
Core Calculations
The MOS is computed through a series of steps, blending trend, momentum, volume, and volatility metrics. Here's a breakdown:
Multi-Timeframe Slopes:
The script fetches data from higher timeframes (5m, 15m, 30m) using request.security.
Slope calculation: For each timeframe, it computes the linear regression slope of price over the lookback period using the formula:
textslope = correlation(close, bar_index, lookback) * stdev(close, lookback) / stdev(bar_index, lookback)
This measures the rate of price change, where positive slopes indicate uptrends and negative slopes indicate downtrends.
Variables: slope5m, slope15m, slope30m.
ATR (Average True Range):
Calculated using ta.atr(atrPeriod).
Represents average volatility over the specified period. Used later to derive volatility stability.
ADX (Average Directional Index):
A detailed, manual implementation (not using built-in ta.adx for customization):
Computes upward movement (upMove = high - high ) and downward movement (downMove = low - low).
Derives +DM (Plus Directional Movement) and -DM (Minus Directional Movement) by filtering non-relevant moves.
Smooths true range (trur = ta.rma(ta.tr(true), adxPeriod)).
Calculates +DI and -DI: plusDI = 100 * ta.rma(plusDM, adxPeriod) / trur, similarly for minusDI.
DX: dx = 100 * abs(plusDI - minusDI) / max(plusDI + minusDI, 0.0001).
ADX: adx = ta.rma(dx, adxPeriod).
ADX values above 25 typically indicate strong trends; here, it's normalized (divided by 50) to influence the trend bias.
Volume Delta (5m Timeframe):
Fetches 5m volume: volume_5m = request.security(syminfo.tickerid, "5", volume, lookahead=barmerge.lookahead_on).
Computes a 12-period SMA of volume: avgVolume = ta.sma(volume_5m, 12).
Delta: (volume_5m - avgVolume) / avgVolume (or 0 if avgVolume is zero).
This measures relative volume spikes, where positive deltas suggest increased interest (bullish) and negative suggest waning activity (bearish).
MOS Components and Final Calculation:
Trend Bias: Average of the three slopes, normalized by close price and scaled by 100, then weighted by ADX influence: (slope5m + slope15m + slope30m) / 3 / close * 100 * (adx / 50).
Emphasizes trends in strong ADX conditions.
Momentum Impulse: Change in 5m RSI(14) over 1 bar, divided by 50: ta.change(request.security(syminfo.tickerid, "5", ta.rsi(close, 14), lookahead=barmerge.lookahead_on), 1) / 50.
Captures short-term momentum shifts.
Volatility Clarity: 1 - ta.change(atr, 1) / max(atr, 0.0001).
Measures ATR stability; values near 1 indicate low volatility changes (clearer trends), while lower values suggest erratic markets.
MOS Formula: Weighted average:
textmos = (0.35 * trendBias + 0.25 * momentumImpulse + 0.2 * volumeDelta + 0.2 * volatilityClarity)
Weights prioritize trend (35%) and momentum (25%), with volume and volatility at 20% each. These can be adjusted in code for experimentation.
Trading Decision:
A variable mosDecision starts as "Neutral".
If mos > 0.15, set to "Long".
If mos < -0.15, set to "Short".
Thresholds (0.15 and -0.15) are hardcoded but can be modified.
Visualization and Outputs
Threshold Lines (using hline):
Long Threshold: Horizontal dashed green line at +0.15.
Short Threshold: Horizontal dashed red line at -0.15.
Neutral Line: Horizontal dashed gray line at 0.
These provide visual reference points for MOS interpretation.
Dynamic Labels (using label.new):
Placed at each bar's index and MOS value.
Text: Formatted MOS value (e.g., "0.2345") followed by a newline and the decision (e.g., "Long").
Style: Downward-pointing label with gray background and white text for readability.
This replaces a traditional plot line, showing exact values and decisions per bar without cluttering the chart.
The indicator appears in a separate pane below the main price chart, making it easy to monitor alongside price action.
Usage Instructions
Adding to TradingView:
Copy the script into TradingView's Pine Script editor.
Save and add to your chart via the "Indicators" menu.
Select a symbol and timeframe (e.g., 1-minute for intraday).
Interpretation:
Long Signal: MOS > 0.15 – Consider bullish positions if supported by other indicators.
Short Signal: MOS < -0.15 – Potential bearish setups.
Neutral: Between -0.15 and 0.15 – Avoid trades or wait for confirmation.
Watch for MOS crossings of thresholds for momentum shifts.
Combine with price patterns, support/resistance, or volume for better accuracy.
Limitations and Considerations:
Lookahead Bias: Uses barmerge.lookahead_on for multi-timeframe data, which may introduce minor forward-looking bias in backtesting (use with caution).
No Alerts Built-In: Add custom alerts via TradingView's alert system based on MOS conditions.
Performance: Tested for compatibility; may require adjustments for illiquid assets or extreme volatility.
Backtesting: Use TradingView's strategy tester to evaluate historical performance, but remember past results don't guarantee future outcomes.
Customization: Edit weights in the MOS formula or thresholds to fit your strategy.
This indicator distills complex market data into a single score, aiding decision-making while encouraging users to verify signals with additional analysis. If you need modifications, such as restoring plot functionality or adding features, provide details for further refinement.
VWAP For Loop [BackQuant]VWAP For Loop
What this tool does—in one sentence
A volume-weighted trend gauge that anchors VWAP to a calendar period (day/week/month/quarter/year) and then scores the persistence of that VWAP trend with a simple for-loop “breadth” count; the result is a clean, threshold-driven oscillator plus an optional VWAP overlay and alerts.
Plain-English overview
Instead of judging raw price alone, this indicator focuses on anchored VWAP —the market’s average price paid during your chosen institutional period. It then asks a simple question across a configurable set of lookback steps: “Is the current anchored VWAP higher than it was i bars ago—or lower?” Each “yes” adds +1, each “no” adds −1. Summing those answers creates a score that reflects how consistently the volume-weighted trend has been rising or falling. Extreme positive scores imply persistent, broad strength; deeply negative scores imply persistent weakness. Crossing predefined thresholds produces objective long/short events and color-coded context.
Under the hood
• Anchoring — VWAP using hlc3 × volume resets exactly when the selected period rolls:
Day → session change, Week → new week, Month → new month, Quarter/Year → calendar quarter/year.
• For-loop scoring — For lag steps i = , compare today’s VWAP to VWAP .
– If VWAP > VWAP , add +1.
– Else, add −1.
The final score ∈ , where N = (end − start + 1). With defaults (1→45), N = 45.
• Signal logic (stateful)
– Long when score > upper (e.g., > 40 with N = 45 → VWAP higher than ~89% of checked lags).
– Short on crossunder of lower (e.g., dropping below −10).
– A compact state variable ( out ) holds the current regime: +1 (long), −1 (short), otherwise unchanged. This “stickiness” avoids constant flipping between bars without sufficient evidence.
Why VWAP + a breadth score?
• VWAP aggregates both price and volume—where participants actually traded.
• The breadth-style count rewards consistency of the anchored trend, not one-off spikes.
• Thresholds give you binary structure when you need it (alerts, automation), without complex math.
What you’ll see on the chart
• Sub-pane oscillator — The for-loop score line, colored by regime (long/short/neutral).
• Main-pane VWAP (optional) — Even though the indicator runs off-chart, the anchored VWAP can be overlaid on price (toggle visibility and whether it inherits trend colors).
• Threshold guides — Horizontal lines for the long/short bands (toggle).
• Cosmetics — Optional candle painting and background shading by regime; adjustable line width and colors.
Input map (quick reference)
• VWAP Anchor Period — Day, Week, Month, Quarter, Year.
• Calculation Start/End — The for-loop lag window . With 1→45, you evaluate 45 comparisons.
• Long/Short Thresholds — Default upper=40, lower=−10 (asymmetric by design; see below).
• UI/Style — Show thresholds, paint candles, background color, line width, VWAP visibility and coloring, custom long/short colors.
Interpreting the score
• Near +N — Current anchored VWAP is above most historical VWAP checkpoints in the window → entrenched strength.
• Near −N — Current anchored VWAP is below most checkpoints → entrenched weakness.
• Between — Mixed, choppy, or transitioning regimes; use thresholds to avoid reacting to noise.
Why the asymmetric default thresholds?
• Long = score > upper (40) — Demands unusually broad upside persistence before declaring “long regime.”
• Short = crossunder lower (−10) — Triggers only on downward momentum events (a fresh breach), not merely being below −10. This combination tends to:
– Capture sustained uptrends only when they’re very strong.
– Flag downside turns as they occur, rather than waiting for an extreme negative breadth.
Tuning guide
Choose an anchor that matches your horizon
– Intraday scalps : Day anchor on intraday charts.
– Swing/position : Month or Quarter anchor on 1h/4h/D charts to capture institutional cycles.
Pick the for-loop window
– Larger N (bigger end) = stronger evidence requirement, smoother oscillator.
– Smaller N = faster, more reactive score.
Set achievable thresholds
– Ensure upper ≤ N and lower ≥ −N ; if N=30, an upper of 40 can never trigger.
– Symmetric setups (e.g., +20/−20) are fine if you want balanced behavior.
Match visuals to intent
– Enabling VWAP coloring lets you see regime directly on price.
– Background shading is useful for discretionary reading; turn it off for cleaner automation displays.
Playbook examples
• Trend confirmation with disciplined entries — On Month anchor, N=45, upper=38–42: when the long regime engages, use pullbacks toward anchored VWAP on the main pane for entries, with stops just beyond VWAP or a recent swing.
• Downside transition detection — Keep lower around −8…−12 and watch for crossunders; combine with price losing anchored VWAP to validate risk-off.
• Intraday bias filter — Day anchor on a 5–15m chart, N=20–30, upper ~ 16–20, lower ~ −6…−10. Only take longs while score is positive and above a midline you define (e.g., 0), and shorts only after a genuine crossunder.
Behavior around resets (important)
Anchored VWAP is hard-reset each period. Immediately after a reset, the series can be young and comparisons to pre-reset values may span two periods. If you prefer within-period evaluation only, choose end small enough not to bridge typical period length on your timeframe, or accept that the breadth test intentionally spans regimes.
Alerts included
• VWAP FL Long — Fires when the long condition is true (score > upper and not in short).
• VWAP FL Short — Fires on crossunder of the lower threshold (event-driven).
Messages include {{ticker}} and {{interval}} placeholders for routing.
Strengths
• Simple, transparent math — Easy to reason about and validate.
• Volume-aware by construction — Decisions reference VWAP, not just price.
• Robust to single-bar noise — Needs many lags to agree before flipping state (by design, via thresholds and the stateful output).
Limitations & cautions
• Threshold feasibility — If N < upper or |lower| > N, signals will never trigger; always cross-check N.
• Path dependence — The state variable persists until a new event; if you want frequent re-evaluation, lower thresholds or reduce N.
• Regime changes — Calendar resets can produce early ambiguity; expect a few bars for the breadth to mature.
• VWAP sensitivity to volume spikes — Large prints can tilt VWAP abruptly; that behavior is intentional in VWAP-based logic.
Suggested starting profiles
• Intraday trend bias : Anchor=Day, N=25 (1→25), upper=18–20, lower=−8, paint candles ON.
• Swing bias : Anchor=Month, N=45 (1→45), upper=38–42, lower=−10, VWAP coloring ON, background OFF.
• Balanced reactivity : Anchor=Week, N=30 (1→30), upper=20–22, lower=−10…−12, symmetric if desired.
Implementation notes
• The indicator runs in a separate pane (oscillator), but VWAP itself is drawn on price using forced overlay so you can see interactions (touches, reclaim/loss).
• HLC3 is used for VWAP price; that’s a common choice to dampen wick noise while still reflecting intrabar range.
• For-loop cap is kept modest (≤50) for performance and clarity.
How to use this responsibly
Treat the oscillator as a bias and persistence meter . Combine it with your entry framework (structure breaks, liquidity zones, higher-timeframe context) and risk controls. The design emphasizes clarity over complexity—its edge is in how strictly it demands agreement before declaring a regime, not in predicting specific turns.
Summary
VWAP For Loop distills the question “How broadly is the anchored, volume-weighted trend advancing or retreating?” into a single, thresholded score you can read at a glance, alert on, and color through your chart. With careful anchoring and thresholds sized to your window length, it becomes a pragmatic bias filter for both systematic and discretionary workflows.
Smart BOS & FVG Signal IndicatorDescription:
This script is designed to help traders identify high-probability trade setups using a combination of Break of Structure (BOS) detection, Fair Value Gaps (FVGs), and an EMA retest filter.
How It Works
Break of Structure (BOS): The indicator automatically detects BOS events when price takes out previous highs/lows. Users can choose between strict or equal-high/low comparisons with the Comparison Mode setting.
Fair Value Gaps (FVGs): Highlighted zones show areas of imbalance in price. You can choose whether signals require the FVG to still be open.
EMA Retest Filter: A dynamic EMA check confirms whether price retests a moving average after BOS, helping filter out weaker setups.
Trade Signals
Green Arrows (Buy Signals): Trigger when a bullish BOS aligns with FVG and EMA retest conditions.
Red Arrows (Sell Signals): Trigger when a bearish BOS aligns with FVG and EMA retest conditions.
Key Features
Toggle “Require FVG Still Open at Signal” for stricter setups.
Adjust BOS Comparison Mode between standard and allowEqual for different market structures.
Clean visualization: arrows and highlights mark where valid trade opportunities occur.
How to Use
Apply the indicator to your chart.
Use BOS + FVG confluence to spot continuation or reversal opportunities.
Filter signals with the EMA retest option to reduce noise.
Best paired with strong risk management and confirmation from your overall strategy.
Range Percent Histogram📌 Range Percent Histogram – Indicator Description
The Range Percent Histogram is a custom indicator that behaves like a traditional volume histogram, but instead of showing traded volume it displays the percentage range of each candle.
In other words, the height of each bar represents how much the price moved (in percentage terms) within that candle, from its low to its high.
🔧 What it shows
The indicator has two main components:
Component Description
Histogram Bars Columns plotted in red or green depending on the candle direction (green = bullish candle, red = bearish). The height of each bar = (high - low) / low * 100. That means a candle that moved, for example, 1 % from its lowest point to its highest point will show a bar with 1 % height.
Moving Average (optional) A 20-period Simple Moving Average applied directly to the bar values. It can be turned ON/OFF via a checkbox and helps you detect whether current range activity is above or below the average range of the past candles.
⚙️ How it works
Every time a new candle closes, the indicator calculates its range and converts it into a percentage.
This value is drawn as a column under the chart.
If the closing price is above the opening price → the bar is green (bullish range).
If the closing price is below the opening price → the bar is red (bearish range).
When the Show Moving Average option is enabled, a smooth line is plotted on top of the histogram representing the average percentage range of the last 20 candles.
📈 How to use it
This indicator is very helpful for detecting moments of range expansion or contraction.
One powerful way to use it is similar to a volume exhaustion / low-volume pattern:
Situation Interpretation
Consecutive bars with very low height Price is in a period of low volatility → possible accumulation or "pause" phase.
A sudden large bar after a series of small ones Indicates a strong pickup in volatility → often marks the start of a new impulse in the direction of the breakout.
ICT Killzones + HTF FVG [JewlsTagara]This indicator plots the high and low (h/l) of every kill
zone period included with HTF FVG's.
Best use;
- 15m, 30m, 1hr, 4h FVG
- Adjust lunch to end at 1:30pm EST and NYPM 17:00 EST
Strategy:
- When price sweeps kill zone h/l into/in a HTF FVG
- Enter a 1 - 3m iFVG.
- Target 1:1 or 1:2 RR
note: you make use whatever entry model you like.
9 Sequential for Stock Screener9 Sequential for Stock Screener. Use this to forecast the buy/sell signal for your stocks. It can be integrated into the stock screener to scan the stocks in the market. green arrow means buy signal, red arrow means sell signal.
ICT Killzones + HTF FVG [JewlsTagara]This indicator plots the hits and lows of every kill
zone period included with HTF FVG's.
Best use;
- 15m, 30m, 1hr, 4h FVG
- Adjust lunch to end at 1:30pm EST and NYPM 17:00 EST
Strategy:
- When price sweeps kill zone h/l into a HTF FVG
- Enter a 1 - 3m iFVG.
note: you make user whatever entry model you like.
Trading Macro Windows by BW v2
Trading Macros by BW: Integrating ICT Concepts for Session Analysis
This indicator combines two key Inner Circle Trader (ICT) concepts—Change in State of Delivery (CISD) or Inverted Fair Value Gap (IFVG) signals with Macro Time Windows—to provide a unified tool for analyzing intraday price action, particularly during Pacific Time (PT) sessions. Rather than simply merging existing scripts, this integration creates a cohesive visual framework that highlights how macro consolidation periods interact with potential reversal or continuation signals like CISD or IFVG. By overlaying macro candle styling and borders on the chart alongside selectable signal lines, traders can better contextualize setups within ICT's macro narrative, where price often manipulates liquidity during these windows before displacing toward higher-timeframe objectives.
Core Components and How They Work Together:
Macro Time Windows (Inspired by ICT's Macro Periods):
ICT emphasizes "macro" as 30-minute windows (e.g., 06:45–07:15 PT, 07:45–08:15 PT, up to 11:45–12:15 PT) where price tends to consolidate, sweep liquidity, or form key structures like Fair Value Gaps (FVGs). These periods set the stage for the session's directional bias.
The indicator styles candles within these windows using a user-defined color for wicks, borders, and bodies (translucent for visibility). This visual emphasis helps traders focus on activity inside macros, where reversals or continuations often originate.
Borders are drawn as vertical lines at the start and end of each window (with a +5 minute buffer to capture related activity), using a dotted style by default. This creates a "study zone" that encapsulates macro events, allowing traders to assess if price is respecting or violating these zones in alignment with broader ICT models like the Power of 3 (AMD cycle).
Toggle: "Macro Candles Enabled" (default: true) – Turn off to disable styling and borders if focusing solely on signals.
CISD or IFVG Signals (Selectable Mode):
Mode Selection: Choose between "Change in the State of Delivery" (CISD) or "IFVG" (default: IFVG). Both detect shifts in market delivery during specific 30-minute slices (15–45 or 17–45 minutes past the hour in PT sessions).
CISD Mode: Based on ICT's definition of a sudden directional shift, this identifies aggressive displacements after sweeping recent highs/lows. It uses a rolling reference high/low over 6 bars, checks for sweeps (penetrating by at least 2 ticks in the last 2-3 bars), reclamation (closing beyond the reference with at least 50% body), and displacement (50% of prior range or an immediate FVG of 6+ ticks). Signals plot a horizontal line from the close, extending 24 bars right, labeled "CISD."
IFVG Mode: Focuses on Inverted Fair Value Gaps, where a bullish FVG (low > high by 13+ ticks) forms but is inverted (closed below) in the same slice, signaling bearish intent (or vice versa). This targets violations against opposing liquidity, often leading to raids on external ranges. Signals plot similarly, labeled "IFVG."
Shared Logic: Both modes enforce a 55-bar cooldown to prevent clustering, operate only during PT sessions (06:30–13:00), and use tick-based thresholds for precision across instruments. The integration with macros allows traders to see if signals occur within or at the edges of macro windows, enhancing confirmation—for example, a CISD inside a macro might indicate a manipulated reversal toward the session's true objective.
Toggle: "Signals Enabled" (default: true) – Turn off to hide all signal lines and labels, isolating the macro visualization.
How Components Interact:
Macro windows provide the "narrative context" (consolidation/manipulation), while CISD/IFVG signals detect the "delivery shift" (displacement). Together, they form a mashup that justifies publication: isolated signals can be noisy, but when filtered by macro periods, they align with ICT's session model. For instance, an IFVG inversion during a macro might confirm a liquidity sweep before targeting PD arrays or order blocks.
No external dependencies; all calculations are self-contained using Pine's built-in functions like ta.highest/lowest for references and time-based sessions for windows.
Usage Guidelines:
Apply to intraday charts (e.g., 1-5 min) or stocks during PT hours.
Look for confluence: A bull IFVG signal post-macro low sweep might target the next macro high or daily bias.
Customize colors/styles for signals (solid/dashed/dotted lines) and macros to suit your chart.
Backtest in replay mode to observe how macros frame signals—e.g., price often respects macro borders as S/R.
Limitations: Timezone-fixed to PT (America/Los_Angeles); signals are directional hints, not trade entries. Combine with ICT tools like order blocks or liquidity pools for full setups.
This script draws from community ICT implementations but refines them into a single, purpose-built tool for macro-driven trading, reducing chart clutter while emphasizing interconnected concepts. Feedback welcome!
Tamil own - MTF RSI Scanner 🚥so, if all RSI is green then total is 31
if all are red, it will be -31 Show.
if 31 then show with green bg
if -31 then show with red background
others just show the value.