OBV (Delta or regular)This is a quite simple script to apply some choices to OBV.
You can choose to use regular OBV values or you can choose to use delta OBV values.
Delta OBV values calculates the delta between selling volume and buying volume per bar to find discrepancies.
You can make the OBV a smoothed line or just keep the normal rigid line. Rigid line is default.
A secondary smoothed OBV line is added automatically with color change if the OBV is above or below the smoothed line.
You can set your desired MA from SMA, EMA, VWMA and WMA, The same will be applied to both lines if chosen to smooth them both.
Both lines are editable from the styles tab (visibility, color and line type)
If you for some reason don't want color change on the secondary line, chose the same color for both color 1 and 2.
Simple delta OBV example:
If a red bar has a long lower wick, OBV will calculate the entire bar towards bearish volume, while the delta will check if there's more buying or selling happening in total. Some times you'll be able to catch divergences in the volume which implies a reversal might be in the making.
For instance more selling on a green candle making the OBV drop instead of increasing or vise versa.
Hopefully someone finds is useful.
指標和策略
GARCH Range PredictorThis was inspired by deltatrendtrading's video on GARCH models to predict daily trading ranges and identify favorable trading conditions. Based on advanced volatility forecasting techniques, it predicts whether a trading day's true range will exceed a threshold, helping traders decide when to trade or skip a session.
Key Features
GARCH(1,1) Volatility Modeling: Uses log-transformed true ranges with exponential moving average centering
Forward-Looking Predictions: Makes predictions at session start before the day unfolds
Dynamic or Static Thresholds: Choose between fixed dollar thresholds or adaptive 20-day averages
Accuracy Tracking: Monitors prediction accuracy with overall and recent (20-day) hit rates
Visual Session Boxes: Colors trading sessions green (trade) or red (skip) based on predictions
Real-Time Statistics: Displays current predictions, thresholds, and performance metrics
How It Works
Data Transformation: Log-transforms daily true ranges and centers them using an EMA
Variance Modeling: Updates GARCH variance using: σ²ₜ = ω + α(residual²) + β(σ²ₜ₋₁)
Prediction Generation: Back-transforms log predictions to dollar values
Signal Generation: Compares predictions to threshold to generate trade/skip signals
Performance Tracking: Validates predictions against actual outcomes
Parameters
GARCH Parameters (ω, α, β): Control volatility persistence and mean reversion
EMA Period: Smoothing period for log range centering
Threshold Settings: Static dollar amount or dynamic multiplier of recent averages
Session Time: Define regular trading hours for analysis
Best Use Cases
Breakout and momentum strategies that perform better on high-range days
Risk management by avoiding low-volatility sessions
Futures day trading (optimized for MNQ/NQ detection)
Any strategy where daily range impacts profitability
Important Notes
Requires 5+ sessions for initialization and warm-up
Accuracy depends heavily on proper parameter tuning for your specific instrument
Default parameters may need adjustment for different markets
Monitor the hit rate to validate effectiveness on your timeframe
Chanlun - Strokes & Central ZonesChanlun Indicator - Strokes and Central Zones
This indicator implements Chan lun's core concepts:
Bi (Stroke): Basic price movement units formed by local highs and lows
Zhongshu (Central Zone): Overlapping areas formed by at least 3 strokes
Extension Lines: Visual guides for the latest central zone boundaries
Key Features:
Automatic stroke identification based on local extremes
Central zone detection with customizable colors
Extension lines for latest central zone (upper/lower bounds)
Separate colors for strokes within central zones
Price labels on the axis for zone boundaries
Settings:
Max Bars: Maximum K-lines to analyze (default: 4900)
Lookback Period: Period for finding local extremes (default: 5)
Min Gap Bars: Minimum bars between strokes (default: 4)
Customizable colors for strokes, zones, and extension lines
Basic FVG Indicator by nacho-fx mod by evseevd2803Basic FVG Indicator by nacho-fx ( www.tradingview.com )
-Extends unfilled FVG boxes.
-Stops extending filled FVG boxes instead of removing them.
Fibonacci Retracement MTF/LOG 2WEEK KKKKFibonacci retracment should be used to create a line of lines to justify the rest of indicators to reduce stress in indicators because we should not shout
SC_Reversal Confirmation 30 minutes by Claude (Version 1)📉 When to Use
Use this setup when the stock is in a downtrend and a bullish reversal is anticipated.
🔍 Recommended Usage This model is designed for pullback phases, where the asset is declining and a reversal is expected. It helps filter out weak signals and waits for technical confirmation before triggering an entry.
✅ Entry Signal Green triangles appear only when all reversal conditions are fully met. Entry may occur slightly after the bottom, but with a reduced likelihood of false signals.
📊 Suggested Settings Apply on a 30-minute chart using a 100-period Exponential Moving Average (EMA) based on close. Recommended for Cobalt Chart 0.
--------------------------------------------------------------------------------------
Fibonacci Retracement MTF/LOG 3 WEEK KKKKA Fibonacci arc trading strategy uses circular arcs drawn at Fibonacci retracement levels (38.2%, 50%, 61.8%) to identify potential support and resistance zones, often intersecting with a trend line. This strategy helps traders anticipate price reversals or pullbacks, and it should be used in conjunction with other indicators
Fib OscillatorWhat is Fib Oscillator and How to Use it?
🔶 1. Conceptual Overview
The Fib Oscillator is a Fibonacci-based relative position oscillator.
Instead of measuring momentum (like RSI or MACD), it measures where price currently sits between the recent swing high and swing low, expressed as a percentage within the Fibonacci range.
In other words:
It answers: “Where is price right now within its most recent dynamic range?”
It visualizes retracement and extension zones numerically, providing continuous feedback between 0% and 100% (and beyond if extended).
🔶 2. What the Script Does
The indicator:
Automatically detects recent high and low levels using an adaptive lookback window, which depends on ATR volatility.
Calculates the current price’s position between those levels as a percentage (0–100).
Plots that percentage as an oscillator — showing visually whether price is near the top, middle, or bottom of its recent range.
Overlays Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) as reference zones.
Generates alerts when the oscillator crosses key Fib thresholds — which can signal retracement completion, breakout potential, or pullback exhaustion.
🔶 3. Technical Flow Breakdown
(a) Inputs
Input Description Default Notes
atrLength ATR period used for volatility estimation 14 Used to dynamically tune lookback sensitivity
minLookback Minimum lookback window (candles) 20 Ensures stability even in low volatility
maxLookback Maximum lookback window 100 Limits over-expansion during high volatility
isInverse Inverts chart orientation false Useful for inverse markets (e.g. shorts or inverse BTC view)
(b) Volatility-Adaptive Lookback
Instead of using a fixed lookback, it calculates:
lookback
=
SMA(ATR,10)
/
SMA(Close,10)
×
500
lookback=SMA(ATR,10)/SMA(Close,10)×500
Then it clamps this between minLookback and maxLookback.
This makes the oscillator:
More reactive during high volatility (shorter lookback)
More stable during calm markets (longer lookback)
Essentially, it self-adjusts to market rhythm — you don’t have to constantly tweak lookback manually.
(c) High-Low Reference Points
It takes the highest and lowest points within the dynamic lookback window.
If isInverse = true, it flips the candle logic (useful if viewing inverse instruments like stablecoin pairs or when analyzing bearish setups invertedly).
(d) Oscillator Core
The main oscillator line:
osc
=
(
close
−
low
)
(
high
−
low
)
×
100
osc=
(high−low)
(close−low)
×100
0% = Price is at the lookback low.
100% = Price is at the lookback high.
50% = Midpoint (balanced).
Between Fibonacci percentages (23.6%, 38.2%, 61.8%, etc.), the oscillator indicates retracement stages.
(e) Fibonacci Levels as Reference
It overlays horizontal reference lines at:
0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
These act as support/resistance bands in oscillator space.
You can read it similar to how traders use Fibonacci retracements on charts, but compressed into a single line oscillator.
(f) Alerts
The script includes built-in alert conditions for crossovers at each major Fibonacci level.
You can set TradingView alerts such as:
“Oscillator crossed above 61.8%” → possible bullish continuation or breakout.
“Oscillator crossed below 38.2%” → possible pullback or correction starting.
This allows automated monitoring of fib retracement completions without manually drawing fib levels.
🔶 4. How to Use It
🔸 Visual Interpretation
Oscillator Value Zone Market Context
0–23.6% Deep Retracement Potential exhaustion of a down-move / early reversal
23.6–38.2% Shallow retracement zone Possible continuation phase
38.2–50% Mid retracement Neutral or indecisive structure
50–61.8% Key pivot region Common trend resumption zone
61.8–78.6% Late retracement Often “last pullback” area
78.6–100% Near high range Possible overextension / profit-taking
>100% Range breakout New leg formation / expansion
🔸 Practical Application Steps
Load the indicator on your chart (set overlay = false, so it’s below the main price chart).
Observe oscillator position relative to fib bands:
Use it to determine retracement depth.
Combine with structure tools:
Trend lines, swing points, or HTF market structure.
Use crossovers for timing:
Crossing above 61.8% in an uptrend often confirms breakout continuation.
Crossing below 38.2% in a downtrend signals renewed downside momentum.
For range markets, oscillator swings between 23.6% and 78.6% can define accumulation/distribution boundaries.
🔶 5. When to Use It
During Retracements: To gauge how deep the pullback has gone.
During Range Markets: To identify relative overbought/oversold positions.
Before Breakouts: Crossovers of 61.8% or 78.6% often precede impulsive moves.
In Multi-Timeframe Contexts:
LTF (15M–1H): Detect intraday retracement exhaustion.
HTF (4H–1D): Confirm major range expansions or key reversal zones.
🔶 6. Ideal Companion Indicators
The Fib Oscillator works best when contextualized with structure, volatility, and trend bias indicators.
Below are optimal pairings:
Companion Indicator Purpose Integration Insight
Market Structure MTF Tool Identify active trend direction Use Fib Oscillator only in trend direction for cleaner signals
EMA Ribbon / Supertrend Trend confirmation Align oscillator crossovers with EMA bias
ATR Bands / Volatility Envelope Validate breakout strength If oscillator >78.6% & ATR rising → valid breakout
Volume Oscillator Confirm retracement strength Volume contraction + oscillator under 38.2% → potential reversal
HTF Fib Retracement Tool Combine LTF oscillator with HTF fib confluence Powerful multi-timeframe setups
RSI or Stochastic Measure momentum relative to position RSI divergence while oscillator near 78.6% → exhaustion clue
🔶 7. Understanding the Settings
Setting Function Practical Impact
ATR Period (14) Controls volatility sampling Higher = smoother lookback adaptation
Min Lookback (20) Smallest window allowed Lower = more reactive but noisier
Max Lookback (100) Largest window allowed Higher = smoother but slower to react
Inverse Candle Chart Flips oscillator vertically Useful when analyzing bearish or inverse scenarios (e.g. short-side fib mapping)
Recommended Configs:
For scalping/intraday: ATR 10–14, lookback 20–50
For swing/position trading: ATR 14–21, lookback 50–100
🔶 8. Example Trade Logic (Practical Use)
Scenario: Uptrend on 4H chart
Oscillator drops to below 38.2% → retracement zone
Price consolidates → oscillator stabilizes
Oscillator crosses above 50% → pullback ending
Entry: Long when oscillator crosses above 61.8%
Exit: Near 78.6–100% zone or upon divergence with RSI
For Short Bias (Inverse Setup):
Enable isInverse = true to visually flip the oscillator (so lows become highs).
Use the same thresholds inversely.
🔶 9. Strengths & Limitations
✅ Strengths
Dynamic, self-adapting to volatility
Quantifies Fib retracement as a continuous function
Compact oscillator view (no clutter on chart)
Works well across all timeframes
Compatible with both trending and ranging markets
⚠️ Limitations
Doesn’t define trend direction — must be used with structure filters
Can whipsaw during choppy consolidations
The “lookback auto-adjust” may lag in sudden volatility shifts
Shouldn’t be used standalone for entries without structural confluence
🔶 10. Summary
The “Fib Oscillator” is a dynamic Fibonacci-relative positioning tool that merges retracement theory with adaptive volatility logic.
It gives traders an intuitive, quantified view of where price sits within its recent fib range, allowing anticipation of pullbacks, reversals, or breakout momentum.
Think of it as a "Fibonacci RSI", but instead of momentum strength, it shows positional depth — the vibrational location of price within its natural swing cycle.
PG ATM Strike Line with Call & Put PremiumsPine Script: ATM Strike Line with Call & Put Premiums (Simplified)This Pine Script for TradingView displays the At-The-Money (ATM) strike price, futures price, call/put premiums (time value), and two ratios—Premium Ratio (PR) and Volume Ratio (VR)—for a user-selected underlying asset (e.g., NIFTY, BANKNIFTY, or stocks). It helps traders gauge near-term market direction using options data.How the Script WorksInputs:Expiry: Select year (e.g., '25), month (01–12), day (01–31) for option expiry (e.g., '251028').
Timeframe: Choose data timeframe (e.g., Daily, 15-min).
Symbol: Auto-detects chart symbol or select from Indian indices/stocks.
Strike: Auto-ATM (based on futures) or manual strike input.
Interval: Auto (e.g., 100 for NIFTY) or custom strike interval.
Colors: Customizable for ATM line, labels (Futures Price, CPR, PPR, VR, PR).
Calculations:Futures Price (FP): Fetches front-month futures price (e.g., NSE:NIFTY1!).
ATM Strike: Rounds futures price to nearest strike interval.
Option Data: Retrieves Last Traded Price (LTP) and volume for ATM call/put options (e.g., NSE:NIFTY251028C24200).
Call Premium (CPR): Call LTP minus intrinsic value (max(0, FP - Strike)).
Put Premium (PPR): Put LTP minus intrinsic value (max(0, Strike - FP)).
Premium Ratio (PR): PPR / CPR.
Volume Ratio (VR): Put Volume / Call Volume.
Visuals:Draws ATM strike line on chart.
Displays labels: FP (futures price), CPR (call premium), PPR (put premium), VR, PR.
VR/PR labels: Red (≥ 1.25, bearish), Green (≤ 0.75, bullish), Gray (0.75–1.25, neutral).
Updates on last confirmed bar to avoid redraws.
Using PR and VR for Market DirectionPremium Ratio (PR):PR ≥ 1.25 (Red): High put premiums suggest bearish sentiment (expect price drop).
PR ≤ 0.75 (Green): High call premiums suggest bullish sentiment (expect price rise).
0.75 < PR < 1.25 (Gray): Neutral, no clear direction.
Use: High PR favors bearish trades (e.g., buy puts); low PR favors bullish trades (e.g., buy calls).
Volume Ratio (VR):VR ≥ 1.25 (Red): High put volume indicates bearish activity.
VR ≤ 0.75 (Green): High call volume indicates bullish activity.
0.75 < VR < 1.25 (Gray): Neutral trading activity.
Use: High VR suggests bearish moves; low VR suggests bullish moves.
Combined Signals:High PR & VR: Strong bearish signal; consider put buying or call selling.
Low PR & VR: Strong bullish signal; consider call buying or put selling.
Mixed/Neutral: Use price action or support/resistance for confirmation.
Tips:Combine with technical analysis (e.g., trends, levels).
Match timeframe to trading horizon (e.g., 15-min for intraday).
Monitor FP for context; check volatility or news for accuracy.
ExampleNIFTY: FP = 24,237.50, ATM = 24,200, CPR = 120.25, PPR = 180.50, PR = 1.50 (Red), VR = 1.30 (Red).
Insight: High PR/VR suggests bearish bias; consider bearish trades if price nears resistance.
Action: Buy puts or exit longs, confirm with price action.
Conclusion: This script provides a concise tool for options traders, showing ATM strike, premiums, and PR/VR ratios. High PR/VR (≥ 1.25) signals bearish sentiment, low PR/VR (≤ 0.75) signals bullish sentiment, and neutral (0.75–1.25) suggests indecision. Combine with technical analysis for robust trading decisions in the Indian options market.
Simple VWAP + BandsSimple VWAP + Bands
A clean and customizable VWAP (Volume Weighted Average Price) indicator with standard deviation bands and RTH (Regular Trading Hours) session support.
Features:
- VWAP Line: Volume-weighted average price calculation
- Three Standard Deviation Bands: Configurable bands at 1σ, 2σ, and 3σ levels (above and below VWAP)
- RTH Session Support: Option to calculate VWAP only during regular trading hours
- Customizable Session Times: Configure your own trading session hours and timezone
- Clean Visualization: Line breaks between sessions prevent messy connections across non-trading periods
- Toggle Bands: Show/hide individual standard deviation bands as needed
Use Cases:
- Identify overbought/oversold conditions relative to volume-weighted price
- Track price deviation from VWAP during trading sessions
- Support and resistance levels based on standard deviations
- Mean reversion trading strategies
EMA 9 + VWAP Bands Crossover With Buy Sell SignalsEMA 9 + VWAP Bands Crossover With Buy Sell Signal. Includes alerts
WaveTrend RBF What it does
WT-RBF extracts a “wave” of momentum by subtracting a fast Gaussian-weighted smoother from a slow one, then robust-normalizes that wave with a median/MAD proxy to produce a z-score (z). A short EMA of z forms the signal line. Optional dynamic thresholds use the MAD of z itself so overbought/oversold levels adapt to volatility regimes.
How it’s built:
Radial (Gaussian) smoothers
Causal, exponentially-decaying weights over the last radius bars using σ (sigma) to control spread.
fast = rbf_smooth(src, fastR, fastSig)
slow = rbf_smooth(src, slowR, slowSig)
wave = fast − slow (band-pass)
Robust normalization
A two-stage EMA approximates the median; MAD is estimated from EMA of absolute deviations and scaled by 1.4826 to be stdev-comparable.
z = (wave − center) / MAD
Thresholds
Dynamic OB/OS: ±2.5 × MAD(z) (or fixed levels when disabled)
Reading the indicator
Bull Cross: z crosses above sig → momentum turning up.
Bear Cross: z crosses below sig → momentum turning down.
Exits / Bias flips: zero-line crosses (below 0 → exit long bias; above 0 → exit short bias).
Overbought/Oversold: z > +thrOB or z < thrOS. With dynamics on, the bands widen/narrow with recent noise; with dynamics off, static guides at ±2 / ±2.5 are shown.
Core Inputs
Source: Price series to analyze.
Fast Radius / Fast Sigma (defaults 6 / 2.5): Shorter radius/smaller σ = snappier, higher-freq.
Slow Radius / Slow Sigma (defaults 14 / 5.0): Larger radius/σ = smoother, lower-freq baseline.
Normalization
Robust Z-Score Window (default 200): Lookback for median/MAD proxy (stability vs responsiveness).
Small ε for MAD: Floor to avoid division by zero.
Signal & Thresholds
Dynamic Thresholds (MAD-based) (on by default): Adaptive OB/OS; toggle off to use fixed guides.
Visuals
Shade OB/OS Regions: Background highlights when z is beyond thresholds.
Show Zero Line: Midline reference.
(“Plot Cross Markers” input is present for future use.)
Fixed Dollar Risk LinesFixed Dollar Risk Lines is a utility indicator that converts a user-defined dollar risk into price distance and plots risk lines above and below the current price for popular futures contracts. It helps you place stops or entries at a consistent dollar risk per trade, regardless of the market’s tick value or tick size.
What it does:
-You choose a dollar amount to risk (e.g., $100) and a futures contract (ES, NQ, GC, YM, RTY, PL, SI, CL, BTC).
The script automatically:
-Looks up the contract’s tick value and tick size
-Converts your dollar risk into number of ticks
-Converts ticks into price distance
Plots:
-Long Risk line below current price
-Short Risk line above current price
-Optional labels show exact price levels and an information table summarizes your settings.
Key features
-Consistent dollar risk across instruments
-Supports major futures contracts with built‑in tick values and sizes
-Toggle Long and Short risk lines independently
-Customizable line width and colors (lines and labels)
-Right‑axis price level display for quick reading
-Compact info table with contract, risk, and computed prices
Typical use
-Long setups: use the green line as a stop level below entry to match your chosen dollar risk.
-Short setups: use the red line as a stop level above entry to match your chosen dollar risk.
-Quickly compare how the same dollar risk translates to distance on different contracts.
Inputs
-Risk Amount (USD)
-Futures Contract (ES, NQ, GC, YM, RTY, PL, SI, CL, BTC)
-Show Long/Short lines (toggles)
-Line Width
-Colors for lines and labels
Notes
-Designed for futures symbols that match the listed contracts’ tick specs. If your symbol has different tick value/size than the defaults, results will differ.
-Intended for educational/informational use; not financial advice.
-This tool streamlines risk placement so you can focus on execution while keeping dollar risk consistent across markets.
EMA HeatmapEMA Heatmap — Indicator Description
The EMA Order Heatmap is a visual trend-structure tool designed to show whether the market is currently trending bullish, trending bearish, or moving through a neutral consolidation phase. It evaluates the alignment of multiple exponential moving averages (EMAs) at three different structural layers: short-term daily, medium-term daily, and weekly macro trend. This creates a quick and intuitive picture of how well price movement is organized across timeframes.
Each layer of the heatmap is scored from bearish to bullish based on how the EMAs are stacked relative to each other. When EMAs are in a fully bullish configuration, the row displays a bright green or lime color. Fully bearish alignment is shown in red. Yellow tones appear when the EMAs are mixed or compressing, indicating uncertainty, trend exhaustion, or a change in market character. The three rows combined offer a concise view of whether strength or weakness is isolated to one timeframe or broad across the market.
This indicator is best used as a trend filter before making trading decisions. Traders may find more consistent setups when the majority of the heatmap supports the direction of their trade. Green-dominant conditions suggest a trending bullish environment where long trades can be favored. Red-dominant conditions indicate bearish momentum and stronger potential for short opportunities. When yellow becomes more prominent, the market may be transitioning, ranging, or gearing up for a breakout, making timing more challenging and risk higher.
• Helps quickly identify directional bias
• Highlights when trends strengthen, weaken, or turn
• Provides insight into whether momentum is supported by higher timeframes
• Encourages traders to avoid fighting market structure
It is important to recognize the limitations. EMAs are lagging indicators, so the heatmap may confirm a trend after the initial move is underway, especially during fast reversals. In sideways or low-volume environments, the structure can shift frequently, reducing clarity. This tool does not generate entry or exit signals on its own and should be paired with price action, momentum studies, or support and resistance analysis for precise trade execution.
The EMA Order Heatmap offers a clean and reliable way to stay aligned with the broader market environment and avoid lower-quality trades in indecisive conditions. It supports more disciplined decision-making by helping traders focus on setups that match the prevailing structural trend.
LogNormalLibrary "LogNormal"
A collection of functions used to model skewed distributions as log-normal.
Prices are commonly modeled using log-normal distributions (ie. Black-Scholes) because they exhibit multiplicative changes with long tails; skewed exponential growth and high variance. This approach is particularly useful for understanding price behavior and estimating risk, assuming continuously compounding returns are normally distributed.
Because log space analysis is not as direct as using math.log(price) , this library extends the Error Functions library to make working with log-normally distributed data as simple as possible.
- - -
QUICK START
Import library into your project
Initialize model with a mean and standard deviation
Pass model params between methods to compute various properties
var LogNorm model = LN.init(arr.avg(), arr.stdev()) // Assumes the library is imported as LN
var mode = model.mode()
Outputs from the model can be adjusted to better fit the data.
var Quantile data = arr.quantiles()
var more_accurate_mode = mode.fit(model, data) // Fits value from model to data
Inputs to the model can also be adjusted to better fit the data.
datum = 123.45
model_equivalent_datum = datum.fit(data, model) // Fits value from data to the model
area_from_zero_to_datum = model.cdf(model_equivalent_datum)
- - -
TYPES
There are two requisite UDTs: LogNorm and Quantile . They are used to pass parameters between functions and are set automatically (see Type Management ).
LogNorm
Object for log space parameters and linear space quantiles .
Fields:
mu (float) : Log space mu ( µ ).
sigma (float) : Log space sigma ( σ ).
variance (float) : Log space variance ( σ² ).
quantiles (Quantile) : Linear space quantiles.
Quantile
Object for linear quantiles, most similar to a seven-number summary .
Fields:
Q0 (float) : Smallest Value
LW (float) : Lower Whisker Endpoint
LC (float) : Lower Whisker Crosshatch
Q1 (float) : First Quartile
Q2 (float) : Second Quartile
Q3 (float) : Third Quartile
UC (float) : Upper Whisker Crosshatch
UW (float) : Upper Whisker Endpoint
Q4 (float) : Largest Value
IQR (float) : Interquartile Range
MH (float) : Midhinge
TM (float) : Trimean
MR (float) : Mid-Range
- - -
TYPE MANAGEMENT
These functions reliably initialize and update the UDTs. Because parameterization is interdependent, avoid setting the LogNorm and Quantile fields directly .
init(mean, stdev, variance)
Initializes a LogNorm object.
Parameters:
mean (float) : Linearly measured mean.
stdev (float) : Linearly measured standard deviation.
variance (float) : Linearly measured variance.
Returns: LogNorm Object
set(ln, mean, stdev, variance)
Transforms linear measurements into log space parameters for a LogNorm object.
Parameters:
ln (LogNorm) : Object containing log space parameters.
mean (float) : Linearly measured mean.
stdev (float) : Linearly measured standard deviation.
variance (float) : Linearly measured variance.
Returns: LogNorm Object
quantiles(arr)
Gets empirical quantiles from an array of floats.
Parameters:
arr (array) : Float array object.
Returns: Quantile Object
- - -
DESCRIPTIVE STATISTICS
Using only the initialized LogNorm parameters, these functions compute a model's central tendency and standardized moments.
mean(ln)
Computes the linear mean from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
median(ln)
Computes the linear median from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
mode(ln)
Computes the linear mode from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
variance(ln)
Computes the linear variance from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
skewness(ln)
Computes the linear skewness from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
kurtosis(ln, excess)
Computes the linear kurtosis from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
excess (bool) : Excess Kurtosis (true) or regular Kurtosis (false).
Returns: Between 0 and ∞
hyper_skewness(ln)
Computes the linear hyper skewness from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
Returns: Between 0 and ∞
hyper_kurtosis(ln, excess)
Computes the linear hyper kurtosis from log space parameters.
Parameters:
ln (LogNorm) : Object containing log space parameters.
excess (bool) : Excess Hyper Kurtosis (true) or regular Hyper Kurtosis (false).
Returns: Between 0 and ∞
- - -
DISTRIBUTION FUNCTIONS
These wrap Gaussian functions to make working with model space more direct. Because they are contained within a log-normal library, they describe estimations relative to a log-normal curve, even though they fundamentally measure a Gaussian curve.
pdf(ln, x, empirical_quantiles)
A Probability Density Function estimates the probability density . For clarity, density is not a probability .
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate for which a density will be estimated.
empirical_quantiles (Quantile) : Quantiles as observed in the data (optional).
Returns: Between 0 and ∞
cdf(ln, x, precise)
A Cumulative Distribution Function estimates the area under a Log-Normal curve between Zero and a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
ccdf(ln, x, precise)
A Complementary Cumulative Distribution Function estimates the area under a Log-Normal curve between a linear X coordinate and Infinity.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
cdfinv(ln, a, precise)
An Inverse Cumulative Distribution Function reverses the Log-Normal cdf() by estimating the linear X coordinate from an area.
Parameters:
ln (LogNorm) : Object of log space parameters.
a (float) : Normalized area .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
ccdfinv(ln, a, precise)
An Inverse Complementary Cumulative Distribution Function reverses the Log-Normal ccdf() by estimating the linear X coordinate from an area.
Parameters:
ln (LogNorm) : Object of log space parameters.
a (float) : Normalized area .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
cdfab(ln, x1, x2, precise)
A Cumulative Distribution Function from A to B estimates the area under a Log-Normal curve between two linear X coordinates (A and B).
Parameters:
ln (LogNorm) : Object of log space parameters.
x1 (float) : First linear X coordinate .
x2 (float) : Second linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
ott(ln, x, precise)
A One-Tailed Test transforms a linear X coordinate into an absolute Z Score before estimating the area under a Log-Normal curve between Z and Infinity.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 0.5
ttt(ln, x, precise)
A Two-Tailed Test transforms a linear X coordinate into symmetrical ± Z Scores before estimating the area under a Log-Normal curve from Zero to -Z, and +Z to Infinity.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
ottinv(ln, a, precise)
An Inverse One-Tailed Test reverses the Log-Normal ott() by estimating a linear X coordinate for the right tail from an area.
Parameters:
ln (LogNorm) : Object of log space parameters.
a (float) : Half a normalized area .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
tttinv(ln, a, precise)
An Inverse Two-Tailed Test reverses the Log-Normal ttt() by estimating two linear X coordinates from an area.
Parameters:
ln (LogNorm) : Object of log space parameters.
a (float) : Normalized area .
precise (bool) : Double precision (true) or single precision (false).
Returns: Linear space tuple :
- - -
UNCERTAINTY
Model-based measures of uncertainty, information, and risk.
sterr(sample_size, fisher_info)
The standard error of a sample statistic.
Parameters:
sample_size (float) : Number of observations.
fisher_info (float) : Fisher information.
Returns: Between 0 and ∞
surprisal(p, base)
Quantifies the information content of a single event.
Parameters:
p (float) : Probability of the event .
base (float) : Logarithmic base (optional).
Returns: Between 0 and ∞
entropy(ln, base)
Computes the differential entropy (average surprisal).
Parameters:
ln (LogNorm) : Object of log space parameters.
base (float) : Logarithmic base (optional).
Returns: Between 0 and ∞
perplexity(ln, base)
Computes the average number of distinguishable outcomes from the entropy.
Parameters:
ln (LogNorm)
base (float) : Logarithmic base used for Entropy (optional).
Returns: Between 0 and ∞
value_at_risk(ln, p, precise)
Estimates a risk threshold under normal market conditions for a given confidence level.
Parameters:
ln (LogNorm) : Object of log space parameters.
p (float) : Probability threshold, aka. the confidence level .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
value_at_risk_inv(ln, value_at_risk, precise)
Reverses the value_at_risk() by estimating the confidence level from the risk threshold.
Parameters:
ln (LogNorm) : Object of log space parameters.
value_at_risk (float) : Value at Risk.
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
conditional_value_at_risk(ln, p, precise)
Estimates the average loss beyond a confidence level, aka. expected shortfall.
Parameters:
ln (LogNorm) : Object of log space parameters.
p (float) : Probability threshold, aka. the confidence level .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
conditional_value_at_risk_inv(ln, conditional_value_at_risk, precise)
Reverses the conditional_value_at_risk() by estimating the confidence level of an average loss.
Parameters:
ln (LogNorm) : Object of log space parameters.
conditional_value_at_risk (float) : Conditional Value at Risk.
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and 1
partial_expectation(ln, x, precise)
Estimates the partial expectation of a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and µ
partial_expectation_inv(ln, partial_expectation, precise)
Reverses the partial_expectation() by estimating a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
partial_expectation (float) : Partial Expectation .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
conditional_expectation(ln, x, precise)
Estimates the conditional expectation of a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between X and ∞
conditional_expectation_inv(ln, conditional_expectation, precise)
Reverses the conditional_expectation by estimating a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
conditional_expectation (float) : Conditional Expectation .
precise (bool) : Double precision (true) or single precision (false).
Returns: Between 0 and ∞
fisher(ln, log)
Computes the Fisher Information Matrix for the distribution, not a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
log (bool) : Sets if the matrix should be in log (true) or linear (false) space.
Returns: FIM for the distribution
fisher(ln, x, log)
Computes the Fisher Information Matrix for a linear X coordinate, not the distribution itself.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
log (bool) : Sets if the matrix should be in log (true) or linear (false) space.
Returns: FIM for the linear X coordinate
confidence_interval(ln, x, sample_size, confidence, precise)
Estimates a confidence interval for a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate .
sample_size (float) : Number of observations.
confidence (float) : Confidence level .
precise (bool) : Double precision (true) or single precision (false).
Returns: CI for the linear X coordinate
- - -
CURVE FITTING
An overloaded function that helps transform values between spaces. The primary function uses quantiles, and the overloads wrap the primary function to make working with LogNorm more direct.
fit(x, a, b)
Transforms X coordinate between spaces A and B.
Parameters:
x (float) : Linear X coordinate from space A .
a (LogNorm | Quantile | array) : LogNorm, Quantile, or float array.
b (LogNorm | Quantile | array) : LogNorm, Quantile, or float array.
Returns: Adjusted X coordinate
- - -
EXPORTED HELPERS
Small utilities to simplify extensibility.
z_score(ln, x)
Converts a linear X coordinate into a Z Score.
Parameters:
ln (LogNorm) : Object of log space parameters.
x (float) : Linear X coordinate.
Returns: Between -∞ and +∞
x_coord(ln, z)
Converts a Z Score into a linear X coordinate.
Parameters:
ln (LogNorm) : Object of log space parameters.
z (float) : Standard normal Z Score.
Returns: Between 0 and ∞
iget(arr, index)
Gets an interpolated value of a pseudo -element (fictional element between real array elements). Useful for quantile mapping.
Parameters:
arr (array) : Float array object.
index (float) : Index of the pseudo element.
Returns: Interpolated value of the arrays pseudo element.
Amiya's Doji / Hammer / Spinning Top Breakout Strategy v5How it works
1. Pattern Detection (Previous Candle):
• Checks if total shadow length ≥ 2 × body.
• Checks if candle height (high − low) is between 10 and 21.5 points.
• If true → marks that candle as a potential Doji, Hammer, or Spinning Top.
2. Long Setup:
• LTP (close) crosses above previous candle high.
• Previous candle is a valid pattern candle.
• Stop Loss = 3 points below previous candle low.
• Take Profit = 5 × (high − low) of previous candle added to previous high.
3. Short Setup:
• LTP (close) crosses below previous candle low.
• Previous candle is a valid pattern candle.
• Stop Loss = 3 points above previous candle high.
• Take Profit = 5 × (high − low) of previous candle subtracted from previous low.
4. Visualization:
• Yellow background highlights pattern candles.
• Green ▲ and Red ▼ markers show entry points.
Deep yellow candles → represent Doji / Hammer / Spinning Top patterns
• Green triangle → Buy signal
• Red triangle → Sell signal
• Dotted green line + label → Target
• Dotted red line + label → Stop loss
• Gray background → Outside trading hours
• Auto close → All trades square off at 3:29 PM IST
Yield Curve RegimesCurrently we are seeing equities and all other risk assets rallying to new all time high. But when will this stop?
There are multiple risks/signals i am monitoring to stay at the right side of the macro trade. Macro is everything: “When you get the Big-Picture wrong you wont live long.”
So lets go through a major risk that could be the catalyst for the next deeper correction
Capital needs to begin to move BACK across the risk curve as the yield curve steepens. We don't know if the source of the the crash will be from bear steepening or bull steepening because its unclear if long end rates blowing out will be the source of the crash.
If the Fed continues to make the policy error of being overly accommodative at this high level of nominal GDP + Inflation risk, the long end of the curve will price this.
Simple: If the Fed is to lose the long end can move up to price the inflation risk, which could ultimately pull risk assets down.
We have not seen this yet because the last inflation prints came in flat, but I expect these to come in higher over the next 6 months.
This means watching long end rates and their potential drag on equities will be critical. We are not seeing this yet as the Russell is sitting at all time highs and capital continues to move into low quality factors.
Look where the long end is moving + the attribution analysis for the move.
→ Down growth risk
→ Up Inflation risk
+ look what the 2s10s & the 10s30 are pricing and how these changes in the curve connect to the current yield curve regimes.
You can get the Trading view Skript 100% free here
NASDAQ Trading System with PivotsThis TradingView indicator, designed for the 30-minute NASDAQ (^IXIC) chart, guides QQQ options trading using a trend-following strategy. It plots a 20-period SMA (blue) and a 100-period SMA (red), with an optional 250-period SMA (orange) inspired by rauItrades' NASDAQ SMA outfit. A bullish crossover (20 SMA > 100 SMA) triggers a green "BUY" triangle below the bar, signaling a potential long position in QQQ, while a bearish crossunder (20 SMA < 100 SMA) shows a red "SELL" triangle above, indicating a short or exit. The background colors green (bullish) or red (bearish) for trend bias. Orange circles (recent highs) and purple circles (recent lows) mark support/resistance levels using 5-bar pivot points.
Svopex Session Highlighter# Session Highlighter
## Description
**Session Highlighter** is a powerful Pine Script indicator designed to visually identify and mark specific trading hours on your chart. This tool helps traders focus on their preferred trading sessions by highlighting the background during active hours and marking the session start with customizable visual markers.
## Key Features
- **📊 Session Background Highlighting**: Automatically shades the chart background during your defined trading hours (default: 7:00 - 23:00)
- **🎯 Smart Session Start Marker**: Places a marker on the last candle before session start, intelligently adapting to your timeframe:
- 1 Hour chart: Marker at 6:00
- 15 Minute chart: Marker at 6:45
- 5 Minute chart: Marker at 6:55
- 1 Minute chart: Marker at 6:59
- **🌍 Timezone Support**: Choose from multiple timezones (Europe/Prague, Europe/London, America/New_York, UTC)
- **🎨 5 Marker Styles**: Customize your session start indicator:
- Triangle
- Circle
- Diamond
- Label with time text
- Vertical line
- **⚙️ Fully Customizable**: Adjust start/end hours, timezone, and marker style through simple settings
## Settings
- **Start Hour**: Set your session start time (0-23)
- **End Hour**: Set your session end time (0-23)
- **Timezone**: Select your trading timezone
- **Marker Style**: Choose your preferred visual marker
## Use Cases
- Identify London/New York trading sessions
- Mark Asian session hours
- Highlight your personal trading windows
- Avoid trading during off-hours
- Perfect for day traders and scalpers
## Installation
1. Copy the Pine Script code
2. Open TradingView Pine Editor
3. Paste the code and click "Add to Chart"
4. Configure settings to match your trading schedule
NY Midnight High/Low Arrows (Auto-Show)🇺🇸 English Explanation
This indicator automatically marks the daily high and low of the New York session.
It draws arrows (▼▲) at the highest and lowest prices after New York midnight (00:00),
and can optionally display small horizontal dotted lines at those levels.
It helps traders identify daily liquidity zones and key turning points in price action.
🇸🇦 الشرح بالعربية
هذا المؤشر يحدد القمة والقاع اليومية لجلسة نيويورك بشكل تلقائي.
يرسم أسهماً (▼▲) عند أعلى وأدنى سعر بعد منتصف الليل بتوقيت نيويورك (00:00)،
ويمكنه أيضًا عرض خطوط أفقية منقطة صغيرة عند تلك المستويات.
يساعد المتداول في معرفة مناطق السيولة اليومية ونقاط الانعكاس المهمة في حركة السعر.
Market Opens + Killzones — New York, Tokyo & London (SMC/ICT)Market Opens + Killzones — New York, London & Tokyo (SMC/ICT) — TradingATH
Precision. Timing. Liquidity.
This refined overlay defines the world’s three dominant trading sessions — New York , London & Tokyo — plus their critical overlap. Each Opening and Killzone is plotted with full-height visual blocks and precise time anchoring, giving you an immediate understanding of when and where true price delivery begins.
Designed for ICT and SMC Traders , it provides a disciplined structure to navigate intraday volatility — aligning executions with the moments institutional liquidity enters the market.
What You’ll See
New York Killzone (08:30 – 10:30 NY) → Gray full-height Block
London Killzone (07:00 – 10:00 London) → Dark-gray Block
Tokyo Killzone (09:00 – 11:00 Tokyo) → Black Block
London–New York Overlap (13:30 – 16:00 London) → Blue Block
Session Opening Lines : Precise vertical markers with optional labels and customizable color, style, and width.
Every Block extends from chart top to bottom — forming crystal-clear time partitions that highlight where volatility and liquidity converge.
Features
True global time synchronization — automatic daylight-saving adjustment; no manual offset needed.
Full-height killzones — visually structured blocks that scale seamlessly across any timeframe.
Configurable session openings — control color, line width, label visibility, and transparency.
Daily auto-reset — clean, non-repainting visuals with no overlap or drift.
Lightweight performance — optimized rendering with zero lag, even on lower timeframes.
Perfect For
Intraday and Scalping Traders timing executions around session volatility.
ICT / Smart Money Concepts practitioners focusing on liquidity windows.
Traders seeking precise, time-based market context for entries and exits.
Recommended Settings
Line Width: 3–4 px for optimal visibility.
Block Transparency: 60 – 75 % for clean chart integration.
Focus: London + New York sessions for highest liquidity.
In Short
Simple. Accurate. Powerful.
Market Opens + Killzones — New York, London & Tokyo (SMC/ICT) delivers a clean, professional mapping of institutional trading hours — allowing you to trade exactly when the market moves with purpose.
Created by: TradingATH
[Kpt-Ahab] Assistant: Risk & DCA PlannerScript Description – Assistant: Risk & DCA Planner
The Risk & DCA Planner is a technical assistant for position and risk management.
It automatically calculates, based on volatility (ATR%), swing structure, and your settings:
Stop-Loss (SL) and corresponding Take-Profit targets (TPs) in R-multiples
DCA (Dollar-Cost-Averaging) levels — both price and amount
A market suitability check (based on volatility & volume)
Plus a clear table and summary label displayed on the chart
The script helps you plan risk, scaling, and profit targets consistently and quantitatively.
Core Logic
Risk Profile
Three modes: Low, Normal, High.
These define how reactive the script behaves internally:
Low → conservative, longer lookbacks, tighter analysis
Normal → balanced
High → aggressive, faster reaction, wider stops
Stop-Loss (SL)
Automatically calculated from ATR% and recent swing structure, limited by minimum and maximum thresholds.
The SL percentage defines the R-unit, which all TPs and DCA levels are based on.
Take-Profits (TPs)
Up to six targets, each a multiple of the defined risk (e.g., 1R, 2R, 3R).
Prices are automatically adjusted depending on long or short direction.
DCA Strategy
Optional. Adds scaling levels evenly between Entry and SL or in multiples of the ATR.
Each DCA allocation grows geometrically until the maximum position size is reached.
Suitability Check
Evaluates whether the market is within an appropriate ATR% range and has sufficient volume.
The table displays “OK” or “Caution” depending on volatility and historical consistency.
Visualization
Lines for SL, TPs, and DCA levels
A table with all parameters, prices, and risk data
A chart label summarizing key info (profile, direction, SL%, TPs, DCA, etc.)
Turtle/Donchian Screener — Recency & CloseAtBuyTurtle strategy, donchian channels. For Pine screener with for example buysignals and sellsignals.






















