Nth Candle by exp3rtsThis lightweight and versatile TradingView indicator highlights every Xth candle on your chart, making it easy to spot cyclical price behavior or track specific intervals in the market.
- Custom Interval – Choose how often candles should be highlighted (e.g., every 5th, 10th, or
20th bar).
- Color Coding – Highlighted candles are shaded green if bullish and red if bearish, giving you
quick visual insights into momentum at those intervals.
- Clean Overlay – The indicator draws directly on your main chart without clutter, so you can
combine it with your favorite setups and strategies.
Use this tool to:
1) Identify repeating patterns and cycles
2) Mark periodic reference candles
3) Support discretionary trading decisions with clear visual cues
Ciclos
Hour/Day/Month Optimizer [CHE] Hour/Day/Month Optimizer — Bucketed seasonality ranking for hours, weekdays, and months with additive or compounded returns, win rate, simple Sharpe proxy, and trade counts
Summary
This indicator profiles time-of-day, day-of-week, and month-of-year behavior by assigning every bar to a bucket and accumulating its return into that bucket. It reports per-bucket score (additive or compounded), win rate, a dispersion-aware return proxy, and trade counts, then ranks buckets and highlights the current one if it is best or worst. A compact on-chart table shows the top buckets or the full ranking; a last-bar label summarizes best and worst. Optional hour filtering and UTC shifting let you align buckets with your trading session rather than exchange time.
Motivation: Why this design?
Traders often see repetitive timing effects but struggle to separate genuine seasonality from noise. Static averages are easily distorted by sample size, compounding, or volatility spikes. The core idea here is simple, explicit bucket aggregation with user-controlled accumulation (sum or compound) and transparent quality metrics (win rate, a dispersion-aware proxy, and counts). The result is a practical, legible seasonality surface that can be used for scheduling and filtering rather than prediction.
What’s different vs. standard approaches?
Reference baseline: Simple heatmaps or average-return tables that ignore compounding, dispersion, or sample size.
Architecture differences:
Dual aggregation modes: additive sum of bar returns or compounded factor.
Per-bucket win rate and trade count to expose sample support.
A simple dispersion-aware return proxy to penalize unstable averages.
UTC offset and optional custom hour window.
Deterministic, closed-bar rendering via a lightweight on-chart table.
Practical effect: You see not only which buckets look strong but also whether the observation is supported by enough bars and whether stability is acceptable. The background tint and last-bar label give immediate context for the current bucket.
How it works (technical)
Each bar is assigned to a bucket based on the selected dimension (hour one to twenty-four, weekday one to seven, or month one to twelve) after applying the UTC shift. An optional hour filter can exclude bars outside a chosen window. For each bucket the script accumulates either the sum of simple returns or the compounded product of bar factors. It also counts bars and wins, where a win is any bar with a non-negative return. From these, it derives:
Score: additive total or compounded total minus the neutral baseline.
Win rate: wins as a percentage of bars in the bucket.
Dispersion-aware proxy (“Sharpe” column): a crude ratio that rises when average return improves and falls when variability increases.
Buckets are sorted by a user-selected key (score, win rate, dispersion proxy, or trade count). The current bar’s bucket is tinted if it matches the global best or worst. At the last bar, a table is drawn with headers, an optional info row, and either the top three or all rows, using zebra backgrounds and color-coding (lime for best, red for worst). Rendering is last-bar only; no higher-timeframe data is requested, and no future data is referenced.
Parameter Guide
UTC Offset (hours) — Shifts bucket assignment relative to exchange time. Default: zero. Tip: Align to your local or desk session.
Use Custom Hours — Enables a local session window. Default: off. Trade-off: Reduces noise outside your active hours but lowers sample size.
Start / End — Inclusive hour window one to twenty-four. Defaults: eight to seventeen. Tip: Widen if rankings look unstable.
Aggregation — “Additive” sums bar returns; “Multiplicative” compounds them. Default: Additive. Tip: Use compounded for long-horizon bias checks.
Dimension — Bucket by Hour, Day, or Month. Default: Hour. Tip: Start Hour for intraday planning; switch to Day or Month for scheduling.
Show — “Top Three” or “All”. Default: Top Three. Trade-off: Clarity vs. completeness.
Sort By — Score, Win Rate, Sharpe, or Trades. Default: Score. Tip: Use Trades to surface stable buckets; use Win Rate for skew awareness.
X / Y — Table anchor. Defaults: right / top. Tip: Move away from price clusters.
Text — Table text size. Default: normal.
Light Mode — Light palette for bright charts. Default: off.
Show Parameters Row — Info header with dimension and span. Default: on.
Highlight Current Bucket if Best/Worst — Background tint when current bucket matches extremes. Default: on.
Best/Worst Barcolor — Tint colors. Defaults: lime / red.
Mark Best/Worst on Last Bar — Summary label on the last bar. Default: on.
Reading & Interpretation
Score column: Higher suggests stronger cumulative behavior for the chosen aggregation. Compounded mode emphasizes persistence; additive mode treats all bars equally.
Win Rate: Stability signal; very high with very low trades is unreliable.
“Sharpe” column: A quick stability proxy; use it to down-rank buckets that look good on score but fluctuate heavily.
Trades: Sample size. Prefer buckets with adequate counts for your timeframe and asset.
Tinting: If the current bucket is globally best, expect a lime background; if worst, red. This is context, not a trade signal.
Practical Workflows & Combinations
Trend following: Use Hour or Day to avoid initiating trades during historically weak buckets; require structure confirmation such as higher highs and higher lows, plus a momentum or volatility filter.
Mean reversion: Prefer buckets with moderate scores but acceptable win rate and dispersion proxy; combine with deviation bands or volume normalization.
Exits/Stops: Tighten exits during historically weak buckets; relax slightly during strong ones, but keep absolute risk controls independent of the table.
Multi-asset/Multi-TF: Start with Hour on liquid intraday assets; for swing, use Day. On monthly seasonality, require larger lookbacks to avoid overfitting.
Behavior, Constraints & Performance
Repaint/confirmation: Calculations use completed bars only; table and label are drawn on the last bar and can update intrabar until close.
security()/HTF: None used; repaint risk limited to normal live-bar updates.
Resources: Arrays per dimension, light loops for metric building and sorting, `max_bars_back` two thousand, and capped label/table counts.
Known limits: Sensitive to sample size and regime shifts; ignores costs and slippage; bar-based wins can mislead on assets with frequent gaps; compounded mode can over-weight streaks.
Sensible Defaults & Quick Tuning
Start: Hour dimension, Additive, Top Three, Sort by Score, default session window off.
Too many flips: Switch to Sort by Trades or raise sample by widening hours or timeframe.
Too sluggish/over-smoothed: Switch to Additive (if on compounded) or shorten your chart timeframe while keeping the same dimension.
Overfit risk: Prefer “All” view to verify that top buckets are not isolated with tiny counts; use Day or Month only with long histories.
What this indicator is—and isn’t
This is a seasonality and scheduling layer that ranks time buckets using transparent arithmetic and simple stability checks. It is not a predictive model, not a complete trading system, and it does not manage risk. Use it to plan when to engage, then rely on structure, confirmation, and independent risk management for entries and exits.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Relative Strength (RS) By @Byte2Bull📈 Relative Strength (RS) By @Byte2Bull
📌 Overview
This indicator plots a Relative Strength (RS) line that compares the performance of the chart symbol to any benchmark symbol (index, ETF, or stock). By comparing the stock’s price movement to that of the benchmark, this tool highlights whether a stock is outperforming or underperforming the market.
RS value = (Price of symbol / Price of benchmark) × 100
It highlights hidden leaders and emerging strength through dynamic line plots, customizable moving average, and powerful new high detection features, enabling more informed trading decisions.
🛠 Key Features
⦿ Custom Benchmark Selection
Compare any stock with your chosen benchmark (default: NSE:NIFTYMIDSML400), such as NIFTY50, BANKNIFTY, or sector indices.
⦿ Relative Strength Line with Dynamic Coloring
Green when RS is above its moving average (strength/outperformance).
Red when RS is below its moving average (weakness/underperformance).
⦿ Configurable Moving Average
Apply either EMA or SMA over RS with customizable length. This helps smooth out volatility and provides a clear reference trend.
⦿ New High Detection
Marks when RS makes a new high.
Highlights when RS makes a new high before price does → a powerful early signal of hidden strength.
⦿ MA Crossover
Optional marker for when RS crosses above its moving average, signaling potential start of leadership.
⦿ Visual Enhancements
Adjustable line thickness.
Fill area between RS and its MA with green/red shading for quick interpretation.
Customizable colors for all key signals.
⦿ Built-in Alerts
Set alerts for:
RS New High
RS New High Before Price
Bullish MA Crossover
🎯 How to Use
⦿ Identify Market Leaders:
A stock with RS consistently above its MA is likely leading the market.
⦿ Spot Early Strength:
If RS makes a new high before the stock price, it may signal strong relative demand — often preceding breakouts.
⦿ Filter Weakness:
Stocks with RS below the MA are lagging and may be best avoided during bullish phases.
⦿ Combine with Price Action & Volume:
RS works best alongside price breakouts, trend analysis, and volume confirmations.
Auto Market Bias Dashboard |TG|Overview
The Auto Market Bias Dashboard is a Pine Script v5 indicator developed on the TradingView platform. This tool automatically calculates and visualizes the market bias for the selected asset (crypto, forex, or futures). By analyzing the market structure across different timeframes (Weekly, Daily, 4-Hour, 1-Hour), it identifies bullish, bearish, or neutral trends. Its main purpose is to provide traders with a quick summary to simplify the decision-making process. The indicator is optimized particularly for 1-hour and higher timeframes and issues warnings on lower timeframes.
How It Works?
The indicator uses a scoring system based on 7 fundamental questions for each timeframe. Each question evaluates market dynamics and assigns a score of +1 (bullish), -1 (bearish), or 0 (neutral):
Is the Trend in an Upward Direction? – The closing price is checked against the 20-period SMA.
Has the Previous Candle's High Been Breached? – For breakout analysis, the close is evaluated against the previous candle's high/low.
Was Respect Paid to PDA? (FVG/Sweep) – Market structure alignment is sought through Fair Value Gap (FVG) detection (calculated specifically for each TF).
Is Volume Increasing in the Direction of Price? – Volume is compared to its 20-period SMA and the candle direction (TF-specific).
Does the Correlated Asset Show the Same Bias? – Trend alignment is checked with the selected correlated asset (e.g., ES1!, MNQ1!, MES1!); neutral conditions are supported.
Market Structure – Reversal signals are sought through pivot high/low detection (high: bearish, low: bullish).
Has Volatility Increased? – ATR (14 periods) and its SMA (20 periods) are combined with the candle direction (TF-specific).
The total bias for each timeframe is calculated (/7). The overall bias combines the weekly score with double weighting ((Weekly × 2) + Daily + 4H + 1H = /28). Results:
Positive (>0): Bullish (Green) – Buying opportunity.
Negative (<0): Bearish (Red) – Selling opportunity.
Zero: Neutral (Silver) – Indecisive.
Auto Fibonacci Retracements with Alerts [SwissAlgo]AUTO-FIBONACCI RETRACEMENT: LEVELS, ALERTS & PD ZONES
Automatically maps Fibonacci retracement levels with Premium/Discount (PD) zones and configurable alerts for technical analysis study.
------------------------------------------------------------------
FEATURES
Automatic Fibonacci Levels Detection
Identifies swing extremes (reference high and low to map retracements) from a user-defined trend start date and trend indication automatically
Calculates 20 Fibonacci levels (from -2.618 to +2.618) automatically
Dynamically updates Fib levels as price action develops, anchoring the bottom (in case of uptrends) or the top (in case of downtrends)
Detects potential Trend's Change of Character automatically
Premium/Discount (PD) zone visualization based on trend and price extremes
Visual Components
Dotted horizontal lines for each Fibonacci level
'Premium' and 'discount' zone highlighting
Change of Character (CHoCH) marker when a trend anchor breaks (a bottom is broken after an uptrend, a top is broken after a downtrend)
Adaptive label colors for light/dark chart themes
Alert System
Configurable alerts for all Fibonacci levels
Requires 2 consecutive bar closes for confirmation (reduces false signals)
CHoCH alert when a locked extreme is broken
Set up using "Any alert() function call" option
------------------------------------------------------------------
USE CASES
Two Primary Use Cases:
1. PROSPECTIVE TREND MAPPING (Real-Time Tracking)
Set start date at or just before an anticipated swing extreme to track levels as the trend develops:
For Uptrend : Place start date near a bottom. The bottom level locks after consolidation, while the top updates in real-time as the price climbs higher
For Downtrend : Place start date near a top. The top-level locks after consolidation, while the bottom updates in real-time as the price falls lower
This mode tracks developing price action against Fibonacci levels as the swing unfolds.
2. RETROSPECTIVE ANALYSIS (Historical Swing Study)
Set the start date at a completed swing extreme to analyze how the price interacted (and is interacting) with the Fibonacci levels:
Both high and low are already established in the historical data
Levels remain static for analysis purposes
Useful for analyzing price behavior relative to Fibonacci levels, studying retracement dynamics, and assessing a trading posture
------------------------------------------------------------------
HOW TO USE
Set 'Start Date' : Select Start Date (anchor point) at or just before the swing extreme (bottom for uptrend, top for downtrend)
Choose Trend Direction (Up or Down): direction is known for retrospective analysis, uncertain for prospective analysis
Update the start date when significant structure breaks occur to begin analyzing a new swing cycle.
Configure alerts as needed for your analysis
------------------------------------------------------------------
TECHNICAL DETAILS
♦ Auto-Mapped Fibonacci Retracement Levels:
2.618, 2.000, 1.618, 1.414, 1.272, 1.000, 0.882, 0.786, 0.618, 0.500, 0.382, 0.236, 0.118, 0.000, -0.272, -0.618, -1.000, -1.618, -2.000, -2.618
♦ Premium/Discount (PD) Zones:
Uptrend: Green (discount zone) = levels 0 to 0.5 | Red (premium zone) = levels 0.5 to 1.0
Downtrend: Red (premium zone) = levels 0 to 0.5 | Green (discount zone) = levels 0.5 to 1.0
The yellow line represents the 0.5 equilibrium level
♦ Lock Mechanism:
The indicator monitors for new extremes to detect a Change of Character in the trend (providing visual feedback and alerts). It locks the anchor swing extreme after a timeframe-appropriate consolidation period has elapsed (varies from 200 bars on second charts to 1 bar on monthly charts) to detect such potentially critical events.
------------------------------------------------------------------
IMPORTANT NOTES
This is an educational tool for technical analysis study. It displays historical and current price relationships to Fibonacci levels but does not predict future price movements or provide trading recommendations.
DISCLAIMER: This indicator is for educational and informational purposes only. It does not constitute financial advice or trading signals. Past price patterns do not guarantee future results. Trading involves substantial risk of loss. Always conduct your own analysis and consult with qualified financial professionals before making trading decisions. By using this indicator, you acknowledge and agree to these limitations.
90min + Daily + Weekly Cycles + Alerts [Final]Quarterly theory indicator
Customizable indicator 90m cycles, daily, and weekly
IKIGAI ZigZags//@version=6
indicator("IKIGAI ZigZags", overlay = true, max_lines_count = 500, max_labels_count = 500)
import TradingView/ZigZag/7 as ZigZagLib
deviationInput = input.float(5.0, "Price deviation for reversals (%)", 0.00001, 100.0, 0.5, "0.00001 - 100"),
depthInput = input.int(10, "Pivot legs", 2),
lineColorInput = input(#2962FF, "Line color", display = display.data_window),
extendInput = input(true, "Extend to last bar", display = display.data_window),
showPriceInput = input(true, "Display reversal price", display = display.data_window),
showVolInput = input(true, "Display cumulative volume", display = display.data_window),
showChgInput = input(true, "Display reversal price change", inline = "priceRev", display = display.data_window),
priceDiffInput = input.string("Absolute", "", , inline = "priceRev", display = display.data_window, active = showChgInput)
// Create Zig Zag instance from user settings.
var zigZag = ZigZagLib.newInstance(
ZigZagLib.Settings.new(
deviationInput, depthInput, lineColorInput, extendInput, showPriceInput, showVolInput, showChgInput,
priceDiffInput, true)
)
// Update 'zigZag' object on each bar with new pivots, volume, lines, labels.
zigZag.update()
8 SMA Bands (Points)The "8 SMA Bands (Points)" indicator creates a set of eight Simple Moving Average (SMA) bands with adjustable offsets, overlaid on a price chart.
Here’s a breakdown:
Purpose: It tracks price trends using multiple SMAs of varying lengths (default 25, 50, 100, 200, 400, 800, 1600 periods) and adds upper and lower bands around each SMA based on point offsets, helping identify potential support, resistance, and trend strength.
Key Components:
SMAs: Eight SMAs are calculated using closing prices with lengths ranging from 25 to 1600 periods. Each SMA is plotted with a distinct color and line thickness (e.g., MA 1 is blue, MA 8 is white with thicker lines).
Bands: For each SMA, upper and lower bands are created by adding or subtracting a point-based offset (suggestions are to use default Murray Math based numbers e.g., 0.305176 for MA 1, 39.062528 for MA 8) multiplied by a global multiplier (default 1.0). These offsets define the band width and are customizable.
Customization: Users can adjust SMA lengths, offset points, colors, and the global multiplier via input settings grouped by each MA.
Visuals: SMAs are plotted as solid lines with increasing thickness for longer periods (e.g., MA 6–8 use thicker lines or circles).
Bands are plotted as semi-transparent lines matching the SMA color, with longer-term bands (MA 6–7) using a different style for emphasis.
Usage: The indicator helps traders visualize trend direction (upward if price is above most SMAs, downward if below) and potential reversal zones where price interacts with band boundaries.
The flattening or crossing of bands can signal momentum shifts. The coming together of multiple envelope tops/bottoms can signal reversal zones of various degrees based on how many envelopes come together. More envelopes converging mean a more significant top or bottom.
This indicator is particularly useful for identifying multi-timeframe trends and volatility zones on assets like Gold Futures, with flexibility to fine-tune based on market conditions.
Balance of Risks (with Strength & Scale)This helps outline higher time frame tilt, to help assess probabilities
SuperTrend Optimizer Remastered[CHE] SuperTrend Optimizer Remastered — Grid-ranked SuperTrend with additive or multiplicative scoring
Summary
This indicator evaluates a fixed grid of one hundred and two SuperTrend parameter pairs and ranks them by a simple flip-to-flip return model. It auto-selects the currently best-scoring combination and renders its SuperTrend in real time, with optional gradient coloring for faster visual parsing. The original concept is by KioseffTrading Thanks a lot for it.
For years I wanted to shorten the roughly two thousand three hundred seventy-one lines; I have now reduced the core to about three hundred eighty lines without triggering script errors. The simplification is generalizable to other indicators. A multiplicative return mode was added alongside the existing additive aggregation, enabling different rankings and often more realistic compounding behavior.
Motivation: Why this design?
SuperTrend is sensitive to its factor and period. Picking a single pair statically can underperform across regimes. This design sweeps a compact parameter grid around user-defined lower bounds, measures flip-to-flip outcomes, and promotes the combination with the strongest cumulative return. The approach keeps the visual footprint familiar while removing manual trial-and-error. The multiplicative mode captures compounding effects; the additive mode remains available for linear aggregation.
Originally (by KioseffTrading)
Very long script (~2,371 lines), monolithic structure.
SuperTrend optimization with additive (cumulative percentage-sum) scoring only.
Heavier use of repetitive code; limited modularity and fewer UI conveniences.
No explicit multiplicative compounding option; rankings did not reflect sequence-sensitive equity growth.
Now (remastered by CHE)
Compact core (~380 lines) with the same functional intent, no compile errors.
Adds multiplicative (compounding) scoring alongside additive, changing rankings to reflect real equity paths and penalize drawdown sequences.
Fixed 34×3 grid sweep, live ranking, gradient-based bar/wick/line visuals, top-table display, and an optional override plot.
Cleaner arrays/state handling, last-bar table updates, and reusable simplification pattern that can be applied to other indicators.
What’s different vs. standard approaches?
Baseline: A single SuperTrend with hand-picked inputs.
Architecture differences:
Fixed grid of thirty-four factor offsets across three ATR offsets.
Per-combination flip-to-flip backtest with additive or multiplicative aggregation.
Live ranking with optional “Best” or “Worst” table output.
Gradient bar, wick, and line coloring driven by consecutive trend counts.
Optional override plot to force a specific SuperTrend independent of ranking.
Practical effect: Charts show the currently best-scoring SuperTrend, not a static choice, plus an on-chart table of top performers for transparency.
How it works (technical)
For each parameter pair, the script computes SuperTrend value and direction. It monitors direction transitions and treats a change from up to down as a long entry and the reverse as an exit, measuring the move between entry and exit using close prices. Results are aggregated per pair either by summing percentage changes or by compounding return factors and then converting to percent for comparison. On the last bar, open trades are included as unrealized contributions to ranking. The best combination’s line is plotted, with separate styling for up and down regimes. Consecutive regime counts are normalized within a rolling window and mapped to gradients for bars, wicks, and lines. A two-column table reports the best or worst performers, with an optional row describing the parameter sweep.
Parameter Guide
Factor (Lower Bound) — Starting SuperTrend factor; the grid adds offsets between zero and three point three. Default three point zero. Higher raises distance to price and reduces flips.
ATR Period (Lower Bound) — Starting ATR length; the grid adds zero, one, and two. Default ten. Longer reduces noise at the cost of responsiveness.
Best vs Worst — Ranks by top or bottom cumulative return. Default Best. Use Worst for stress tests.
Calculation Mode — Additive sums percents; Multiplicative compounds returns. Multiplicative is closer to equity growth and can change the leaderboard.
Show in Table — “Top Three” or “All”. Fewer rows keep charts clean.
Show “Parameters Tested” Label — Displays the effective sweep ranges for auditability.
Plot Override SuperTrend — If enabled, the override factor and ATR are plotted instead of the ranked winner.
Override Factor / ATR Period — Values used when override is on.
Light Mode (for Table) — Adjusts table colors for bright charts.
Gradient/Coloring controls — Toggles for gradient bars and wick coloring, window length for normalization, gamma for contrast, and transparency settings. Use these to emphasize or tone down visual intensity.
Table Position and Text Size — Places the table and sets typography.
Reading & Interpretation
The auto SuperTrend plots one line for up regimes and one for down regimes. Color intensity reflects consecutive trend persistence within the chosen window. A small square at the bottom encodes the same gradient as a compact status channel. Optional wick coloring uses the same gradient for maximum contrast. The performance table lists parameter pairs and their cumulative return under the chosen aggregation; positive values are tinted with the up color, negative with the down color. “Long” labels mark flips that open a long in the simplified model.
Practical Workflows & Combinations
Trend following: Use the auto line as your primary bias. Enter on flips aligned with structure such as higher highs and higher lows. Filter with higher-timeframe trend or volatility contraction.
Exits/Stops: Consider conservative exits when color intensity fades or when the opposite line is approached. Aggressive traders can trail near the plotted line.
Override mode: When you want stability across instruments, enable override and standardize factor and ATR; keep the table visible for sanity checks.
Multi-asset/Multi-TF: Defaults travel well on liquid instruments and intraday to daily timeframes. Heavier assets may prefer larger lower bounds or multiplicative mode.
Behavior, Constraints & Performance
Repaint/confirmation: Signals are based on SuperTrend direction; confirmation is best assessed on closed bars to avoid mid-bar oscillation. No higher-timeframe requests are used.
Resources: One hundred and two SuperTrend evaluations per bar, arrays for state, and a last-bar table render. This is efficient for the grid size but avoid stacking many instances.
Known limits: The flip model ignores costs, slippage, and short exposure. Rapid whipsaws can degrade both aggregation modes. Gradients are cosmetic and do not change logic.
Sensible Defaults & Quick Tuning
Start with the provided lower bounds and “Top Three” table.
Too many flips → raise the lower bound factor or period.
Too sluggish → lower the bounds or switch to additive mode.
Rankings feel unstable → prefer multiplicative mode and extend the normalization window.
Visuals too strong → increase gradient transparency or disable wick coloring.
What this indicator is—and isn’t
This is a parameter-sweep and visualization layer for SuperTrend selection. It is not a complete trading system, not predictive, and does not include position sizing, transaction costs, or risk management. Combine with market structure, higher-timeframe context, and explicit risk controls.
Attribution and refactor note: The original work is by KioseffTrading. The script has been refactored from approximately two thousand three hundred seventy-one lines to about three hundred eighty core lines, retaining behavior without compiler errors. The general simplification pattern is reusable for other indicators.
Metadata
Name/Tag: SuperTrend Optimizer Remastered
Pine version: v6
Overlay or separate pane: true (overlay)
Core idea/principle: Grid-based SuperTrend selection by cumulative flip returns with additive or multiplicative aggregation.
Primary outputs/signals: Auto-selected SuperTrend up and down lines, optional override lines, gradient bar and wick colors, “Long” labels, performance table.
Inputs with defaults: See Parameter Guide above.
Metrics/functions used: SuperTrend, ATR, arrays, barstate checks, windowed normalization, gamma-based contrast adjustment, table API, gradient utilities.
Special techniques: Fixed grid sweep, compounding vs linear aggregation, last-bar UI updates, gradient encoding of persistence.
Performance/constraints: One hundred and two SuperTrend calls, arrays of length one hundred and two, label budget, last-bar table updates, no higher-timeframe requests.
Recommended use-cases/workflows: Trend bias selection, quick parameter audits, override standardization across assets.
Compatibility/assets/timeframes: Standard OHLC charts across intraday to daily; liquid instruments recommended.
Limitations/risks: Costs and slippage omitted; mid-bar instability possible; not suitable for synthetic chart types.
Debug/diagnostics: Ranking table, optional tested-range label; internal counters for consecutive trends.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Total Points Moved by exp3rtsThis lightweight utility tracks the total intraday range of price movement, giving you real-time insight into market activity.
It calculates:
🟩 Bullish Points – Total range from bullish candles (close > open)
🟥 Bearish Points – Total range from bearish candles (close < open)
🔁 Total Points Moved (TPM) – Sum of all high–low ranges for the day
Values are pulled from the 1-second chart for high precision and displayed in a compact tag in the top-right corner.
Wolfhis code is a Range Filter with entry signals.
How it works:
It calculates the average candle range (the difference between the price and its previous value) using EMA.
Based on this range, it builds a filter — a “smoothed line” (central level) along with upper and lower bands.
If the price moves above the filter → uptrend (green zone). If it moves below → downtrend (red zone).
Trade conditions:
longCondition (buy): price is above the filter and the filter has turned upward.
shortCondition (sell): price is below the filter and the filter has turned downward.
On the chart it displays:
the filter (line),
upper/lower bands,
colored candles (if enabled),
BUY/SELL labels and alerts.
In simple terms: it’s an indicator that filters out market noise and shows when the price changes trend direction, giving entry signals.
MTF EMA200 Dashboard (No Trend Column)Show ema200 position on multiple timeframe, so that in run time we can see price strength and weekness
Enhanced Std Dev Oscillator (Z-Score)Enhanced Std Dev Oscillator (Z-Score)
Overview
The Enhanced Std Dev Oscillator (ESDO) is a refined Z-Score indicator that normalizes price deviations from a moving mean using standard deviation, smoothed for clarity and equipped with divergence detection. This oscillator shines in identifying extreme overbought/oversold conditions and potential reversals, making it ideal for mean-reversion strategies in stocks, forex, or crypto. By highlighting when prices stray too far from the norm, it helps traders avoid chasing trends and focus on high-probability pullbacks.
Key Features
Customisable Mean & Deviation: Choose SMA or EMA for the mean (default: SMA, length 14); opt for Population or Sample standard deviation for precise statistical accuracy.
Smoothing for Clarity: Apply a simple moving average (default: 3) to the raw Z-Score, reducing noise without lagging signals excessively.
Zone Highlighting: Background colours flag extreme zones—red tint above +2 (overbought), green below -2 (oversold)—for quick visual scans.
Divergence Alerts: Automatically detects bullish (price lows lower, Z-Score higher) and bearish (price highs higher, Z-Score lower) divergences using pivot points (default length: 5), with labeled shapes for easy spotting.
Built-in Alerts: Notifications for Z-Score crossovers into OB/OS zones and divergence events to keep you informed without constant monitoring.
How It Works
Core Calculation: Computes the mean (SMA/EMA) over the specified length, then standard deviation (Population or adjusted Sample formula for N>1). Z-Score = (Source - Mean) / Std Dev, handling edge cases like zero deviation.
Smoothing: Averages the Z-Score with an SMA to create a cleaner plot oscillating around zero.
Levels & Zones: Plots horizontal lines at ±1 (orange dotted) and ±2 (red dashed) for reference; backgrounds activate in extreme zones.
Divergence Logic: Scans for pivot highs/lows in price and Z-Score; flags divergences when price extremes diverge from oscillator extremes (looking back 2 pivots for confirmation).
Visualisation: Blue line for the smoothed Z-Score; green/red labels for bull/bear divergences.
Usage Tips
Buy Signal: Z-Score crosses below -2 (oversold) or bullish divergence forms—pair with volume spike for confirmation.
Sell Signal: Z-Score crosses above +2 (overbought) or bearish divergence—watch for resistance alignment.
Customisation: Use EMA mean for trendier assets; enable Sample std dev for smaller datasets. Increase pivot length (7-10) in volatile markets to filter false signals.
Timeframes: Excels on daily/4H for swing trades; test smoothing on lower frames to avoid over-smoothing. Always combine with trend filters like a 200-period MA.
This open-source script is licensed under Mozilla Public License 2.0. Backtest thoroughly—past performance isn't indicative of future results. Trade with discipline! 📈
© HighlanderOne
Advanced Directional Stoch RSIAdvanced Directional Stochastic RSI
Overview
The Advanced Directional Stochastic RSI (Adv Stoch RSI Dir) is a powerful oscillator that combines the classic Stochastic RSI with John Ehlers' SuperSmoother filter for ultra-smooth signals and reduced noise. Unlike traditional Stoch RSI, this indicator incorporates directional coloring based on price action relative to a smoothed trend line, helping traders quickly spot bullish or bearish momentum. It's designed for swing traders and scalpers looking for clearer overbought/oversold conditions in volatile markets.
Key Features
Directional Coloring: %K line turns green when price is above the trend MA (bullish) and red when below (bearish), providing instant visual bias.
Multi-Pass SuperSmoothing: Apply Ehlers' SuperSmoother filter up to 5 times for customizable noise reduction—dial in passes (default: 2) to balance responsiveness and smoothness.
Trend-Aware Baseline: Uses a cascaded smoothed moving average (default length: 20) to gauge overall direction, making the oscillator more context-aware.
Classic Stoch RSI Core: Built on RSI (default: 14) and Stochastic (default: 14), with SMA smoothing for %K (3) and %D (3).
Visual Aids: Includes overbought (80), oversold (20), and midline (50) levels, plus a subtle blue fill between OB/OS zones for easy reference.
How It Works
Source Smoothing: The input source (default: close) is passed through the SuperSmoother filter multiple times to create a trend MA.
Stoch RSI Calculation: Computes RSI on the source, then applies Stochastic to the RSI values, followed by SMA smoothing for base %K and %D.
Advanced Smoothing: Extra SuperSmoother layers are applied to %K and %D based on your chosen passes, minimizing whipsaws.
Directional Logic: Compares current close to the trend MA to color %K dynamically.
Plotting: %K (thick line, colored) and %D (thin orange) oscillate between 0-100, highlighting crossovers and divergences.
Usage Tips
Buy Signal: Green %K crosses above %D below 50, or bounces off oversold (20) in uptrends.
Sell Signal: Red %K crosses below %D above 50, or rejects overbought (80) in downtrends.
Customization: Increase smoothing passes (3-5) for choppy markets; reduce for faster signals. Pair with volume or support/resistance for confirmation.
Timeframes: Best on 1H-4H charts for stocks/crypto; adjust lengths for forex.
This open-source script is licensed under Mozilla Public License 2.0. Backtest thoroughly—past performance isn't indicative of future results. Enjoy trading smarter with less noise! 🚀
© HighlanderOne
Stage 2 BasesStage 2 Bases
What is a Stage 2 Base?
Stage 2 = Advancing Phase in Stock price cycle.
Stocks in Stage 2 are in uptrend (50 > 150 > 200-day moving averages).
A pause (consolidation) in an ongoing uptrend.
Price moves sideways for weeks to months after an advance.
Builds energy for the next leg up and allows accumulation.
Strong prior uptrend before the base.
Base length typically 4+ weeks.
Base depth generally 10–40% pullback.
Volume contracts during consolidation.
Breakout occurs above prior highs on strong volume.
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Why They Matter?
Institutions accumulate shares during the base.
Resets overbought conditions without breaking the trend.
Valid breakout often leads to next strong rally.
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
How to read this indicator?
Complete Stage 2 bases in Daily Timeframe
Complete Stage 2 bases in Weekly Timeframe
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Key Characteristics
Works on Daily and Weekly Timeframes
Past Stage 2 Bases are marked as well
Base Counts, Depth, Consolidation Range, Move from one base to another and No of days/weeks move are marked
Base 1 are marked when a stock is coming out of Stage 1 (After Golden cross 50SMA > 200 SMA)
Base count is increased when a move from base is more than 20% (Can be modified in Indicator settings)
Base resets to 1 when the base undercuts the previous base
Base markings are stopped when the 200 SMA > 50 SMA
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Indicator Settings
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Limitations
Base markings are stopped when the 200 SMA > 50 SMA but if a stock doesn't go down beyond 40% and the Price action is good within the base then its good to keep the stock in watchlist. This scenario is not handled.
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Disclaimer
This indicator is created purely for educational and informational purposes. It is not a buy or sell recommendation , nor should it be considered financial advice. Trading and investing in the stock market involves risk, and you should do your own research or consult with a qualified financial advisor before making any investment decisions. The creator of this indicator is not responsible for any losses incurred by using this tool.
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
Daily Midnight Lines# Daily Midnight Lines
A simple and efficient TradingView indicator that automatically draws vertical lines at the start of each new day.
* *
## Features
✅ **Precise Timing**: Draws lines at exactly 00:00 or on the first bar of the new day
✅ **Calendar Days**: Uses calendar days, not trading sessions
✅ **Customizable Design**: Green color with transparency for comfortable viewing
✅ **High Performance**: Optimized code without unnecessary calculations
✅ **Universal**: Works on all timeframes and instruments
## Settings
- **Line Color**: Green with 30% transparency (customizable)
- **Line Width**: 1 pixel (1 to 3)
- **Mode**: Exactly at 00:00 or first bar of new day
## Applications
- Separating trading days on the chart
- Analyzing price behavior at the start of the day
- Planning trading strategies
- Statistical analysis by days
## Compatibility
- Pine Script v6
- All timeframes (1m - 1M)
- All instruments (stocks, forex, crypto, futures)
- All markets (24/7, daily, night sessions)
Perfect for day traders, scalpers, and analysts who want better chart orientation and intraday pattern analysis.
---
## Ежедневные Полночные Линии
Простой и эффективный индикатор TradingView, который автоматически рисует вертикальные линии в начале каждого нового дня.
## Особенности
✅ **Точное время**: Рисует линии в 00:00 или на первом баре нового дня
✅ **Календарные дни**: Использует календарные дни, а не торговые сессии
✅ **Настраиваемый дизайн**: Зеленый цвет с прозрачностью для комфортного просмотра
✅ **Высокая производительность**: Оптимизированный код без лишних вычислений
✅ **Универсальность**: Работает на всех таймфреймах и инструментах
## Настройки
- **Цвет линий**: Зеленый с прозрачностью 30% (настраивается)
- **Толщина линий**: 1 пиксель (от 1 до 3)
- **Режим**: Точно в 00:00 или первый бар нового дня
## Применение
- Разделение торговых дней на графике
- Анализ поведения цены в начале дня
- Планирование торговых стратегий
- Статистический анализ по дням
## Совместимость
- Pine Script v6
- Все таймфреймы (1м - 1М)
- Все инструменты (акции, форекс, крипто, фьючерсы)
- Все рынки (24/7, дневные, ночные сессии)
Идеально подходит для дневных трейдеров, скальперов и аналитиков, которые хотят лучше ориентироваться на графике и анализировать внутридневные паттерны.
**Pine Script v6** | **Updated: October 2024** | **Обновлено: Октябрь 2024**
Monday Range LinesMarks high and lows of the Monday for the full week. Amount of weeks and color can be adjusted.
VX1! vs VX2! ComparatorCompare VX1 and VX2
Sofern VX1 größer als VX2 wird, wechselt der Ausgabewert auf 1
Quarterly Theory Cycles + Alerts (Weekly/Daily/90-Minute Cycles)Quarterly Theory Cycles (90m • Daily • Weekly)
Purpose
Built for Quarterly Theory. This indicator maps repeating quarters across three rhythms—90-minute, Daily, and Weekly (18:00 NY → 18:00 NY)—so you can track where price is within the current quarter and how it reacts to the previous quarter’s high/low.
Quarter Structure
90-Minute Quarters
Labels:Q1 / Q2 / Q3 / Q4
Sessions: Asia, London, NY, PM (each split into four 90-minute quarters).
Daily Quarters
Labels: [D-Q1 / D-Q2 / D-Q3 / D-Q4
Windows (America/New_York):
D-Q1: 18:00–00:00
D-Q2: 00:00–06:00
D-Q3: 06:00–12:00
D-Q4: 12:00–18:00
Weekly Quarters
Labels: W-Q1 / W-Q2 / W-Q3 / W-Q4
Trading days defined 18:00 NY → 18:00 NY (DST-aware).
W-Q1 = Monday, W-Q2 = Tuesday, W-Q3 = Wednesday, W-Q4 = Thursday
Friday intentionally excluded (no W-Q5) to preserve theory behavior.
Use for higher-timeframe context and weekly narrative (e.g., expansion vs. distribution days).
What It Draws
Live, extending range boxes for the active quarter (H/L updates in real time).
Stored previous quarter’s high/low for each rhythm (90m, Daily, Weekly).
Alerts (Quarterly Theory-friendly )
Fires when price first breaks the previous quarter’s high/low:
90m: “Previous 90min cycle (…) high/low broken”
Daily: “Previous daily cycle (…) high/low broken”
Weekly: “Previous weekly cycle (…) high/low broken”
One alert per side per new quarter—clean signals for liquidity grabs or SSMTs.
Customization
Master Toggles: Show/hide Asia, London, NY, PM, Daily, Weekly blocks fast.
Independent Transparencies: Separate opacity sliders for 90m vs Daily vs Weekly.
Per-Quarter Controls: Toggle range, edit label (defaults already set to Q1 / D-Q1 / W-Q1 formats), and color.
Styling: Optional outlines and labels for minimal or annotated charts.
Time Zones: Use exchange time or a custom UTC offset for session windows. Weekly boundaries always use America/New_York at 18:00.
Notes
Designed for theory workflows: prior-quarter liquidity, session rotation, and narrative alignment, SSMTS.
Friday is excluded from Weekly quarters by design.
Indicator draws ranges and triggers alerts; it does not place trades.
kiss and flay strategyfor more details contact us on telegram , this is trend following strategy , you can trade in 3&5 min time frame in all segments
SANGAM ENTRYThis setup is highly effective in helping traders catch entries before a major move begins. When all the LINES converge and merge together, it signals an opportunity to take buy or sell entries with low risk and high reward. It serves as one of the best confirmations for both trend continuation and breakout trades. Many traders can benefit from this approach, as it is absolutely simple, practical, and easy to manage when planning their entries.