50% Fib Trend Cloud + ATR BandsThis indicator plots two structural 50% fibonacci midpoints from recent confirmed 'left/right' swings that form a *cloud* of equilibrium, then adds a rolling 50% fibonacci range midpoint based on a lookback window that's wrapped in ATR bands. Importantly, it solves a specific trading problem:
Structural midpoints (macro context) are powerful but can lag when price escapes prior ranges. Enter rolling 50% fib + ATR ➡️ which restores real-time balance & tolerance (micro context). Together they show where price is balanced structurally, where it’s balanced right now, and how much volatility to tolerate before acting.
➖➖➖
🔑 Why this is different
Most tools either draw a single midpoint (ex., daily 50%) or ATR bands around a moving average. This script fuses dual swing-based 50% midpoints (structure) + a rolling 50% with ATR (flow), so you don’t lose context when price escapes prior ranges. The cloud tells you who’s in control (fast vs. slow structure). The rolling 50% + ATR tells you how far is “too far” now.
➖➖➖
🧠 What it does (at a glance)
🔸Structural Equilibrium × 2 (Fib1/Fib2)
Two independent 50% midpoints formed from swing pivots (configurable Left/Right bars + optional smoothing). Their gap is the Midpoint Cloud = structural “fair value” zone.
🔸Rolling 50% + ATR Bands
A rolling highest/lowest window computes an always-current 50% rolling midpoint plot; ±ATR × length envelopes define a soft value area and over-stretch boundaries.
🔸Actionable Visuals
Optional fill between Fib1/Fib2, labels, and candle-overlay modes to instantly read regime (above both / below both / between).
🔸Smart Defaults
Timeframe-aware presets for L/R pivots & smoothing; full manual overrides available.
➖➖➖
⚙️ Calculations (plain-English)
🔸Pivot midpoints (Fib1 & Fib2):
1) Detect a swing using `Left/Right` bars
2) Take the swing’s high/low → compute 50%
3) (Optional) Smooth the line (SMA) to stabilize on noisy TFs
4) Repeat with a different sensitivity to get two distinct midpoints
🔸Rolling midpoint:
Highest High / Lowest Low over the last *N* bars → (HH + LL) / 2
🔸ATR levels:
`Upper = Rolling50 + ATR × Mult`, `Lower = Rolling50 − ATR × Mult`
(Typical: ATR length 14–21; Multipliers 2.236 for L1, 5.382 for L2)
➖➖➖
🤖 Auto-Configured Presets (with Manual Override)
💡Goal: make the midpoints “just work” on common timeframes while still letting you dial them in.
💡How Auto Presets work
When Auto Presets = ON, the script picks sensible L/R/S (Left bars / Right bars / Smoothing) for Fib Trend 1 and Fib Trend 2 based on chart timeframe.
🔸Fib 1 (fast) emphasizes *micro-structure* for quicker bias shifts.
🔸Fib 2 (slow) emphasizes *macro-structure* for anchor/bias context.
These defaults keep Fib 1 responsive without jitter and Fib 2 stable without lag.
➡️ Turn Auto Presets = OFF to take full control with the manual inputs described below.
➖➖➖
🛠 Manual Fib Midpoint Settings (when Auto = OFF)
💡Each midpoint uses three knobs:
🔸Pivot Left (L): bars to the left that must be lower/higher to qualify a swing
🔸Pivot Right (R): bars to the right that must be lower/higher to confirm the swing
🔸Smoothing (S): SMA period applied to the raw 50% midpoint (stabilizes noise)
5-Minute optimized defaults
🔸Fib Trend 1: `L21 / R5 / S55` → responsive local structure (entries/exits, re-balancing zones)
🔸Fib Trend 2: `L55 / R13 / S89` → broader structure (trend context, anchors/stops)
Timeframe guidance
🔸1m–3m: may feel a touch laggy → consider ~`L13 / R3 / S34`
🔸15m–1h: defaults remain strong → optionally ~`L34 / R8 / S89`
🔸4h+ : increase span for stability → `L89–144 / R13–21 / S144–233`
➡️ Rule of thumb: shorter L/R = faster detection, longer S = smoother line. Tune until Fib 1 captures the “active swing” and Fib 2 captures the “dominant swing” without whipsaw.
➖➖➖
🎛 Inputs (quick reference)
🔸Fib Trend 1/2: Source (High/Low/Close), Left/Right bars, Smoothing length, Show/Hide, Cloud fill toggle
🔸Rolling 50%: Lookback length, Price basis (Wicks/Close/HLC3/OHLC4), Plot scope (Full / Last N / None)
🔸ATR Bands: ATR length, Multipliers (L1/L2), Plot scope, Line width/colors
🔸Overlay & Labels: Candle overlay mode, Label padding/size, 50% centerline toggle, Plot widths
➖➖➖
🖍️ Candle Coloring & Overlay Modes
💡Purpose: make trend instantly visible on the candles and ATR levels.
1) Color Logic (dropdown)
🔸 Fib Midpoints — Colors by position of price vs. Fib 1 & Fib 2
🔸ATR Zones — Colors by which ATR zone price is in relative to the Rolling 50%
➡️ Price Reference: Choose the input used for the decision (Close, HL2, OHLC3, OHLC4).
➡️Tip: Close is crisp; HL2/OHLC variants are smoother.
2) Overlay Style (dropdown)
🔸 None — No visual change to candles
🔸 Bar Color — Uses `barcolor()` to tint built-in candles (this takes into account your Trading View settings, for instance if you have wicks set to white, they will show up as white with this setting)
🔸 PlotCandles — Draws unified custom candles (body, wick, border) with the same color for maximum clarity
💡Practical use
🔸 Pick Fib Midpoints to read structural bias at a glance (above/below/between the cloud).
🔸 Pick ATR Zones to read value vs. stretch around the Rolling 50% (mean-reversion vs. trend extension).
➖➖➖
📘 How to use
A) Trend confirmation
- Strong bullish bias when price holds above both structural mids; strong bearish when below both.
- Use the Rolling 50% + ATR as a dynamic re-entry zone: pullbacks that respect ATR(L1) often continue the prevailing trend.
B) Transition / mean reversion
- Inside the Cloud (between Fib1 & Fib2) treat behavior as neutralization/re-balancing; range tactics tend to outperform momentum plays.
- In ranges, fades near ±ATR around the rolling 50% can mark short-term edges.
C) Breakout context
- When price leaves the Cloud, the Rolling 50% keeps you anchored so price never feels “floating.” A clean hold outside ATR(L1/L2) suggests regime strength; quick re-entries hint at traps.
➖➖➖
🖼 Chart examples
➡️ Each snapshot shows how the Cloud (structure) and the Rolling 50% + ATR (flow) work together.
1) 1-Minute Downtrend – Cloud as Dynamic Ceiling
- The Cloud slopes down; pullbacks repeatedly fail under the Cloud’s underside.
- Rolling 50% (dashed mid) + ATR(L1) act as a reversion band: rallies stall near upper ATR and rotate lower.
2) 15-Minute Persistent Drift – Structure Guides, Flow Times Entries
- Long drift lower with Cloud overhead.
- Consolidations near the rolling mid resolve in the trend direction; ATR bands frame risk on each attempt.
3) 15-Minute Uptrend (BTC) – From Cloud Escape to Value Stair-Step
- After escaping the prior Cloud, rolling 50% + ATR establish a new higher value area.
- Pullbacks into ATR(L1) produce orderly stair-steps; Cloud remains supportive on deeper dips
4) 5-Minute BTC – Pullback to Value then Rotate
- Strong leg up; retrace tags lower ATR band and rotates back toward the rolling mid.
- Labels (Fib1/Fib2) make the structural context explicit for decision-making.
➖➖➖
🧪 Starter presets
- Intraday (5–15m): Fib1 ~ L21/R5 (smooth 5), Fib2 ~ L55/R13 (smooth 9) • Rolling = 55 • ATR = 14 • L1 = 2.5x, L2 = 5.0x
- Scalping: Shorten lookbacks & smoothing; keep ATR multipliers similar, or tighten L1.
- Swing: Lengthen all lookbacks; consider ATR length 21–28.
➖➖➖
🏁Final Word
This script is not just a visual tool, it’s a complete trend and structure framework. Whether you're looking for clean trend alignment, dynamic support/resistance, or early warning signs of a reversal, this system is tuned to help you react with confidence — not hindsight.
Rembember, no single indicator should be used in isolation. For best results, combine it with price action analysis, higher-timeframe context, and complementary tools like trendlines, moving averages etc Use it as part of a well-rounded trading approach to confirm setups — not to define them alone.
---
💡Turn logic into clarity. Structure into trades. And uncertainty into confidence.
Midpoint
Essa - Yearly High, Low & MidYearly High, Low & Midpoint Indicator
This TradingView indicator helps traders track key yearly price levels by plotting the high, low, and midpoint values for each year within a user-specified range.
Features & Functionality:
Automatic Yearly Calculation: Determines the highest and lowest price for each year and computes the midpoint as their average.
Clear & Customisable Visuals:
The Yearly High is plotted as a solid green line.
The Yearly Low appears as a solid red line.
The Midpoint is displayed as a blue dashed line for easy distinction
Detailed Labels:
Each level is labeled at the far right of the chart, showing the year, level type (High, Low, or Mid), and price (e.g., 2016 High - 1.20000).
Labels are right-aligned in white, ensuring clear visibility against any background.
This indicator is perfect for traders who rely on long-term technical analysis, providing a quick and structured way to visualise significant yearly price levels.
RSI Xray + VolumeRSI Analysis:
The indicator calculates the Relative Strength Index (RSI) using a user-defined length (default: 14).
It colors the bars based on RSI levels to identify potential overbought and oversold conditions.
Bars exceeding the overbought level (default: 70) are colored, while bars below the oversold level (default: 30) are colored too.
This helps traders identify potential trend reversals or market exhaustion points.
Midpoint Analysis:
The indicator calculates the midpoint of each bar, which is the average of the high and low prices.
It colors the bars based on their relation to the midpoint.
Bars above the midpoint are colored, indicating potential bullish momentum.
Bars below the midpoint are colored, suggesting potential bearish momentum.
Volume Analysis:
The indicator offers the ability to analyze volume changes and identify high volume bars.
It colors the bars when the volume exceeds a user-defined threshold.
This feature helps traders identify potential areas of market interest and increased participation.
Moving Average (SMA):
The indicator plots a Simple Moving Average (SMA) line of the closing price over a user-defined period (default: 9).
This moving average line helps traders identify potential trends and spot areas of support or resistance.
RSI Extreme Conditions:
The indicator identifies extreme RSI conditions by comparing the current RSI value with the highest and lowest RSI values calculated from a user-defined number of previous bars (default: 10).
When the RSI exceeds the overbought level but is lower than the highest RSI value within the specified range, the bar color changes to a customizable color (default: blue).
Conversely, when the RSI falls below the oversold level but is higher than the lowest RSI value within the specified range, the bar color changes to the same customizable color.
This feature helps traders identify potential RSI-based trading opportunities and market turning points.
Customization:
The indicator offers customizable settings for colors, RSI levels, SMA length, volume thresholds, RSI extreme levels, and RSI label color.
Traders can modify these settings based on their preferences and trading strategies.
Overall, the 'RSI Xray + Volume' indicator provides a comprehensive view of RSI levels, market momentum, volume changes, and RSI extreme conditions. Traders can use this information to identify potential trade setups, validate market trends, and make more informed trading decisions. It can be applied to various timeframes and instruments, making it a valuable tool for both short-term and long-term traders.
TurntLibraryLibrary "TurntLibrary"
Collection of functions created for simplification/easy referencing. Includes variations of moving averages, length value oscillators, and a few other simple functions based upon HH/LL values.
ma(source, length, type)
Apply a moving average to a float value
Parameters:
source : Value to be used
length : Number of bars to include in calculation
type : Moving average type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Smoothed value of initial float value
curve(src, len, lb1, lb2)
Exaggerates curves of a float value designed for use as an exit signal.
Parameters:
src : Initial value to curve
len : Number of bars to include in calculation
lb1 : (Default = 1) First lookback length
lb2 : (Default = 2) Second lookback length
Returns: Curved Average
fragma(src, len, space, str)
Average of a moving average and the previous value of the moving average
Parameters:
src : Initial float value to use
len : Number of bars to include in calculation
space : Lookback integer for second half of average
str : Moving average type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Fragmented Average
maxmin(x, y)
Difference of 2 float values, subtracting the lowest from the highest
Parameters:
x : Value 1
y : Value 2
Returns: The +Difference between 2 float values
oscLen(val, type)
Variable Length using a oscillator value and a corresponding slope shape ("Incline",Decline","Peak","Trough")
Parameters:
val : Oscillator Value to use
type : Slope of length curve ("Incline",Decline","Peak","Trough")
Returns: Variable Length Integer
hlAverage(val, smooth, max, min, type, include)
Average of HH,LL with variable lengths based on the slope shape ("Incline","Decline","Trough") value relative to highest and lowest
Parameters:
val : Source Value to use
smooth
max
min
type
include : Add "val" to the averaging process, instead of more weight to highest or lowest value
Returns: Variable Length Average of Highest Lowest "val"
pct(val)
Convert a positive float / price to a percentage of it's highest value on record
Parameters:
val : Value To convert to a percentage of it's highest value ever
Returns: Percentage
hlrange(x, len)
Difference between Highest High and Lowest Low of float value
Parameters:
x : Value to use in calculation
len : Number of bars to include in calculation
Returns: Difference
midpoint(x, len, smooth)
The average value of the float's Highest High and Lowest Low in a number of bars
Parameters:
x : Value to use in calculation
len
smooth : (Default=na) Optional smoothing type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Midpoint
rth vwap and midMidpoint and VWAP are often important inflection points in daytrading. I managed to find a script providing me with a 24 hour session midline by NorthStarDayTrading and a RTH VWAP script by LDBC. So I decided to merge those two to get a RTH mid and vwap.
Half BackA dynamic intraday midpoint for Day Timeframe trader reference.
Midpoint is halfway between the day's highest high and lowest low.
Midpoint resets daily.
Intraday Mid PointA moving indicator that is overlaid main chart. Identifies the start of the day, and then applies this formula:
( Current High of Day + Current Low of Day ) / 2, to get the mid point. It is a useful tool to identify buy side or sell side control, along with vwap.
NSDT MidlineSimple script to plot the Midpoint between the High and Low of day for intraday trading. This is a key level that is respected quite often. Very easy to trade bounces or breakthroughs.
Rolling midpointsThe script made for research purposes which plots these statistics of a given window: Mid-range (max + min)/2, Lower midpoint (mid-range + min)/2, and Higher midpoint (mid-range + max)/2.
This could be interesting when checking periods with sample size <= 0, or checking distros with srs kurtosis values.
Mean & median are also there.
Midpoint OscillatorThe Midpoint Oscillator was created by Tushar Chande Ph.D. (Stocks & Commodities V. 9:11 (431-434)) and it does a great job of tracking extreme changes in the price. Buy when the line is green and sell when it turns red.
Let me know if you would like me to write more scripts!
True ATH/ATL w/ labelsPlots the All Time High and All Time Low, with optional labels when a new ATH/ATL is created. Reaches all the way back in history for the true high/low, not limited to the most recent 5000 candles like most scripts. Works on all time frames.
Relative Price OscillatorHere is a new experimental indicator we've been working on. The idea was to compare two EMA's of period midpoints to the actual closing price. The steps that were taken are listed below:
1.Calculate an EMA based on each period's midpoint ((High * Low) /2) for the last 9 periods.
2.Calculate an EMA based on each period's midpoint for the last 100 periods.
3. Divide the difference of the two EMA's by the closing price. ((EMA1 - EMA2) / Close).
4. Smooth the value from step #3 with an 18 period EMA. Multiply by 1000 for better scaling/visibility.
Using:
Bullish when line is green, bearish when line is red. Buy on first green, then sell on first red.
There is also an option to color the candles based on the RPO line.