PriorHourRangeLevels_v0.1PriorHourRangeLevels_v0.1
Created by dc_77 | © 2025 | Mozilla Public License 2.0
Overview
"PriorHourRangeLevels_v0.1" is a versatile Pine Script™ indicator designed to help traders visualize and analyze price levels based on the prior hour’s range. It overlays key levels—High, Low, 75%, 50% (EQ), and 25%—from the previous hour onto the current price chart, alongside the current hour’s opening price. With customizable display options and time zone support, it’s ideal for intraday traders looking to identify support, resistance, and breakout zones.
How It Works
Hourly Reset: The indicator detects the start of each hour based on your chosen time zone (e.g., "America/New_York" by default).
Prior Hour Range: It calculates the High and Low of the previous hour, then derives three additional levels:
75%: 75% of the range above the Low.
EQ (50%): The midpoint of the range.
25%: 25% of the range above the Low.
Current Hour Open: Displays the opening price of the current hour.
Projection: Lines extend forward (default: 24 bars) to project these levels into the future, aiding in real-time analysis.
Alerts: Triggers alerts when the price crosses any of the prior hour’s levels (High, 75%, EQ, 25%, Low).
Key Features
Time Zone Flexibility: Choose from options like UTC, New York, Tokyo, or London to align with your trading session.
Visual Customization:
Toggle visibility for each level (High, Low, 75%, EQ, 25%, Open, and Anchor).
Adjust line styles (Solid, Dashed, Dotted), colors, and widths.
Show or hide labels with adjustable sizes (Tiny, Small, Normal, Large).
Anchor Line: A vertical line marks the start of the prior hour, with optional labeling.
Alert Conditions: Set up notifications for price crossings to catch key moments without watching the chart.
Usage Tips
Use the High and Low as potential breakout levels, while 75%, EQ, and 25% act as intermediate support/resistance zones.
Trend Confirmation: Watch how price interacts with the EQ (50%) level to gauge momentum.
Session Planning: Adjust the time zone to match your market (e.g., "Europe/London" for FTSE trading).
Projection Offset: Extend or shorten the lines (via "Projection Offset") based on your chart timeframe.
Inputs
Time Zone: Select your preferred market time zone.
Anchor Settings: Show/hide the prior hour start line, style, color, width, and label.
Level Settings: Customize visibility, style, color, width, and labels for Open, High, 75%, EQ, 25%, and Low.
Display: Set projection length and label size.
Bänder und Kanäle
Multi-Anchored Linear Regression Channels [TANHEF]█ Overview:
The 'Multi-Anchored Linear Regression Channels ' plots multiple dynamic regression channels (or bands) with unique selectable calculation types for both regression and deviation. It leverages a variety of techniques, customizable anchor sources to determine regression lengths, and user-defined criteria to highlight potential opportunities.
Before getting started, it's worth exploring all sections, but make sure to review the Setup & Configuration section in particular. It covers key parameters like anchor type, regression length, bias, and signal criteria—essential for aligning the tool with your trading strategy.
█ Key Features:
⯁ Multi-Regression Capability:
Plot up to three distinct regression channels and/or bands simultaneously, each with customizable anchor types to define their length.
⯁ Regression & Deviation Methods:
Regressions Types:
Standard: Uses ordinary least squares to compute a simple linear trend by averaging the data and deriving a slope and endpoints over the lookback period.
Ridge: Introduces L2 regularization to stabilize the slope by penalizing large coefficients, which helps mitigate multicollinearity in the data.
Lasso: Uses L1 regularization through soft-thresholding to shrink less important coefficients, yielding a simpler model that highlights key trends.
Elastic Net: Combines L1 and L2 penalties to balance coefficient shrinkage and selection, producing a robust weighted slope that handles redundant predictors.
Huber: Implements the Huber loss with iteratively reweighted least squares (IRLS) and EMA-style weights to reduce the impact of outliers while estimating the slope.
Least Absolute Deviations (LAD): Reduces absolute errors using iteratively reweighted least squares (IRLS), yielding a slope less sensitive to outliers than squared-error methods.
Bayesian Linear: Merges prior beliefs with weighted data through Bayesian updating, balancing the prior slope with data evidence to derive a probabilistic trend.
Deviation Types:
Regressive Linear (Reverse): In reverse order (recent to oldest), compute weighted squared differences between the data and a line defined by a starting value and slope.
Progressive Linear (Forward): In forward order (oldest to recent), compute weighted squared differences between the data and a line defined by a starting value and slope.
Balanced Linear: In forward order (oldest to newest), compute regression, then pair to source data in reverse order (newest to oldest) to compute weighted squared differences.
Mean Absolute: Compute weighted absolute differences between each data point and its regression line value, then aggregate them to yield an average deviation.
Median Absolute: Determine the weighted median of the absolute differences between each data point and its regression line value to capture the central tendency of deviations.
Percent: Compute deviation as a percentage of a base value by multiplying that base by the specified percentage, yielding symmetric positive and negative deviations.
Fitted: Compare a regression line with high and low series values by computing weighted differences to determine the maximum upward and downward deviations.
Average True Range: Iteratively compute the weighted average of absolute differences between the data and its regression line to yield an ATR-style deviation measure.
Bias:
Bias: Applies EMA or inverse-EMA style weighting to both Regression and/or Deviation, emphasizing either recent or older data.
⯁ Customizable Regression Length via Anchors:
Anchor Types:
Fixed: Length.
Bar-Based: Bar Highest/Lowest, Volume Highest/Lowest, Spread Highest/Lowest.
Correlation: R Zero, R Highest, R Lowest, R Absolute.
Slope: Slope Zero, Slope Highest, Slope Lowest, Slope Absolute.
Indicator-Based: Indicators Highest/Lowest (ADX, ATR, BBW, CCI, MACD, RSI, Stoch).
Time-Based: Time (Day, Week, Month, Quarter, Year, Decade, Custom).
Session-Based: Session (Tokyo, London, New York, Sydney, Custom).
Event-Based: Earnings, Dividends, Splits.
External: Input Source Highest/Lowest.
Length Selection:
Maximum: The highest allowed regression length (also fixed value of “Length” anchor).
Minimum: The shortest allowed length, ensuring enough bars for a valid regression.
Step: The sampling interval (e.g., 1 checks every bar, 2 checks every other bar, etc.). Increasing the step reduces the loading time, most applicable to “Slope” and “R” anchors.
Adaptive lookback:
Adaptive Lookback: Enable to display regression regardless of too few historical bars.
⯁ Selecting Bias:
Bias applies separately to regression and deviation.
Positive values emphasize recent data (EMA-style), negative invert, and near-zero maintains balance. (e.g., a length 100, bias +1 gives the newest price ~7× more weight than the oldest).
It's best to apply bias to both (regression and deviation) or just the deviation. Biasing only regression may distort deviation visually, while biasing both keeps their relationship intuitive. Using bias only for deviation scales it without altering regression, offering unique analysis.
⯁ Scale Awareness:
Supports linear and logarithmic price scaling, the regression and deviations adjust accordingly.
⯁ Signal Generation & Alerts:
Customizable entry/exit signals and alerts, detailed in the dedicated section below.
⯁ Visual Enhancements & Real-World Examples:
Optional on-chart table display summarizing regression input criteria (display type, anchor type, source, regression type, regression bias, deviation type, deviation bias, deviation multiplier) and key calculated metrics (regression length, slope, Pearson’s R, percentage position within deviations, etc.) for quick reference.
█ Understanding R (Pearson Correlation Coefficient):
Pearson’s R gauges data alignment to a straight-line trend within the regression length:
Range: R varies between –1 and +1.
R = +1 → Perfect positive correlation (strong uptrend).
R = 0 → No linear relationship detected.
R = –1 → Perfect negative correlation (strong downtrend).
This script uses Pearson’s R as an anchor, adjusting regression length to target specific R traits. Strong R (±1) follows the regression channel, while weak R (0) shows inconsistency.
█ Understanding the Slope:
The slope is the direction and rate at which the regression line rises or falls per bar:
Positive Slope (>0): Uptrend – Steeper means faster increase.
Negative Slope (<0): Downtrend – Steeper means sharper drop.
Zero or Near-Zero Slope: Sideways – Indicating range-bound conditions.
This script uses highest and lowest slope as an anchor, where extremes highlight strong moves and trend lines, while values near zero indicate sideways action and possible support/resistance.
█ Setup & Configuration:
Whether you’re new to this script or want to quickly adjust all critical parameters, the panel below shows the main settings available. You can customize everything from the anchor type and maximum length to the bias, signal conditions, and more.
Scale (select Log Scale for logarithmic, otherwise linear scale).
Display (regression channel and/or bands).
Anchor (how regression length is determined).
Length (control bars analyzed):
• Max – Upper limit.
• Min – Prevents regression from becoming too short.
• Step – Controls scanning precision; increasing Step reduces load time.
Regression:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
Deviation:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
• Multiplier - Adjusts Upper and Lower Deviation.
Signal Criteria:
• % (Price vs Deviation) – (0% = lower deviation, 50% = regression, 100% = upper deviation).
• R – (0 = no correlation, ±1 = perfect correlation; >0 = +slope, <0 = -slope).
Table (analyze table of input settings, calculated results, and signal criteria).
Adaptive Lookback (display regression while too few historical bars).
Multiple Regressions (steps 2 to 7 apply to #1, #2, and #3 regressions).
█ Signal Generation & Alerts:
The script offers customizable entry and exit signals with flexible criteria and visual cues (background color, dots, or triangles). Alerts can also be triggered for these opportunities.
Percent Direction Criteria:
(0% = lower deviation, 50% = regression line, 100% = upper deviation)
Above %: Triggers if price is above a specified percent of the deviation channel.
Below %: Triggers if price is below a specified percent of the deviation channel.
(Blank): Ignores the percent‐based condition.
Pearson's R (Correlation) Direction Criteria:
(0 = no correlation, ±1 = perfect correlation; >0 = positive slope, <0 = negative slope)
Above R / Below R: Compares the correlation to a threshold.
Above│R│ / Below│R│: Uses absolute correlation to focus on strength, ignoring direction.
Zero to R: Checks if R is in the 0-to-threshold range.
(Blank): Ignores correlation-based conditions.
█ User Tips & Best Practices:
Choose an anchor type that suits your strategy, “Bar Highest/Lowest” automatically spots commonly used regression zones, while “│R│ Highest” targets strong linear trends.
Consider enabling or disabling the Adaptive Lookback feature to ensure you always have a plotted regression if your chart doesn’t meet the maximum-length requirement.
Use a small Step size (1) unless relying on R-correlation or slope-based anchors as the are time-consuming to calculate. Larger steps speed up calculations but reduce precision.
Fine-tune settings such as lookback periods, regression bias, and deviation multipliers, or trend strength. Small adjustments can significantly affect how channels and signals behave.
To reduce loading time , show only channels (not bands) and disable signals, this limits calculations to the last bar and supports more extreme criteria.
Use the table display to monitor anchor type, calculated length, slope, R value, and percent location at a glance—especially if you have multiple regressions visible simultaneously.
█ Conclusion:
With its blend of advanced regression techniques, flexible deviation options, and a wide range of anchor types, this indicator offers a highly adaptable linear regression channeling system. Whether you're anchoring to time, price extremes, correlation, slope, or external events, the tool can be shaped to fit a variety of strategies. Combined with customizable signals and alerts, it may help highlight areas of confluence and support a more structured approach to identifying potential opportunities.
RakyatChart_ProUsed to determine exit points based on price volatility using ATR (Average True Range).
Key Features:
BUY/SELL signals with larger and clearer labels
Automatic trailing stop to safely follow trends
Alert notifications when a trend reversal occurs
Option to use close price or high/low for extremum calculations
Use this indicator for trend-following trading or as an additional confirmation tool in scalping/day trading strategies.
SessionRangeLevels_v0.1SessionRangeLevels_v0.1
Overview:
SessionRangeLevels_v0.1 is a customizable Pine Script (v6) indicator designed to plot key price levels based on a user-defined trading session. It identifies the high and low of the session and calculates intermediate levels (75%, 50% "EQ", and 25%) within that range. These levels are projected forward as horizontal lines with accompanying labels, providing traders with dynamic support and resistance zones. The indicator supports extensive customization for session timing, time zones, line styles, colors, and more.
Key Features:
Session-Based Range Detection: Tracks the high and low prices during a specified session (e.g., 0600-0900) and updates them dynamically as the session progresses.
Customizable Levels: Displays High, 75%, EQ (50%), 25%, and Low levels, each with independent toggle options, styles (Solid, Dashed, Dotted), colors, and widths.
Session Anchor: Optional vertical line marking the session start, with customizable style, color, and width.
Projection Offset: Extends level lines forward by a user-defined number of bars (default: 24) for future price reference.
Labels: Toggleable labels for each level (e.g., "High," "75%," "EQ") with adjustable size (Tiny, Small, Normal, Large).
Time Zone Support: Aligns session timing to a selected time zone (e.g., America/New_York, UTC, Asia/Tokyo, etc.).
Alert Conditions: Triggers alerts when the price crosses any of the plotted levels (High, 75%, EQ, 25%, Low).
Inputs:
Session Time (HHMM-HHMM): Define the session range (e.g., "0600-0900" for 6:00 AM to 9:00 AM).
Time Zone: Choose from options like UTC, America/New_York, Europe/London, etc.
Anchor Settings: Toggle the session start line, adjust its style (default: Dotted), color (default: Black), and width (default: 1).
Level Settings:
High (Solid, Black, Width 2)
75% (Dotted, Blue, Width 1)
EQ/50% (Dotted, Orange, Width 1)
25% (Dotted, Blue, Width 1)
Low (Solid, Black, Width 2)
Each level includes options to show/hide, set style, color, width, and label visibility.
Projection Offset: Number of bars to extend lines (default: 24).
Label Size: Set label size (default: Small).
How It Works:
The indicator detects the start and end of the user-defined session based on the specified time and time zone.
During the session, it tracks the highest high and lowest low, updating the levels in real-time.
At the session start, it plots the High, Low, and intermediate levels (75%, 50%, 25%), projecting them forward.
Lines and labels dynamically adjust as new highs or lows occur within the session.
Alerts notify users when the price crosses any active level.
Usage:
Ideal for traders who focus on session-based strategies (e.g., London or New York open). Use it to identify key price zones, monitor breakouts, or set targets. Customize the appearance to suit your chart preferences and enable alerts for real-time trading signals.
Notes:
Ensure your chart’s timeframe aligns with your session duration for optimal results (e.g., 1-minute or 5-minute charts for short sessions).
The indicator overlays directly on the price chart for easy integration with other tools.
Edge Explorer by VivekEdge Explorer by Vivek: Comprehensive Multi-Feature Trading Indicator.
Edge Explorer is a versatile and robust trading indicator offering advanced tools for technical analysis. This all-in-one script seamlessly integrates pivotal trading strategies, empowering traders to identify critical levels, supply and demand zones, and pivot points with ease. By delivering insights into market trends and price movements, Edge Explorer enhances precision and decision-making. With customizable settings and clear visualizations, it’s the ultimate tool for maximizing trading efficiency and strategy
🔑 Core Features:
Camarilla Pivot Points: Calculates and plots key support and resistance levels using the Camarilla method.
Central Pivot Range (CPR): Visualizes the crucial Central Pivot Range (TC, PP, BC) to identify trend reversals and breakout zones.
PEMA (Progressive EMA): Displays Fast, Middle, and Slow Exponential Moving Averages with trend-based coloring and fill.
VWAP (Volume Weighted Average Price): Displays Fast, Middle, and Slow Exponential Moving Averages with trend-ased coloring and fill.
Supertrend Indicator: Employs ATR-based calculations to identify uptrends and downtrends dynamically.
Hull Suite: Displays buy and sell signals based on Hull MA's slope changes.
Supply & Demand Zones: Automatically identifies key support and resistance zones based on market structure. Highlights broken zones for actionable insights with alert conditions.
Multi-Timeframe Options: Flexible timeframe settings, including Daily, Weekly, Monthly, Quarterly, and custom multi-year intervals.
🎯 Why Use Edge Explorer?:
Streamlined visualization of essential levels and trends.
Combines various trading tools into a single, user-friendly indicator.
Customizable inputs and alerts to suit individual trading styles.
📊 How to Use:
Add Edge Explorer by Vivek to your TradingView chart and configure the settings to your preferences.
Utilize the Camarilla pivots, CPR, and Supply/Demand Zones for precise entry and exit points.
Monitor the Supertrend, Hull Suite, and PEMA for trend confirmation and dynamic signals.
Take advantage of VWAP to track intraday price action with volume influence.
Dynamic Momentum Bands | AlphaAlgosDynamic Momentum Bands | AlphaAlgos
Overview
The Dynamic Momentum Bands indicator is an advanced technical analysis tool that combines multiple analytical techniques to provide a comprehensive view of market momentum and trend dynamics. By integrating RSI (Relative Strength Index), volatility analysis, and adaptive moving averages, this indicator offers traders a nuanced perspective on market conditions.
Key Features
Adaptive band calculation based on price momentum
Integrated RSI-driven volatility scaling
Multiple moving average type options (EMA, SMA, VWMA)
Smooth, gradient-based band visualization
Optional price bar coloring for trend identification
Technical Methodology
The indicator employs a sophisticated approach to market analysis:
1. Momentum Calculation
Calculates RSI using a customizable length
Uses RSI to dynamically adjust band volatility
Scales band width based on distance from the 50 RSI level
2. Band Construction
Applies a selected moving average type to the price source
Calculates deviation using ATR (Average True Range)
Smooths band edges for improved visual clarity
Configuration Options
Core Settings:
Price Source: Choose the price data used for calculations
RSI Length: Customize the RSI calculation period (1-50)
Band Length: Adjust the moving average period (5-100)
Volatility Multiplier: Fine-tune band width
Band Type: Select between EMA, SMA, and VWMA
Visual Settings:
Bar Coloring: Toggle color-coded price bars
Gradient-based band visualization
Smooth color transitions for trend representation
Trend Identification
The indicator provides trend insights through:
Color-coded bands (blue for bullish, pink for bearish)
Smooth gradient visualization
Optional price bar coloring
Trading Applications
Trend Following:
- Use band position relative to price as trend indicator
- Identify momentum shifts through color changes
- Utilize gradient zones for trend strength assessment
Volatility Analysis:
Observe band width changes
Detect potential breakout or consolidation periods
Use RSI-driven volatility scaling for market context
Best Practices
Adjust RSI length to match trading timeframe
Experiment with different moving average types
Use in conjunction with other technical indicators
Consider volatility multiplier for different market conditions
This indicator is provided for informational purposes only. Always use proper risk management when trading. Past performance is not indicative of future results. Not financial Advise
RSI, MACD, Bollinger, SPY Options Day Trading🧠 Strategy Objective:
This strategy is optimized for directional day trading of SPY, targeting 1DTE options contracts with high-probability intraday entries. It uses a fusion of momentum indicators (MACD, RSI), trend filters (Bollinger Band, Parabolic SAR), candlestick reversal patterns (Bullish Engulfing), and time-based session logic to enhance decision-making precision.
The goal is to capture quick directional moves while avoiding common traps like morning reversals, midday chop, and end-of-day volatility.
📅 Trade Timing Constraints:
Active Window: 9:30 AM – 2:55 PM ET
No Trade Zones:
10:35 AM – 10:40 AM
11:20 AM – 11:30 AM
Auto-Close: All trades closed at 4:00 PM
End-of-Year Protection: No trades on December 31
🔁 Entry Conditions
🟩 Call Entry (Long):
MACD line crosses above signal line
Histogram is increasing and not oscillating
Histogram magnitude > 0.09 (avoids noise)
Price is above Bollinger Band basis and Parabolic SAR
No strong downtrend over past 20 bars (>2.5% drop)
Not during retracement zones (see below)
Optional forced entry if RSI(14) < 10 and RSI(6) < 5
🟥 Put Entry (Short):
MACD line crosses below signal line
Histogram decreasing, stable, and not oscillating
Price below Bollinger Band basis and SAR
No strong uptrend over last 20 bars (>2.5% rise)
Not during reversal retracement window
🔒 Time-Based Reversal Protection (9:30 – 10:35 AM):
⛔ Call Protection:
If price drops ≥ 0.8% between 9:30–10:00 and recovers >90% of that move before 10:35, no calls allowed
⛔ Put Protection:
If price rises ≥ 0.8% from 9:30–10:00 and retraces >90% by 10:35, no puts allowed
These filters prevent false breakouts caused by morning traps and algo reversals.
📊 Profit & Risk Management (ATR-based):
📈 Long (Call):
Stop Loss: close - ATR * 2.1
Target: close + ATR * dynamicMultiplier * 0.6
DynamicMultiplier = based on RSI strength (between 1.0–3.0)
📉 Short (Put):
Stop Loss: close + ATR * 2.3
Target: close - ATR * 2.9 * 0.6
🔢 Delta Model:
Inputs user-defined option delta (default = 0.46)
Calculates expected premium move for option contracts at each target
📋 Visual Aids:
✅ Green ⬆ for Call Signals
🚫 Red ⬇ for Put Signals
⚪ Histogram strength and day range shown in real-time table
⚪ Labels: 9:55 (“25”), 10:00 (“30”), 10:30 (“1”) for pattern timing insight
⚪ Plots daily open line (9:30 AM) for gap and mean reversion reference
🧱 Pattern Entry – Bullish Engulfing (MACD Enhanced)
Optional via input toggle
Only allowed between 11:00 AM – 2:55 PM
Entry requires:
Bullish Engulfing candle
Downtrend confirmed via:
Close < SMA(50)
OR SMA(50) < SMA(200) (if enabled)
MACD histogram must be stable and increasing (non-oscillating)
Uses its own ATR-based SL/TP logic
Filters for minimum profit target before entry
🧪 Strategy Structure:
Fixed contract size: Always 1 contract per trade
No trade stacking: Only 1 trade allowed per bar
Tracking & Logging:
Persistent tracking of each trade
Logging trade numbers and signal confirmation
Trade entries are labeled on chart
Performance Table:
Displays MACD/Engulfing profit targets
Option estimates
Histogram range
Daily high/low delta
🧑💻 Ideal For:
SPY 1DTE directional scalps
Manual traders using TradingView alerts
Algorithmic setups based on intraday volatility windows
Traders looking to combine momentum, structure, and price action
Dynamic Heat Levels [BigBeluga]This indicator visualizes dynamic support and resistance levels with an adaptive heatmap effect. It helps traders identify key price interaction zones and potential mean reversion opportunities by displaying multiple levels that react to price movement.
🔵Key Features:
Multi-Level Heatmap Channel:
- The indicator plots multiple dynamic levels forming a structured channel.
- Each level represents a historical price interaction zone, helping traders identify critical areas.
- The channel expands or contracts based on market conditions, adapting dynamically to price movements.
Heatmap-Based Strength Indication:
- Levels change in transparency and color intensity based on price interactions for the length period .
- The more frequently price interacts with a level, the more visible and intense the color becomes.
- When a level reaches a threshold (count > 10), it starts to turn red, signaling a high-heat zone with significant price activity.
🔵Usage:
Support & Resistance Analysis: Identify price levels where the market frequently interacts, making them strong areas for trade decisions.
Heatmap Strength Assessment: More intense red levels indicate areas with heavy price activity, useful for detecting key liquidity zones.
Dynamic Heat Levels is a powerful tool for traders looking to analyze price interaction zones with a heatmap effect. It offers a structured visualization of market dynamics, allowing traders to gauge the significance of key levels and detect mean reversion setups effectively.
Find Untapped LevelsYou can find your daily, weekly and monthly levels with this indicator. You still need to go through each time frame and draw them yourself
Layered Supertrend - [NLR]Layered Supertrend is an advanced version of the classic Supertrend indicator. Instead of a single line, it breaks the trend into six clear zones—three showing strength in the current trend, and three signaling a possible reversal. It also includes multiple Supertrend levels (multipliers 1 to 5) to help you see both short-term shifts and long-term trend direction at a glance.
Combine it with MACD Overlay for making better decision.
Dual Vertical Lines & Open Price H-LineThis indicator is designed to automatically mark two specific times each day with vertical lines on your chart. It works by calculating daily timestamps for two user-defined times (for example, 13:00 for the first line and 14:00 for the second) using the chart’s timezone. When a bar’s starting time crosses each target timestamp, the indicator draws a vertical line at that exact time.
RSI, MACD, Bollinger, SPY Single Contract Day TradingThis strategy aims to detect potential reversal points in price using MACD line crossovers and MACD histogram momentum shifts. It identifies:
Bullish Reversal Entry when:
MACD histogram is negative but increasing (momentum weakening on the downside).
MACD line crosses above the signal line (bullish crossover).
Bearish Reversal Entry when:
MACD histogram is positive but decreasing (momentum weakening on the upside).
MACD line crosses below the signal line (bearish crossover).
It assumes momentum exhaustion leads to a trend reversal, and crossovers confirm the direction shift.
ETH Auto-Trading Example//@version=5
strategy("ETH Auto-Trading Example", overlay=true, margin_long=100, margin_short=100)
// Input parameters
fast_length = input(9, "Fast SMA Length")
slow_length = input(21, "Slow SMA Length")
rsi_length = input(14, "RSI Length")
overbought = input(70, "Overbought Level")
oversold = input(30, "Oversold Level")
stop_loss = input(2.0, "Stop Loss (%)") / 100
take_profit = input(4.0, "Take Profit (%)") / 100
// Calculate indicators
fast_sma = ta.sma(close, fast_length)
slow_sma = ta.sma(close, slow_length)
rsi = ta.rsi(close, rsi_length)
// Entry/Exit conditions
long_condition = ta.crossover(fast_sma, slow_sma) and (rsi < oversold)
short_condition = ta.crossunder(fast_sma, slow_sma) and (rsi > overbought)
// Strategy logic
if (long_condition)
strategy.entry("Buy", strategy.long)
strategy.exit("Exit Buy", "Buy", stop=close * (1 - stop_loss), limit=close * (1 + take_profit))
if (short_condition)
strategy.entry("Sell", strategy.short)
strategy.exit("Exit Sell", "Sell", stop=close * (1 + stop_loss), limit=close * (1 - take_profit))
// Plot indicators
plot(fast_sma, color=color.blue, linewidth=2)
plot(slow_sma, color=color.red, linewidth=2)
hline(overbought, "Overbought", color=color.gray)
hline(oversold, "Oversold", color=color.gray)
MAGNETO-BB - Fran Contreras [Artedejubilarte]Welcome to a basic, simple, straightforward, and profitable signal if confirmed with other indicators such as:
- Alligator
- MACD
- RSI
And you mark the TPs with the help of Fibonacci retracements.
The "MAGNETO" strategy is based on the magnetic reversals of Bollinger Bands.
When you set up alerts, you'll only have to wait to receive them to initiate a positive inspection in the trading of any currency pair, gold, cryptocurrencies, and stocks.
Each asset has a reversal average with the highest confirmation:
- Forex: 15M
- XAUUSD: 15M
- Cryptos: 5M
- Stocks: 1H
If you have any questions, just contact us; we're here to help.
Hareketli Ortalama ve Fibonacci KanalYour TradingView Pine Script code looks good overall! You've integrated a moving average with a volatility channel based on standard deviation, and you've also added Fibonacci levels as dynamic support and resistance areas. Additionally, you've implemented buy and sell conditions based on the price crossing these levels.
kanal uzunluğu = 31
kanal çarpanı =1
hareketli ortalama = 11
olarak ayarlanıcaktır
Close Price PercentileClose Price Percentile with Range Distribution
This indicator helps traders identify where the current price stands relative to its historical context using percentile ranking. It calculates and displays the current price's percentile position within a customizable lookback window (default: 365 periods).
Key Features:
• Percentile Ranking: Shows where the current price falls within its historical range (0-100%)
• Customizable Thresholds: Set your own high/low percentile boundaries for analysis
• Statistical Distribution: Tracks and displays the number and percentage of data points falling in each range (below threshold, between thresholds, above threshold)
• Visual References: Includes dashed lines at threshold levels for easy visual reference
• Clean Data Presentation: Organized table display in the top-right corner
Perfect for:
• Understanding price extremes
• Identifying potential overbought/oversold conditions
• Statistical analysis of price movements
• Mean reversion strategies
Fully customizable with adjustable window length, thresholds, and visual settings.
Highest High & Lowest Low of 2nd/3rd Candle - Every DayHighest High & Lowest Low of 2nd/3rd Candle - Every Day
Demo GPT - Gaussian Channel Strategy v3.1 AdaptedGaussian Channel Strategy v3.1 Adapted
An automated trading strategy combining Gaussian Channel, Stochastic RSI, and SMA for trend filtering.
Overview
This strategy uses a dynamic Gaussian Channel to identify price channels, Stochastic RSI for overbought/oversold conditions, and a 50-period SMA as a trend filter. It enters long/short positions based on price breaking channel bands, Stochastic RSI signals, and SMA alignment.
Key Components
Gaussian Channel
Source : Midpoint price (hlc3).
Parameters :
N: Number of poles (1-9) controlling channel smoothness.
per: Sampling period (default 100) for dynamic lag adjustment.
mult_base: Multiplier for channel width (default 1.5), scaled by ATR for volatility adaptation.
Features :
Reduces lag when modeLag is enabled.
Faster response when modeFast is enabled.
Channels :
filt: Central filter line (midpoint of the channel).
hband/lband: Upper/lower bands = filt ± (ATR × mult_base).
Stochastic RSI
Parameters :
RSI Length: 10.
Stochastic Length: 10.
Smooth K/D: 5 periods.
Signals :
Overbought: K > 80 (long bias).
Oversold: K < 20 (short bias).
Trend Filter (SMA 50)
Confirms bullish trend when close > SMA50 (long entry).
Confirms bearish trend when close < SMA50 (short entry).
Trade Logic
Long Entry Conditions :
Channel Uptrend : filt > previous filt (rising channel midline).
Price Break : close > hband (price exceeds upper channel band).
Stochastic RSI : K > 80 (overbought) or K < 20 (oversold rebound).
Trend Filter : close > SMA50.
Short Entry Conditions :
Channel Downtrend : filt < previous filt (falling channel midline).
Price Break : close < lband (price falls below lower band).
Stochastic RSI : K < 20 (oversold) or K > 80 (overbought reversal).
Trend Filter : close < SMA50.
Exit Conditions :
Automatic Exit :
strategy.exit with trailing stop (trail_offset=1000, trail_points=5000).
Immediate Close :
Long: close crosses below hband.
Short: close crosses above lband.
Parameters & Settings
Initial Capital : $100,000.
Commission : 0.1% per trade.
Position Sizing : 75% of equity per trade.
Pyramiding : Max 1 open position.
Date Range : Adjustable (default 2025–2069 for backtesting).
Risk Notes
Volatility Sensitivity : Channel width adjusts with ATR; may widen during volatile markets.
Overlapping Signals : Stochastic RSI allows entries at both extremes (overbought/oversold), which may lead to whipsaws.
SMA Lag : Trend filter may delay entries during rapid price moves.
Optimization Tips
Adjust mult_base to control channel width based on asset volatility.
Test N and per for smoother or more responsive channels.
Refine Stochastic RSI parameters for fewer false signals.
Zonas Bollinger LíneaAnother way of visualizing Bollinger Bands, marking the zone in which the price is sitting at the time. Usually Uptrends stay in de yellow and green zones while downtrends sit on the orange and red zones.
Fiyat Tahmini (%20+)The minor deficiencies in the existing script have been addressed. It is now much better.
Nasan Ultimate Health Index (NUHI)The Nasan Ultimate Health Index (NUHI) is a technical indicator designed to measure the relative health of a stock compared to a benchmark index or sector. By incorporating price action, volume dynamics, and volatility, NUHI provides traders with a clearer picture of a stock’s performance relative to the broader market.
The NUHI is based on the idea that a stock’s relative strength and momentum can be assessed more effectively when adjusted for volume behavior and benchmark comparison. Instead of looking at price movement alone, this indicator factors in:
The stock’s price trend (via EMA)
Volume participation (green vs. red volume) and volume ratio - SMA(volume, 21)/ SMA(volume, 252)
Volatility-adjusted performance (ATR-based scaling)
Comparison with a selected benchmark (e.g., SPX, NDX, sector ETFs)
This results in a normalized and comparative score that helps traders identify outperforming, neutral, and underperforming stocks within a specific market environment.
The NUHI is constructed using the following elements:
1️⃣ Stock Raw Score (Unadjusted Momentum)
The exponential moving average (EMA) of the hlc3 (average of high, low, close) is used to define the price trend.
The difference between the current EMA and the EMA from n bars ago shows whether the stock is gaining or losing momentum.
This difference is divided by the ATR (Average True Range) to adjust for volatility.
2️⃣ Volume Behavior Adjustment
Volume is split into green volume (up candles) and red volume (down candles).
The ratio of green to red volume determines whether buyers or sellers dominate over the selected period (n bars).
If the stock is in an uptrend, green volume is weighted higher; if in a downtrend, red volume is weighted higher.
The stock’s Volume Ratio (short-term SMA divided by long-term SMA) is adjusted based on this weight.
3️⃣ Benchmark Comparison
A similar Raw Score calculation is performed on the selected benchmark (SPX, NDX, or sector ETF).
Benchmark price movements, volume behavior, and ATR adjustments mirror the stock’s calculations.
This provides a reference point for evaluating the stock’s relative strength.
4️⃣ Normalization Process
Both the stock and benchmark raw scores are min-max normalized over the past 252 bars (1-year lookback).
This scales values between 0 and 1, ensuring fair comparisons regardless of absolute price differences.
5️⃣ NUHI Calculation
The final NUHI value is computed using a logarithmic ratio between the normalized stock score and the normalized benchmark score:
This transformation ensures a more symmetrical representation of overperformance and underperformance.
Performance Zones
Strong Outperforming (NUHI between >0.41 and 0.69)
Leading (NUHI between >0.10 and 0.41)
Transitioning Outperformance (NUHI between 0.10 and 0)
Equilibrium (NUHI 0)
Transitioning Underperformance (NUHI between -0.10 and 0)
Lagging (NUHI between < -0.1 and -0.41)
Strong Underperforming (NUHI between< -0.41 and -0.69 )
How to Use NUHI
✅ Identifying Strong Stocks
If NUHI > 0, the stock is outperforming its benchmark.
If NUHI < 0, the stock is underperforming the benchmark.
✅ Trend Confirmation
A steadily rising NUHI and raw score (colored green) suggests sustained strength bullish conditions.
A falling NUHI and raw score (colored orange) indicates weakness and possible rotation into other assets.
✅ Finding Reversals
Bullish Divergence: If NUHI is improving while the stock’s raw score is negative, it may signal a bottoming opportunity.
Bearish Signs: If NUHI is dropping despite price strength, it could hint at underlying weakness.
Why a Stock in a Downtrend Can Have NUHI > 0 (and Vice Versa )
NUHI measures performance relative to both its own history and the benchmark.
A stock’s recent movement is compared to how it usually behaves and how the benchmark is performing.
Example Scenarios:
Stock in a Downtrend but NUHI > 0
The stock may still be in a downtrend (negative raw score), but it’s performing better relative to its past downtrend behavior and better than the benchmark over the same period.
This could mean it’s showing relative strength compared to the broader market or sector.
Stock in an Uptrend but NUHI < 0
Even in a uptrend (positive raw score), the stock might be underperforming relative to its past uptrend behavior and underperforming the benchmark.
What This Means:
NUHI > 0 in a downtrend → The stock is falling less aggressively than usual and/or holding up better than the benchmark.
NUHI < 0 in an uptrend → The stock is gaining less than expected based on its history and/or lagging behind the benchmark.
NUHI helps identify relative strength or weakness .
follow the lineDefinição do Indicador
indicator("follow the line", overlay=true): O indicador será sobreposto ao gráfico de preços.
Cores
Define cores para os elementos gráficos: verde (alta), vermelho (baixa) e cinza (linha de sinal).
Parâmetros de Configuração
periodo = input.int(55, "Período"): Define o período da média dinâmica.
periodo_sinal = input.int(21, "Período do Sinal"): Define o período da EMA que age como linha de sinal.
Cálculos
src = close: Usa o preço de fechamento como base.
mudanca = ta.change(src, 2): Calcula a variação do preço com um deslocamento de 2 períodos.
soma_quadrados = math.sum(math.pow(mudanca, 2), periodo): Soma dos quadrados das variações para um determinado período.
rms = math.sqrt(soma_quadrados/periodo): Calcula o raiz quadrada da média dos quadrados das mudanças (uma espécie de volatilidade ajustada).
escala = mudanca/rms: Normaliza a variação do preço.
alpha = math.abs(escala) * 5 / periodo: Define um fator de suavização baseado na volatilidade.
Cálculo da DSMA (Dynamic Smoothed Moving Average)
dsma = 0.0: Inicializa a variável.
dsma := nz(dsma ) + alpha * (src - nz(dsma )): Atualiza a DSMA suavizada.
sinal = ta.ema(dsma, periodo_sinal): Calcula a média exponencial da DSMA.
Detecção de Cruzamentos
cruzamento_alta = ta.crossover(dsma, sinal): Detecta cruzamentos da DSMA para cima da linha de sinal.
cruzamento_baixa = ta.crossunder(dsma, sinal): Detecta cruzamentos da DSMA para baixo da linha de sinal.
Plotagem dos Dados no Gráfico
plot(dsma, "DSMA", color=dsma > sinal ? verde : vermelho, linewidth=2):
Plota a DSMA com cor verde quando está acima da linha de sinal e vermelha quando está abaixo.
plot(sinal, "Linha Sinal", color=cinza, linewidth=1):
Plota a linha de sinal em cinza.
plotshape(cruzamento_alta, "Alta", shape.circle, location.absolute, verde, size=size.small):
Desenha um círculo verde quando ocorre um cruzamento de alta.
plotshape(cruzamento_baixa, "Baixa", shape.circle, location.absolute , vermelho, size=size.small):
Desenha um círculo vermelho quando ocorre um cruzamento de baixa.