Gann Square of 144 (Master Price & Time)🔹 What this tool does
Draws a 144-unit square in price & time (0 → 144)
Plots all key horizontal & vertical levels:
0, 18, 36, 48, 54, 72, 90, 96, 108, 126, 144
Highlights the main 1/2 level (72) as thick midline
Marks 1/3 and 2/3 (48 & 96) as special harmonic levels
Draws internal diagonals (0–144, 144–0 and sub-squares)
Plots an 8-ray Gann fan from the 0-point (0 → 36 / 72 / 108 / 144 etc.)
Keeps price–time ratio consistent inside the box:
the 1×1 angle has a fixed slope = price_per_bar
The idea: once the square is calibrated to a major swing, you can study how price respects these angles and harmonic zones over time.
🔧 Inputs & how to set it up correctly
Choose your timeframe
Works best on Daily and Weekly charts.
Use one timeframe consistently when calibrating the square.
Start offset (bars back)
Start offset (bars back) shifts the whole square left/right.
Increase the value to move the square further into the past, decrease it to move it closer to the current bars.
Box width (bars)
Box width (bars) = how many bars the square spans horizontally.
Bigger value = projects the structure further into the future.
Example: 288 bars ≈ 2×144 units in time, 720 bars for longer-term projection, etc.
Bottom price
Bottom price is your 0-level in price.
Usually set this to a major swing low (cycle low, bear market low, important pivot).
The bottom-left corner of the square conceptually sits at:
(start_offset_bar, bottom_price)
Price per bar (slope 1×1) (if your version has this input)
This defines the slope of the 1×1 angle (main Gann angle).
Recommended way to set it:
Pick a major impulsive move from Swing Low → Swing High.
Measure:
Price range = High − Low
Number of bars between them.
Compute:
price_per_bar = price_range / number_of_bars
Use that as your 1×1 value in the input.
Now the main diagonal from 0 to 144 represents the true Gann 1×1 for that swing.
Important: The 1×1 angle is mathematically correct (price-per-bar), even if it does not always look like a perfect 45° line visually in TradingView due to chart scaling.
📖 How to read the Square of 144
Horizontal levels
0 = anchor price (bottom)
18, 36, 48, 54, 72, 90, 96, 108, 126, 144 = key price harmonics
72 (1/2) often acts as major support/resistance
48 & 96 (1/3 and 2/3) are strong “vibration” levels
Vertical levels
Same units but in time (bars).
When important pivots in price occur near these verticals, you get time–price confluence.
Midlines (1/2)
The thick horizontal and vertical lines at 72 mark the center of the square.
Crossings around these often signal important cycle turns.
1/3 & 2/3 zones (48–54 and 90–96)
These narrow bands are powerful reversal / decision zones.
Price often reacts strongly there or accelerates if they break.
Gann fan from 0-point
These rays represent major trends:
1×1 equivalent (main diagonal)
Faster & slower angles (e.g. 2×1, 1×2, etc depending on configuration)
If price breaks one fan angle cleanly, it often “falls” or “climbs” toward the next one.
🎯 Practical use cases
Project future support/resistance zones based on a major low.
See where price is in the square: early in the cycle (0–36), mid (around 72), or late (108–144).
Watch how price respects:
midlines (72),
1/3 and 2/3 bands (48–54, 90–96),
and the fan angles from 0.
Combine with your own price action / Fibonacci / trend tools – this is not a signal generator, but a time–price map.
⚠️ Notes & limitations
This tool is for educational & analytical purposes only.
It does not generate buy/sell signals.
Visual 45° angles in TradingView can change when you zoom or rescale the chart.
→ The script keeps the internal price-per-bar logic stable, even if the drawing looks steeper/flatter when zooming.
Always confirm zones with price action, volume, and higher timeframe context.
Cycles
London Killzone High/Low (live → lock & extend @07:59 UTC-5)London Killzone High/Low (live → lock & extend @07:59 UTC-5)London Killzone High/Low (live → lock & extend @07:59 UTC-5)
Tokyo Session High/Low (live → lock & extend @02:59 UTC-5)Tokyo Session High/Low (live → lock & extend @02:59 UTC-5)Tokyo Session High/Low (live → lock & extend @02:59 UTC-5)
NY KZ High/Low (live → lock @10:00 UTC-5)NY KZ High/Low (live → lock @10:00 UTC-5) NY KZ High/Low (live → lock @10:00 UTC-5)
neeson CME Gaps CompleteCME Gap Detection & Trading Signals Indicator
Originality & Unique Features
This indicator represents a sophisticated approach to CME gap analysis by combining multiple innovative features not found in standard gap indicators:
Dual Visualization System:
Traditional gap boxes that precisely mark the price void between Friday's close and Monday's open
Intelligent bar coloring that instantly identifies gap days through color differentiation
Comprehensive Time Analysis:
Tracks gaps for up to 4 years, providing unprecedented historical context
Maintains gap memory even through chart reloads and timeframe changes
Advanced Signal Generation:
Real-time gap fill detection with customizable threshold levels
Integrated alert system for both new gap formations and gap fill completions
Functionality & Implementation
Core Detection Mechanism
The indicator automatically identifies CME weekend gaps by comparing Friday's closing price with Monday's opening price. When a significant price discontinuity is detected (configurable threshold), it triggers the visualization and tracking system.
Visual Components:
Gap Boxes: Semi-transparent colored rectangles (green for bullish gaps, red for bearish gaps) that precisely cover the price gap area between Friday's close and Monday's open
Extension Lines: Projection lines that extend from gap boundaries into future price action, helping traders visualize potential support/resistance levels
Bar Coloring: Automatic color coding where gap bars are highlighted (green/red) while normal trading bars appear gray, creating immediate visual distinction
Signal Generation:
Buy Signals: Triggered when bearish gaps are filled (price moves upward through the gap zone)
Sell Signals: Activated when bullish gaps are filled (price moves downward through the gap zone)
Smart Thresholds: Configurable fill percentage (0.1%-5.0%) to avoid false signals from minor price fluctuations
Technical Implementation
The script employs sophisticated array management to track multiple gaps simultaneously while maintaining optimal performance. Each gap stores:
Price boundaries (top/bottom)
Gap type (bullish/bearish)
Detection timestamp
Volume data (for potential future analysis)
Fill status
The automatic cleanup system removes gaps older than the configured maximum age (1-10 years) to prevent memory overload while preserving relevant historical context.
Usage Instructions
Basic Operation
Apply to Chart: Add the indicator to any cryptocurrency or futures chart
Automatic Detection: The script automatically scans for Monday openings relative to Friday closes
Visual Analysis: Observe colored bars for gap days and corresponding gap boxes
Configuration Options
Gap Detection Settings:
Show CME Gaps: Enable/disable the entire detection system
Max Gap Age: Set how long to track gaps (1-10 years)
Only Weekend Gaps: Focus exclusively on CME weekend gaps
Visual Customization:
Bullish/Bearish Gap Colors: Customize gap box appearance
Extension Lines: Control projection line visibility and length
Bar Coloring: Toggle bar color differentiation
Trading Signals:
Show Trading Signals: Enable/disable buy/sell alerts
Gap Fill Threshold: Set sensitivity for gap fill detection
Enable Alerts: Activate platform notifications
Trading Strategy Integration
Gap Fill Strategy:
Monitor for gap fill completion signals
Enter positions in the direction of the fill (buy on bearish gap fills, sell on bullish gap fills)
Use extension lines as potential profit targets or stop-loss levels
Support/Resistance Identification:
Historical gaps often act as future support/resistance
Use the 4-year gap memory to identify key price levels
Combine with other technical analysis tools for confirmation
Core Calculation Philosophy
Market Psychology Foundation
The indicator operates on the well-established market principle that "gaps tend to fill." This phenomenon stems from:
Market Memory: Traders remember significant price discontinuities and often trade to close them
Liquidity Gaps: Gaps represent areas of low liquidity that markets naturally seek to revisit
Psychological Levels: Round numbers and significant price levels often coincide with gap boundaries
Statistical Edge
By systematically tracking gaps across extended timeframes (up to 4 years), the indicator provides:
Probability Assessment: Historical gap fill rates help assess current gap fill probabilities
Risk Management: Clear visual boundaries for stop-loss placement and position sizing
Time Analysis: Understanding how quickly different types of gaps tend to fill
Adaptive Detection
The algorithm incorporates:
Dynamic Thresholds: Configurable sensitivity to ignore insignificant gaps
Multi-Timeframe Awareness: Consistent performance across different chart timeframes
Market Condition Adaptation: Automatic adjustment to varying volatility environments
This comprehensive approach transforms simple gap detection into a sophisticated trading tool that combines visual clarity, historical context, and actionable signals for improved trading decisions.
PLANBXPRESS PSYCHOLOGICAL LEVEL ENTRY MODELThis Indicator merges multiple professional trading concepts into one visual tool — helping traders identify momentum shifts, entry zones, and daily trading plans with volume confirmation.
It automatically detects trend direction, generates dynamic take-profit & stop-loss levels, and overlays key daily reference points such as VWAP, pivot, support, and resistance zones based on ATR and trend context.
⚙️ Main Components
1️⃣ Signal System
Detects trend bias using SMA-based logic.
Generates entry price, TP1–TP3, and SL dynamically from recent impulse ranges.
Updates signals automatically when trend bias changes or previous targets are hit.
Visual levels are drawn directly on the chart.
2️⃣ Volume Analysis
Compares current volume against a moving average (SMA).
Classifies volume as:
🟢 Strong (above 1.5× average)
🟡 Average
🔴 Weak (below 0.8× average)
Displays the current volume strength and trend bias in an on-chart table.
3️⃣ Auto Day Plan
Uses multi-timeframe ATR calculations to define:
Support / Resistance zones
Pivot & Balance areas
Daily VWAP
Auto Targets (ATR-based expansion levels)
Adapts automatically to selected base timeframe (1H, 4H, or Daily).
4️⃣ Trend Context
Dual EMA system (50 & 200) to confirm bullish/bearish structure.
Aligns expected direction with VWAP & pivot location for context-aware bias.
🎯 What You Get on Chart
📈 Automatic LONG/SHORT signals
🎯 TP1, TP2, TP3, and SL levels
📊 Volume strength meter
🧭 VWAP, pivot, support/resistance & balance zones
🎨 Clean visual layout for intraday and swing traders
🧩 Inputs
Parameter Description
lenImpulse Impulse range length
smaLen SMA length for trend bias
levelRatio SL/TP ratio multiplier
volLen Volume SMA length
baseTF Base timeframe for zones/VWAP
atrMult1 / atrMult2 ATR multipliers for target levels
fwdBars Extension range for future projection
💡 How to Use
Add the script to your chart and choose your preferred timeframe.
Observe signal direction (📈 LONG / 📉 SHORT) and TP/SL levels.
Confirm entries when:
Trend aligns with VWAP direction, and
Volume category shows Strong or Average.
Use Auto Day Plan levels (pivot, balance, VWAP) as intraday reaction zones.
Enhanced Oversold | 超跌信号 + 历史统计 + 模拟入出场 (v2.4)Enhanced Oversold | Oversold Signal + Historical Stats + Simulated Entries/Exits (v2.4) – Release Notes (EN)
1. Overview
This script is an advanced “buy-the-dip” toolkit for US stocks and ETFs. It detects rare, deep intraday selloffs on fundamentally strong names, then simulates a three-tier entry strategy around the event and tracks different exit paths.
The goal is to answer three questions:
* When did similar crashes happen in the past?
* How would a disciplined laddered entry have performed?
* How long did it take for price to recover under different exit rules?
2. Core idea
* Define an 8-hour “crash” relative to a robust reference price yBase = min(previous-day VWAP, previous close).
* Combine this with short-term RSI and 15m Z-score filters to avoid “random noise” dips.
* Filter out regime-level risk (index / sector crash, volatility spikes, liquidity stress, bad long-term trend).
* When a valid oversold event appears, simulate staged entries (E1/E2/E3) and exits, then record everything into a historical table and JSON for external analysis.
3. Signal logic (summary)
* Timeframe: designed for 15m / 5m charts, using US RTH session 09:30–16:00.
* Crash trigger (must all be true):
* 8h drawdown from yBase ≤ fixed threshold (default −6%) and the 8h low is recent within N×15m bars.
* RSI(1h) below an oversold level (default < 30).
* 15m return Z-score ≤ threshold (default ≤ −1.5) over a configurable window.
* Optional filters:
* Circuit breaker: SPY + sector ETF + VIX/VIX3M + VVIX conditions to avoid market-wide panic regimes.
* Liquidity stress: SPY 1h “stress index” (ATR/price, intraday range vs volume, and VIX Z-score) normalised to 0–100, with a user threshold.
* Shape filter: only accept “A-type” healthy long-term trend set-ups (6m / 12m performance vs VWAP/EMA and daily 200SMA slope).
4. Simulated entries (E1 / E2 / E3)
* E1: first ladder price anchored to the first RTH after the event, with optional “same-day RTH” entry if the event happens during RTH.
* E2: only becomes valid from the next RTH day onward, and only if the new RTH low breaks the E1-execution-day low. The target depth is based on E1 discount × (1+α).
* E3: only after E2, on a different day (not the E1 “anchor” day). Depth is based on the max discount of E1/E2 × (1+β).
* Stair and cap rules:
* A minimum tick step between ladders, adjustable in ticks.
* Optional cap so that every entry price must be below a multiple of the event price.
* Optional “chase on first RTH bar”: if nothing fills on the first RTH bar, prices can be lifted once toward the intraday low, while keeping ladder spacing and cap constraints.
* All actual fills are simulated against bar lows. The script records:
* Whether E1/E2/E3 filled.
* Actual execution prices.
* Average entry price and the entry sequence string (e.g. “13”, “123”).
5. Exit logic and timing metrics
Two exit rules are tracked in parallel:
* Exit Ref: exit when close returns to yBase.
* Exit Open+Y%: exit when close reaches min(event close, first post-event open) × (1+Y%).
For each event the script records:
* t_ref_d: days from event to first touch of yBase.
* tY_d: days until Open+Y% level is reached.
* tUp_d: days until price turns “bullish again” (RTH VWAP ≥ previous daily VWAP and close > previous close).
* tLow_d: days until the minimum price between event and t_ref (or end of window) is reached.
* lowToRef: that minimum price.
* ddMinPct: maximum drawdown (in %) from average entry to lowToRef.
Additional intraday stats for the first RTH after the event:
* dayFirstLow: low of the first RTH bar from the chosen statistics start.
* rthLow: overall RTH low of that day.
* eqFirst: whether the overall low equals the first-bar low.
* postDipAvg: average close after the daily low is formed (equal-weighted).
6. Historical table on chart
* The on-chart table shows up to maxRows events, most recent first.
* Columns include:
* Date, 8h drawdown, yBase, stress, circuit conditions, shape (A/B/C).
* Entry sequence and actual execution prices.
* Average entry price.
* Exit prices and PnL (in % and absolute) for both exit modes.
* Timing metrics (t_ref, tY, tUp, tLow).
* Min price to t_ref, max drawdown vs average entry.
* First RTH low, day RTH low, equality flag, post-dip average, and market flag (US/HK).
The table is only redrawn on bar close to reduce CPU load.
7. Liquidity stress pane
* Optional lower pane that plots the SPY-based liquidity stress index (0–100).
* Components (all on 60m SPY/VIX data):
* rvZ: Z-score of ATR/price.
* rpvZ: Z-score of intraday range divided by volume.
* vixZ: Z-score of VIX.
* Stress index = 50 + 10 × (rvZ + rpvZ + vixZ), clipped to .
* A horizontal line marks the current filter threshold.
8. Webhook JSON outputs
The indicator can send three types of alerts via alert():
* Signal
* Emitted only when a new oversold event fires.
* Contains ticker, market flag, event time, drop8h, RSI1h, Z15, yBase, shape, circuit reason, and stress.
* History
* Emitted when requested, containing a full snapshot of the latest event:
* All key metrics used in the table, including absolute PnL for both exit modes, timing metrics, drawdown stats, and post-dip averages.
* HistoryAll
* Compressed bulk export of all events as a compact JSON object:
* Short keys (d, dr8, yb, st, c, sh, e, px, avg, xr, pr, absR, xy, py, absY, tr, ty, tu, tl, l2r, dd, fl, rl, eq, pavg).
* Numbers rounded to 3 decimals to reduce payload size.
* Because TradingView enforces a payload size limit, HistoryAll is automatically split into multiple chunks (up to ~3200 characters each).
* When HistoryAll is selected and a manual “dump all” flag is turned on, the script will emit multiple alerts on the same bar until all chunks are sent.
9. What is new in v2.3
Compared with previous versions, v2.3 adds:
* Deeper risk metrics:
* Tracking of the minimum price until recovery (lowToRef) and its timing (tLow_d).
* Max drawdown vs average entry (ddMinPct) for each event.
* E1-execution-day RTH low tracking, used to decide whether later days truly “make a new low” before adding E2.
* Absolute PnL fields:
* absRef and absOY for both exit modes, calculated using user-defined share/contract sizes for E1/E2/E3.
* More compact and robust HistoryAll:
* Short-key JSON objects, 3-decimal numeric formatting, chunked output suitable for 3rd-party storage and analysis.
* Performance optimisations:
* Array length normalisation is done once per bar instead of inside the per-event loop.
* Table rendering only happens on bar close, and no longer clears the whole grid every bar.
* Same-day RTH pricing for event-day entries is restricted to the latest event only, reducing redundant work on historical events.
10. Usage notes and disclaimer
* Recommended canvas: 15m or 5m chart, US stocks / ETFs, with RTH session set to 09:30–16:00.
* For stable operation on TradingView’s servers, avoid extremely large lookback windows and oversized history tables if your symbol has very long history.
* This script is for educational and research purposes only.
* It is not financial advice and does not guarantee profitability. Always combine it with your own risk management, fundamental research, and market context.
Previous Day OHLC with Fib LevelThe Previous Day OHLC indicator is designed to help traders identify key price levels from the previous trading session. These levels often act as important zones of support, resistance, and market reaction points during the current day’s price action.
This indicator automatically plots the Previous Day’s Open, High, Low, and Close on any intraday timeframe, making it a powerful tool for day traders, scalpers, and swing traders who rely on market structure and session behavior.
Vertical Lines on Selected DatesThis Pine Script indicator allows a user to place vertical lines on a chart at specific dates and times. It provides three separate input sections, each dedicated to one targeted date. For each of the three dates, the user can select the exact timestamp and customize the line’s color, width, and style directly from the indicator’s settings panel.
Behind the scenes, the script converts the selected visual style (solid, dashed, or dotted) into the appropriate internal line style using a helper function. When the live chart time crosses each chosen timestamp, the script detects that crossover and draws a vertical line on that exact bar. The line extends both upward to the high and downward to the low of the chart, creating a full-height marker.
Overall, the indicator functions as a simple visual marking tool for highlighting important moments in time—such as events, sessions, or personal reminders—without affecting any price analysis. The flexibility of color, width, and style allows each vertical line to stand out uniquely, and because the script uses detection logic on a per-bar basis, each line is drawn only once at the appropriate moment.
Long Term indicator for financial marketsIts the indicator that i have made for my friends following the learnings which i have learnt over the last few years for momentum traders
Gann Square of 144 (Master Price & Time)This indicator is a fully reconstructed and highly precise version of W.D. Gann’s Square of 144, designed for deep analysis of price-time balance, harmonic movements, and cyclical turning points.
It allows traders to anchor the Square directly to any pivot (date + price), making the tool adaptable for all markets and all timeframes.
Current Session H/L — EvolvingTrack the current session high and low as it's formed. Lines are projected back to previous sessions and forward in time. Bot projections are adjustable.
YCGH ATH DrawdownHow the Indicator Measures Drawdown from ATH
The indicator continuously tracks and calculates the percentage decline from the all-time high (ATH) using a systematic approach.
ATH Tracking Mechanism
Dynamic ATH Calculation: The script maintains a persistent variable that stores the highest price ever reached. On each bar, it compares the current high with the stored ATH using ath := math.max(ath, high), updating the ATH whenever a new peak is reached.
VIX Calm vs Choppy (Bar Version, VIX High Threshold)This indicator tracks market stability by measuring how long the VIX stays below or above a chosen intraday threshold. Instead of looking at VIX closes, it uses VIX high, so even a brief intraday spike will flip the regime into “choppy.”
The tool builds a running clock of consecutive bars spent in each regime:
Calm regime: VIX high stays below the threshold
Choppy regime: VIX high hits or exceeds the threshold
Calm streaks plot as positive bars (light blue background).
Choppy streaks plot as negative bars (dark pink background).
This gives a clean picture of how long the market has been stable vs volatile — useful for trend traders, breakout traders, and anyone who watches risk-on/risk-off conditions. A table shows the current regime and streak length for quick reference.
YCGH Drawdown PercentilesWhat This Indicator Does?
The Drawdown Percentiles indicator tracks how far below the all-time high (ATH) a stock or asset is currently trading, then displays statistical percentiles of historical drawdowns in a customizable table.
Percentile Analysis: It collects up to 5,000 historical bars of drawdown data, sorts them, and calculates user-selected percentiles (default: 10th, 30th, 50th) to show where current drawdowns rank historically.
Visual Display: A table shows each percentile threshold with color-coded drawdown values, helping you quickly assess whether the current drawdown is typical or extreme compared to historical patterns.
Practical Use Cases
Risk Assessment: Identify if current drawdowns fall within normal ranges or represent extreme conditions requiring position adjustments.
Entry/Exit Timing: Use percentile rankings to time entries during historically shallow drawdowns (better conditions) and reduce exposure during deep drawdowns.
Strategy Comparison: Compare drawdown patterns across different assets or trading strategies to evaluate risk-adjusted performance.
BTCUSD / (inverted)DXY RatioShows relation between INVERTED DXY and BITCOIN ( blue line ) . With EMA-smoothing ( red line ).
PDH/PDL Breakout Reversal [Invite-Only]Detects daily breakout reversals based on Previous Day High/Low structure.
Ideal for intraday reversals and continuation entries with built-in SL/TP visualization.
ATC v6 with ORB by SabnATC v6 with ORB: Advanced Automatic Session and Opening
Range Indicator
ATC v6 is an advanced indicator designed by Alfa Trade Club for
TradingView users. This tool not only automatically marks important session
opens, closes, or specific times of financial markets on your chart but also
visualizes powerful Opening Range (ORB) strategies directly on your chart.
This tool removes the need to manually monitor critical trading hours, allowing
you to easily analyze price action in relation to these important timeframes.
Key Features
This indicator comes with a set of powerful features to provide the flexibility,
visual clarity, and strategic advantage that traders need:
1. Multi-Time Zone Support The indicator is based on the world's most
important financial market centers:
New York (America/New_York)
London (Europe/London)
Tokyo (Asia/Tokyo)
Istanbul (Europe/Istanbul)
This allows you to always set the lines accurately according to the local time of
the market you are trading.
2. Advanced 3-Stage Timing (Pre / Main / Next) Each time line is more than
just a simple line; it can manage a three-stage event cycle:
"Pre-Session": Draws a dotted line a few minutes before the main time you
specify (e.g., market open). This allows you to see the price level just before a
significant event.
"Main Session": Marks the opening price at the exact event time (e.g., 08:00
London Open) with a solid line.
"Next / ORB" (Opening Range): Draws another dotted line a specified number
of minutes after the main event (e.g., 15 minutes later). This is used to define the
Opening Range.
3. Automatic Price Boxes (Volatility & ORB) The indicator can draw two
different types of boxes based on this timing:
Opening Volatility Box (Pre -> Main): If the "Pre-Session" feature is active, the
indicator draws a colored box between the price at the pre-session moment and
the price at the main event. This box visualizes the initial volatility at the session
open.
Opening Range Box (Main -> Next): If the "Next" feature is active, the indicator
draws a box between the price at the main event and the "next" event.
4. Customizable Time Lines You have full control over each line. Users can:
Enable/Disable each line.
Set any desired hour and minute.
Define the "Pre" and "Next" durations in minutes.
Assign a different color for visual distinction.
5. Smart and Efficient Drawing
Forward-Extending Lines: All drawn lines and boxes automatically extend from
the moment they are created until the next day. This makes it easy to track how
these levels act as support/resistance throughout the day.
High Performance: Instead of deleting old lines and drawing new ones when a
new day starts, the code intelligently extends the existing lines into the next day
Weekend and DST Protection: Automatically skips weekends (from Friday to
Monday) and is not affected by Daylight Saving Time (DST) changes.
Who Is It For?
Session-Focused Traders: Ideal for those who track volatility during the London,
New York, Asian, or Istanbul session opens.
Day Traders: Perfect for those who want to mark important economic data
release times or daily market open/close levels.
Technical Analysts: A powerful aid for those who want to visually analyze how
opening prices at specific times and time ranges play a role throughout the day.
ATC v6 with ORB is much more than just a simple session line; it is a dynamic
analysis and strategy tool that combines price and time.
Relative Strength HSIWe add the relative strength indicator. We try to maximize the alpha,
when there is price divergence, we should notice.
RSI with Zone Colors//@version=6
indicator(title="RSI with Zone Colors", shorttitle="RSI+", format=format.price, precision=2, timeframe="", timeframe_gaps=true)
//// ==== INPUT SETTINGS ====
rsiLength = input.int(14, title="RSI Length", minval=1)
source = input.source(close, title="Source")
ob_level = input.int(70, title="Overbought Level")
os_level = input.int(30, title="Oversold Level")
//// ==== RSI CALCULATION ====
change = ta.change(source)
up = ta.ma(math.max(change, 0), rsiLength)
down = ta.ma(-math.min(change, 0), rsiLength)
rsi = down == 0 ? 100 : 100 - (100 / (1 + up / down))
//// ==== COLOR BASED ON ZONES ====
rsiColor = rsi > ob_level ? color.red : rsi < os_level ? color.green : #2962FF
//// ==== PLOT RSI ====
plot(rsi, title="RSI", color=rsiColor, linewidth=2)
//// ==== ZONE LINES ====
hline(ob_level, "Overbought", color=#787B86)
hline(50, "Middle", color=color.new(#787B86, 50))
hline(os_level, "Oversold", color=#787B86)
//// ==== FILL ZONES ====
zoneColor = rsi > ob_level ? color.new(color.red, 85) : rsi < os_level ? color.new(color.green, 85) : na
fill(plot(ob_level, display=display.none), plot(rsi > ob_level ? rsi : ob_level, display=display.none), color=zoneColor, title="OB Fill")
fill(plot(os_level, display=display.none), plot(rsi < os_level ? rsi : os_level, display=display.none), color=zoneColor, title="OS Fill")
//// ==== COLOR CANDLE WHEN RSI IN ZONE ====
barcolor(rsi > ob_level ? color.red : rsi < os_level ? color.green : na)






















