enhanced_taLibrary "enhanced_ta"
ma(source, maType, length)
returns custom moving averages
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: moving average for the given type and length
atr(maType, length)
returns ATR with custom moving average
Parameters:
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: ATR for the given moving average type and length
atrpercent(maType, length)
returns ATR as percentage of close price
Parameters:
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: ATR as percentage of close price for the given moving average type and length
bb(source, maType, length, multiplier, sticky)
returns Bollinger band for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger band with custom moving average for given source, length and multiplier
bbw(source, maType, length, multiplier, sticky)
returns Bollinger bandwidth for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger Bandwidth for custom moving average for given source, length and multiplier
bpercentb(source, maType, length, multiplier, sticky)
returns Bollinger Percent B for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger Percent B for custom moving average for given source, length and multiplier
kc(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Channel for custom moving average for given souce, length and multiplier
kcw(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel Width with custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Channel Width for custom moving average
kpercentk(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel Percent K Width with custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Percent K for given moving average, source, length and multiplier
dc(length, useAlternateSource, alternateSource, sticky)
returns Custom Donchian Channel
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel
dcw(length, useAlternateSource, alternateSource, sticky)
returns Donchian Channel Width
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel width
dpercentd(length, useAlternateSource, alternateSource, sticky)
returns Donchian Channel Percent of price
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel Percent D
oscillatorRange(source, method, highlowLength, rangeLength, sticky)
oscillatorRange - returns Custom overbought/oversold areas for an oscillator input
Parameters:
source (float) : - Osillator source such as RSI, COG etc.
method (simple string) : - Valid values for method are : sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
highlowLength (simple int) : - length on which highlow of the oscillator is calculated
rangeLength (simple int) : - length used for calculating oversold/overbought range - usually same as oscillator length
sticky (simple bool) : - overbought, oversold levels won't change unless crossed
Returns: Dynamic overbought and oversold range for oscillator input
oscillator(type, length, shortLength, longLength, source, highSource, lowSource, method, highlowLength, sticky)
oscillator - returns Choice of oscillator with custom overbought/oversold range
Parameters:
type (simple string) : - oscillator type. Valid values : cci, cmo, cog, mfi, roc, rsi, stoch, tsi, wpr
length (simple int) : - Oscillator length - not used for TSI
shortLength (simple int) : - shortLength only used for TSI
longLength (simple int) : - longLength only used for TSI
source (float) : - custom source if required
highSource (float) : - custom high source for stochastic oscillator
lowSource (float) : - custom low source for stochastic oscillator
method (simple string) : - Valid values for method are : sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
highlowLength (simple int) : - length on which highlow of the oscillator is calculated
sticky (simple bool) : - overbought, oversold levels won't change unless crossed
Returns: Oscillator value along with dynamic overbought and oversold range for oscillator input
multibands(bandType, source, maType, length, useTrueRange, sticky, numberOfBands, multiplierStart, multiplierStep)
multibands - returns Choice of oscillator with custom overbought/oversold range
Parameters:
bandType (simple string) : - Band type - can be either bb or kc
source (float) : - custom source if required
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : - Oscillator length - not used for TSI
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - for sticky borders which only change upon source crossover/crossunder
numberOfBands (simple int) : - Number of bands to generate
multiplierStart (simple float) : - Starting ATR or Standard deviation multiplier for first band
multiplierStep (simple float) : - Incremental value for multiplier for each band
Returns: array of band values sorted in ascending order
mbandoscillator(bandType, source, maType, length, useTrueRange, stickyBands, numberOfBands, multiplierStart, multiplierStep)
mbandoscillator - Multiband oscillator created on the basis of bands
Parameters:
bandType (simple string) : - Band type - can be either bb or kc
source (float) : - custom source if required
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : - Oscillator length - not used for TSI
useTrueRange (simple bool) : - if set to false, uses high-low.
stickyBands (simple bool) : - for sticky borders which only change upon source crossover/crossunder for band detection
numberOfBands (simple int) : - Number of bands to generate
multiplierStart (simple float) : - Starting ATR or Standard deviation multiplier for first band
multiplierStep (simple float) : - Incremental value for multiplier for each band
Returns: oscillator currentStates - Array containing states for last n bars
timer(timeStart, timeEnd)
finds difference between two timestamps
Parameters:
timeStart (int) : - start timestamp
timeEnd (int)
Indicateurs et stratégies
arrayutilsLibrary "arrayutils"
delete(arr, index)
remove an item from array at specific index. Also deletes the item
Parameters:
arr (array) : - array from which the item needs to be deleted
index (int) : - index of item to be deleted
Returns: void
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
pop(arr)
remove the last item from array. Also deletes the item
Parameters:
arr (array) : - array from which the last item needs to be removed and deleted
Returns: void
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
shift(arr)
remove an item from array at index 0. Also deletes the item
Parameters:
arr (array) : - array from which the first item needs to be removed and deleted
Returns: void
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
unshift(arr, val, maxItems)
add an item to the beginning of an array with max items cap
Parameters:
arr (array) : - array to which the item needs to be added at the beginning
val (int) : - value of item which needs to be added
maxItems (simple int) : - max items array can hold. After that, items are removed from the other end
Returns: resulting array
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
clear(arr)
remove and delete all items in an array
Parameters:
arr (array) : - array which needs to be cleared
Returns: void
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
push(arr, val, maxItems)
add an item to the end of an array with max items cap
Parameters:
arr (array) : - array to which the item needs to be added at the beginning
val (int) : - value of item which needs to be added
maxItems (simple int) : - max items array can hold. After that, items are removed from the starting index
Returns: resulting array
push(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
check_overflow(a, b, c, pivots, barArray)
finds difference between two timestamps
Parameters:
a (float)
b (float)
c (float)
pivots (array) : pivots array
barArray (array) : pivot bar array
Returns: bool overflow
get_trend_series(pivots, length, highLow, trend)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
length (int) : length for which trend series need to be checked
highLow (int) : filter pivot high or low
trend (int) : Uptrend or Downtrend
Returns: int trendIndexes
get_trend_series(pivots, firstIndex, lastIndex)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
firstIndex (int) : First index of the series
lastIndex (int) : Last index of the series
Returns: int trendIndexes
sma(source)
calculates sma for elements in array
Parameters:
source (array) : source array
Returns: float sma
ema(source, length)
calculates ema for elements in array
Parameters:
source (array) : source array
length (simple int) : ema length
Returns: float ema
rma(source, length)
calculates rma for elements in array
Parameters:
source (array) : source array
length (simple int) : rma length
Returns: float rma
wma(source, length)
calculates wma for elements in array
Parameters:
source (array) : source array
length (simple int) : wma length
Returns: float wma
hma(source, length)
calculates hma for elements in array
Parameters:
source (array) : source array
length (simple int) : hma length
Returns: float hma
ma(source, matype, length)
wrapper for all moving averages based on array
Parameters:
source (array) : source array
matype (simple string) : moving average type. Valud values are: sma, ema, rma, wma, hma, high, low, median, medianHigh, medianLow
length (simple int) : moving average length length
Returns: float moving average
getFibSeries(numberOfFibs, start)
gets fib series in array
Parameters:
numberOfFibs (simple int) : number of fibs
start (simple int) : starting number
Returns: float fibArray
Macro Momentum – 4-Theme, Vol Target, RebalanceMacro Momentum — 4-Theme, Vol Target, Rebalance
Purpose. A macro-aware strategy that blends four economic “themes”—Business Cycle, Trade/USD, Monetary Policy, and Risk Sentiment—into a single, smoothed Composite signal. It then:
gates entries/exits with hysteresis bands,
enforces optional regime filters (200-day bias), and
sizes the position via volatility targeting with caps for long/short exposure.
It’s designed to run on any chart (index, ETF, futures, single stocks) while reading external macro proxies on a chosen Signal Timeframe.
How it works (high level)
Build four theme signals from robust macro proxies:
Business Cycle: XLI/XLU and Copper/Gold momentum, confirmed by the chart’s price vs a long SMA (default 200D).
Trade / USD: DXY momentum (sign-flipped so a rising USD is bearish for risk assets).
Monetary Policy: 10Y–2Y curve slope momentum and 10Y yield trend (steepening & falling 10Y = risk-on; rising 10Y = risk-off).
Risk Sentiment: VIX momentum (bearish if higher) and HYG/IEF momentum (bullish if credit outperforms duration).
Normalize & de-noise.
Optional Winsorization (MAD or stdev) clamps outliers over a lookback window.
Optional Z-score → tanh mapping compresses to ~ for stable weighting.
Theme lines are SMA-smoothed; the final Composite is LSMA-smoothed (linreg).
Decide direction with hysteresis.
Enter/hold long when Composite ≥ Entry Band; enter/hold short when Composite ≤ −Entry Band.
Exit bands are tighter than entry bands to avoid whipsaws.
Apply regime & direction constraints.
Optional Long-only above 200MA (chart symbol) and/or Short-only below 200MA.
Global Direction control (Long / Short / Both) and Invert switch.
Size via volatility targeting.
Realized close-to-close vol is annualized (choose 9-5 or 24/7 market profile).
Target exposure = TargetVol / RealizedVol, capped by Max Long/Max Short multipliers.
Quantity is computed from equity; futures are rounded to whole contracts.
Rebalance cadence & execution.
Trades are placed on Weekly / Monthly / Quarterly rebalance bars or when the sign of exposure flips.
Optional ATR stop/TP for single-stock style risk management.
Inputs you’ll actually tweak
General
Signal Timeframe: Where macro is sampled (e.g., D/W).
Rebalance Frequency: Weekly / Monthly / Quarterly.
ROC & SMA lengths: Defaults for theme momentum and the 200D regime filter.
Normalization: Z-score (tanh) on/off.
Winsorization
Toggle, lookback, multiplier, MAD vs Stdev.
Risk / Sizing
Target Annualized Vol & Realized Vol Lookback.
Direction (Long/Short/Both) and Invert.
Max long/short exposure caps.
Advanced Thresholds
Theme/Composite smoothing lengths.
Entry/Exit bands (hysteresis).
Regime / Execution
Long-only above 200MA, Short-only below 200MA.
Stops/TP (optional)
ATR length and SL/TP multiples.
Theme Weights
Per-theme scalars so you can push/pull emphasis (e.g., overweight Policy during rate cycles).
Macro Proxies
Symbols for each theme (XLI, XLU, HG1!, GC1!, DXY, US10Y, US02Y, VIX, HYG, IEF). Swap to alternatives as needed (e.g., UUP for DXY).
Signals & logic (under the hood)
Business Cycle = ½ ROC(XLI/XLU) + ½ ROC(Copper/Gold), then confirmed by (price > 200SMA ? +1 : −1).
Trade / USD = −ROC(DXY).
Monetary Policy = 0.6·ROC(10Y–2Y) − 0.4·ROC(10Y).
Risk Sentiment = −0.6·ROC(VIX) + 0.4·ROC(HYG/IEF).
Each theme → (optional Winsor) → (robust z or scaled ROC) → tanh → SMA smoothing.
Composite = weighted average → LSMA smoothing → compare to bands → dir ∈ {−1,0,+1}.
Rebalance & flips. Orders fire on your chosen cadence or when the sign of exposure changes.
Position size. exposure = clamp(TargetVol / realizedVol, maxLong/Short) × dir.
Note: The script also exposes Gross Exposure (% equity) and Signed Exposure (× equity) as diagnostics. These can help you audit how vol-targeting and caps translate into sizing over time.
Visuals & alerts
Composite line + columns (color/intensity reflect direction & strength).
Entry/Exit bands with green/red fills for quick polarity reads.
Hidden plots for each Theme if you want to show them.
Optional rebalance labels (direction, gross & signed exposure, σ).
Background heatmap keyed to Composite.
Alerts
Enter/Inc LONG when Composite crosses up (and on rebalance bars).
Enter/Inc SHORT when Composite crosses down (and on rebalance bars).
Exit to FLAT when Composite returns toward neutral (and on rebalance bars).
Practical tips
Start higher timeframes. Daily signals with Monthly rebalance are a good baseline; weekly signals with quarterly rebalances are even cleaner.
Tune Entry/Exit bands before anything else. Wider bands = fewer trades and less noise.
Weights reflect regime. If policy dominates markets, raise Monetary Policy weight; if credit stress drives moves, raise Risk Sentiment.
Proxies are swappable. Use UUP for USD, or futures-continuous symbols that match your data plan.
Futures vs ETFs. Quantity auto-rounds for futures; ETFs accept fractional shares. Check contract multipliers when interpreting exposure.
Caveats
Macro proxies can repaint at the selected signal timeframe as higher-TF bars form; that’s intentional for macro sampling, but test live.
Vol targeting assumes reasonably stationary realized vol over the lookback; if markets regime-shift, revisit volLook and targetVol.
If you disable normalization/winsorization, themes can become spikier; expect more hysteresis band crossings.
What to change first (quick start)
Set Signal Timeframe = D, Rebalance = Monthly, Z-score on, Winsor on (MAD).
Entry/Exit bands: 0.25 / 0.12 (defaults), then nudge until trade count and turnover feel right.
TargetVol: try 10% for diversified indices; lower for single stocks, higher for vol-sell strategies.
Leave weights = 1.0 until you’ve inspected the four theme lines; then tilt deliberately.
LW Outside Day Strategy[SpeculationLab]This strategy is based on the concept of the Outside Day Pattern described by Larry Williams in his book “Long-Term Secrets to Short-Term Trading”.
The Outside Day is a classic price action pattern often seen during market reversals or acceleration phases.
Strategy Logic
Outside Bar Detection
Current day’s high is higher than the previous high, and the low is lower than the previous low.
A body-size filter is applied: only bars with significantly larger bodies than the previous bar are considered valid.
Directional Confirmation
Close below the previous day’s low → Buy signal.
Close above the previous day’s high → Sell signal.
Stop Loss Options
Prev Low/High: Uses the previous swing low/high with buffer adjustment.
ATR: Stop loss based on volatility (ATR).
Fixed Pips: Uses a fixed pip distance defined by the user.
Take Profit Options
Prev High/Low (PHL): Targets the previous swing high/low.
Risk-Reward (RR): Targets based on user-defined risk-to-reward ratio.
Following Price Open (FPO): Exits at the next day’s open if price opens in profit.
Signal Markers
Buy/Sell signals are plotted on the chart (triangles).
Stop loss and target reference lines are drawn automatically.
Usage Notes
Timeframe: Best suited for Daily charts.
Markets: Works across stocks, forex, and crypto markets.
Disclaimer: This strategy is for educational and research purposes only. It does not guarantee profits and should not be considered financial advice. Please manage your own risk responsibly.
本策略基于美国著名交易大师 Larry Williams 在其著作《Long-Term Secrets to Short-Term Trading(短线交易的长线秘诀)》中提出的 Outside Day(外包线形态)。外包线是一种典型的价格行为形态,常出现在趋势反转或加速阶段。
策略逻辑
外包线识别
当日最高价高于前一日最高价,且当日最低价低于前一日最低价,即形成外包线。
同时过滤掉较小实体的 K 线,仅保留实体显著大于前一根的形态。
方向过滤
收盘价低于前一日最低价 → 视为买入信号。
收盘价高于前一日最高价 → 视为卖出信号。
止损设置(可选参数)
前低/高止损:以形态前低/前高为止损,带有缓冲倍数。
ATR 止损:根据平均波动率(ATR)动态调整。
固定点数止损:按照用户设定的点数作为止损范围。
止盈设置(可选参数)
前高/低止盈(PHL):以前高/前低为目标。
固定盈亏比(RR):根据用户设定的风险回报比自动计算。
隔夜开盘(FPO):若次日开盘价高于进场价(多单)或低于进场价(空单),则平仓。
信号标记
在图表中标注买入/卖出信号(三角形标记)。
绘制止损与目标位参考线。
使用说明
适用周期:建议用于 日线图(Daily)。
适用市场:股票、外汇、加密货币等各类市场均可。
提示:此策略为历史研究与学习用途,不构成投资建议。实际交易请结合自身风险管理。
Long Elite Squeeze (LES 2.1) NV/CDV AI LindsayLES 2.1 — Long Elite Squeeze
Creator: Hunter Hammond •: Elite × FineFir H.H (AI “Lindsay”)
Discord: elitexfinefir
LES (“Long Elite Squeeze”) is a momentum + flow-aware long strategy built for small-float, high-velocity stocks. It blends a classic squeeze engine (BB/KC), adaptive RVOL/RSI gating, VWAP slope, ADX trend filtering, WaveTrend timing, and new Net-Volume/CVD flow exits—all wrapped with on-chart HUDs, a trade tracker, trap detection, and a lightweight AI selector to adapt entries to live conditions.
Who it’s for (and where it thrives)
LES 2.1 is tuned for the morning session and stocks that can really move:
Top Pre-Market and Day Gainers
Highest or Top Volume on Day
Float: ≤ 40M
Price: ≤ $20
Volume: ≥ 5× the 30-day average (intraday RVOL pop)
Catalyst: ideally a fresh news driver / “day gainer”
Timeframe: 1-minute (designed & tuned for 1m). Works on 2m/3m/5m, but wasn’t specifically designed for them (see tuning tips below).
Evolution at a glance
LES 1.0 — The foundation
Squeeze engine using Bollinger vs. Keltner to detect expansion (“squeeze OFF”).
EMA – ATR offset line (dynamic risk anchor) with EMA as trend filter.
RSI guard for overheated moves.
RVOL confirmation using average volume lookback.
WaveTrend (WT + Signal) to time entries/exits.
Basic buy/sell logic + simple on-chart labels.
LES 2.0 — Quality-of-life & timing upgrades
AI Lindsay assistant v2 (periodic / contextual commentary).
VWAP Slope Detector with sensitivity modes (Loose → Very Strict).
Manual defaults pre-tuned for ease of use.
Double-EMA trailing (visual take-profit helper).
Improved on-chart commentary and Trade Summary (10:30am snapshot).
AI Version Suggester (V1/V2/V3 modes) with stickiness/cooldown.
Trap Detector Pro (sweep, VWAP reject, blow-off, etc.) with scored severity.
Trade Tracker HUD + Entry Checklist HUD.
Overall stability & UX polish.
LES 2.1 — Flow-based exit superpowers
New Flow Exit: integrates 1m Net Volume and 5m CVD-style pressure:
1m NetVol window (rolling sum of signed volume)
5m CVD window (downsampled, smoothed)
Debounce (consecutive red bars to avoid one-tick fakes)
Optional ATR Guard (only exit if the move is meaningful vs ATR)
Cooldown after a flow exit to avoid re-chop
Chart labels: “SELL (NV/CVD)” when flow triggers
Keeps you in good trends, but kicks you out when aggressive sellers actually show up.
How the engine works (plain English)
Market prep: We confirm trend & energy using EMA/ATR, RSI, RVOL, Squeeze OFF, and Price > VWAP.
Entry mode (V1/V2/V3):
V1 — Balanced trades (default “safe” behavior)
V2 — Fast trades (more aggressive when action heats up)
V3 — Trending trades (stricter; waits for strong slope & trend)
You can pick a version manually or let the AI Suggester switch modes based on slope/ADX/RVOL/acceleration (with a cooldown so it doesn’t flip-flop).
Entry timing: WaveTrend and squeeze momentum improve timing while VWAP slope avoids buying flat tape.
Risk anchor: The EMA – (ATR × Multiplier) “offset line” is your dynamic stop/line in the sand.
Exits:
Base exits (version-aware): WT crossback, momentum fade, price losing offsetLine or EMA.
Flow Exit (2.1): If 1m NetVol and 5m CVD both turn decisively red (with debounce and optional ATR guard), close—no arguing.
Entry rules (exactly what has to be true)
Buy (Core) — fires when all are true:
Not already in a trade
Close > EMA and Close > OffsetLine (offsetLine = EMA − ATR × Mult)
RVOL confirmed (meets dynamic RVOL multiplier)
RSI below the overbought ceiling (version-aware slack in V3)
Squeeze OFF (BBs expanded outside Keltner)
Price > VWAP (toggleable)
Extra for V3 (Trending trades):
VWAP slope gate passes (and, if set, VWAP must be green)
ADX strong (≥ 25 by design, ≥ 20 baseline)
Minimum slopePctPerBar met (default V3 expects ≥ 0.05%/bar)
AI Suggester (optional):
Scores V1/V2/V3 from conditions like ADX, VWAP slope, RVOL, intrabar acceleration, then locks a pick for aiSwitchCoolBars bars.
On-chart help:
Checklist HUD lights up ✅/❌ for each gate (EMA, ATR, RVOL, RSI, VWAP, Slope, etc.).
Trade Quality Rating (🌟x/10) appears on buy bars if enabled.
Exit rules (every sell condition)
Base sells (V1/V2):
WaveTrend crossback (signal crosses over WT) OR
Momentum fade (two darker squeeze momentum bars) OR
Close < OffsetLine OR Close < EMA
Base sells (V3):
Close < OffsetLine OR Close < EMA (trend-respecting; ignores WT/momentum so you’re not shaken out early)
Flow Exit (2.1, applies to all versions if enabled):
In trade AND Flow Exit enabled
1m NetVol window is red (and ≥ Min |NetVol|)
5m CVD (smoothed) is red
**Deb
*** FYI: Play with settings until it fits your style, everything thats set default when script is loaded is what I run currently. I made LES 2.1 more customizable than ever to meet every trades style and execution. LES 2.1 with Lindsay upgrade new AI trade tracking feature (when enabled) and risk management LES 2.1 is something special to meet many challenges a trader faces everyday.
LW Outside Day Flip[SpeculationLab]Applicable Timeframe
⚠️ Note: This indicator is primarily designed for the Daily timeframe.
Larry Williams’ original discussion and statistics were based on daily data. While it can technically be applied to other timeframes, results may vary. It is strongly recommended to use it on daily charts.
Overview
This indicator marks a classic “Outside Day + Extreme Close” price action pattern. The idea comes from Larry Williams’ Long-Term Secrets to Short-Term Trading (2nd edition, Chapter 7).
The indicator does not execute trades or generate alerts — it simply plots visual markers on the chart when the pattern conditions are met, to assist research and review.
Logic
Outside Bar Condition
Current high > previous high
Current low < previous low
Extreme Close Filter
Long signal: Close < previous low
Short signal: Close > previous high
Confirmation
Signals are only confirmed at bar close (barstate.isconfirmed), to avoid repainting during intrabar movement.
Chart Display
When a long signal is triggered, a green downward triangle is plotted above the bar.
When a short signal is triggered, a red upward triangle is plotted below the bar.
Signals are overlaid directly on the price chart (overlay=true) and serve only as visual cues.
Usage Notes
Best used as a filter or secondary confirmation tool, not as a standalone entry trigger.
Consider combining with higher timeframe trend, key support/resistance, or volume analysis.
Entries, stop losses, and profit targets should be defined and tested independently by the trader.
Limitations and Risks
In strong trending markets, these signals may fail.
In low-liquidity or gapping conditions, accuracy may be reduced.
A single candlestick pattern cannot ensure consistent profitability.
Disclaimer
This script is for educational and research purposes only. It is not financial advice. Trading carries risk, and users are solely responsible for their own decisions and results.
===================
指标适用范围
⚠️ 特别提示:本指标主要适用于日线图(Daily Timeframe)。
Larry Williams 的原始讨论与统计均基于日线数据。虽然技术上可以在其它周期应用,但效果可能会不同,建议严格以日线作为主要参考周期。
功能概述
本指标用于在图表上标记一种经典的“外包线 + 极端收盘”的价格行为形态。思路参考 Larry Williams 在《Long-Term Secrets to Short-Term Trading》(第二版,第七章)中对日线“Outside Day”与反向收盘的讨论。指标不包含交易执行或提醒功能,仅在满足条件时绘制信号标记,用于辅助研究。
计算逻辑
外包线(Outside Bar)判定
最高价高于前一根K线的最高价;
最低价低于前一根K线的最低价。
极端收盘过滤
做多信号(Long):收盘价低于前一根K线的最低价;
做空信号(Short):收盘价高于前一根K线的最高价。
确认方式
仅在K线收盘后确认(避免盘中信号反复出现/消失)。
绘图说明
触发做多条件时,在K线 上方 绘制 绿色 向下三角形标记。
触发做空条件时,在K线 下方 绘制 红色 向上三角形标记。
信号直接叠加在价格图上(overlay=true),仅作提示。
使用建议
建议作为筛选条件或二次确认工具,不要单独作为入场依据;
可以配合趋势方向、关键支撑/阻力、成交量等其他因素一起使用;
入场、止损与止盈需由使用者自行定义和验证。
限制与风险
在强趋势行情中,信号可能失效;
在低流动性或跳空行情中,信号准确度下降;
单一形态不能保证稳定盈利。
免责声明
本指标仅用于教育与研究,不构成投资建议。实际交易风险由使用者自行承担。
EMA Candle Color
A customizable EMA indicator. colors candles based on their position relative to the moving average.
Candles turn one color when trading above the EMA (bullish) and another color when below (bearish), providing instant visual trend confirmation.
Includes adjustable buy/sell signals when price crosses the EMA, with fully customizable colors for all elements.
Perfect for quick trend identification across any timeframe.
Features adjustable EMA length, toggle options for signals and EMA line display, and (built-in alerts) for crossover events.
VIP move to top in object tree to maintain candle colors from switching back...
LETS GO!!
EL
Gap ZonesThis TradingView indicator automatically detects daily price gaps and plots them clearly on any timeframe (intraday or daily).
It helps visualize where unfilled gaps are sitting, track whether they’ve been filled, and control how far the zone extends.
Key Features
1. Daily Gap Detection
• Works even when you’re on intraday charts (uses daily OHLC data).
• Marks both gap up (potential support zones) and gap down (potential resistance zones).
2. Shaded Gap Zones
• Each gap is highlighted as a band (greenish for up, reddish for down).
• Option to turn shading off if you just want horizontal lines.
3. Hide When Filled
• Once price closes or touches the far side of the gap, it disappears (configurable: Touch vs Close).
4. Lookback Window
• Gaps only show if they occurred within the past X trading days (default: 30).
• Prevents your chart from being cluttered with ancient gaps.
5. Multiple Gaps Tracked
• Can track up to 5 recent gaps simultaneously.
• Oldest gaps “roll off” as new ones form.
6. Finite Right-Edge Guides
• Optional horizontal guide lines extend to the right, but only for a fixed number of bars (default: 50).
• Cleaner than infinite extensions.
7. Gap-Day Marker
• Optional vertical line drawn on the bar where the gap first occurred.
⸻
⚙️ Inputs & Settings
When you apply the indicator, you’ll see these options:
• Lookback (trading days): How far back to scan for gaps (default 30).
• Max gaps to show (1..5): How many simultaneous gap zones to display.
• Min gap size (% of prior close): Filter out tiny gaps (default 0.25%).
• Hide gaps once filled: Removes a gap from the chart once filled.
• Fill rule uses CLOSE (off = Touch):
• Touch = filled when price trades through the level intraday.
• Close = filled only when a candle close crosses it.
• Show shading: Toggle zone fills on/off.
• Show vertical marker on gap day: Toggle gap-day marker line.
• Show finite right-edge lines: Toggle horizontal lines extending right.
• Right line length (bars): How far those lines extend (default 50 bars).
⸻
🟢 How to Use It
1. Apply on Any Chart
• Works best on daily or intraday (5m, 15m, 1h).
• Gaps are always calculated from daily data, so intraday charts will show higher-timeframe gaps correctly.
2. Interpret Colors
• Green shading = Gap Up (often acts as support).
• Red shading = Gap Down (often acts as resistance).
3. Watch for Fills
• When price re-enters the gap zone, the indicator checks if it’s “filled” (based on your Touch/Close setting).
• If “Hide When Filled” is on, the zone vanishes.
4. Trade Context
• Many traders use gaps as targets (expecting a fill) or levels of support/resistance.
• Combined with your bull put/bear call spread strategies, it helps confirm strong levels.
Al Brooks II.IOI.OO# Al Brooks Consecutive Bar Patterns (II/OO/IOI)
## Overview
This indicator automatically identifies Al Brooks' key consecutive bar patterns that signal important market transitions. Enhanced with both **traditional (high/low)** and **body (open/close)** detection methods for more accurate signals.
## Pattern Definitions
### 📊 II Pattern - Double Inside Bars
- **Signal**: Two consecutive inside bars
- **Market Meaning**: Volatility contraction, breakout pending
- **Trading**: Wait for breakout, trade with momentum
### 📊 OO Pattern - Double Outside Bars
- **Signal**: Two consecutive outside bars
- **Market Meaning**: Volatility expansion, trend acceleration or reversal
- **Trading**: Watch for exhaustion at key levels
### 📊 IOI Pattern - Inside-Outside-Inside
- **Signal**: Inside bar → Outside bar → Inside bar sequence
- **Market Meaning**: Market indecision, complex consolidation
- **Trading**: Avoid early entries, wait for clear direction
## Features
✅ **Dual Detection System**
- Traditional: Uses high/low prices (catches wicks)
- Body: Uses open/close prices (focuses on real trading range)
- Combined: Triggers when either condition is met
✅ **Visual Markers**
- Clear labels above/below bars
- Color-coded backgrounds
- Detection source indicators (h=high/low, b=body, +=both)
✅ **Smart Alerts**
- Real-time pattern detection
- Separate alerts for body-only patterns
- Customizable notification settings
## Settings
**Display Options**
- Show/hide each pattern type
- Toggle detection methods
- Customize colors
**Detection Modes**
- High/Low Detection: Traditional wick-based
- Body Detection: Open/Close based
- Show Source: Display what triggered the pattern
## Trading Tips
1. **Best Timeframes**: 1H, 4H, Daily
2. **Combine with**: Volume, trend indicators, support/resistance
3. **Risk Management**:
- II: Tight stops inside pattern
- OO: Wider stops due to volatility
- IOI: Scale in positions
## Label Meanings
- `ii` / `OO` / `ioi` = Base pattern detected
- `+h` suffix = High/Low triggered
- `+b` suffix = Body triggered
- `++` suffix = Both conditions met (strongest signal)
## Author Notes
Based on Al Brooks' price action methodology from his Trading Price Action series. This enhanced version adds body detection to filter out wick-only patterns and reduce false signals.
---
*For educational purposes only. Trading involves risk.*
**Version 2.0** | **Pine Script v6** | **@JimmC98**
Macias Golden ZoneThe Macias Golden Zone indicator automatically detects the most recent pivot leg and draws the key Fibonacci retracement band between 0.618 – 0.790, with the 0.706 midline highlighted.
🔑 Features:
• Auto-detects swing legs from pivot highs/lows
• Shaded Golden Zone for easy visualization of prime reaction areas
• Optional 0.706 midline for sniper entries
• Optional 0.079 retrace line for deeper confluence
• Works with wicks (High/Low) or closes
📈 Use it to identify high-probability pullback zones where price often reacts during trending moves.
⚠️ This tool is for educational purposes only. Not financial advice. Always manage risk.
From Christopher Macias and the Golden zone family
Fixed-Range Volume-Profile ZonesFixed Range Volume Profile Zones (with Dynamic Percentile Buffers)
This indicator calculates a fixed‑range volume profile over a user‑defined lookback period and identifies three key zones:
– VAL (Value Area Low)
– POC (Point of Control)
– VAH (Value Area High)
Volume is grouped into user‑selected price bins to create a profile of where the most trading activity occurred.
The script then splits the distribution into three zones and highlights the extremes (VAL/VAH) and the highest‑volume price (POC).
Dynamic Percentile Buffers
Instead of static offsets, this version computes the 10th and 90th percentile prices (user‑adjustable) of recent closes over the same lookback window.
These percentiles are used to create adaptive buffers above VAH and below VAL.
The buffers automatically expand or contract with market volatility and recent price distribution, filtering out weak or noisy touches.
Visual Elements:
– Green/orange/red horizontal lines = VAL / VAH / POC
– Green shading below VAL = buy zone
– Red shading above VAH = sell zone
– Down arrows above bars = closes above VAH + buffer
– Up arrows below bars = closes below VAL – buffer
Inputs:
– Lookback Days: number of bars used to build the profile
– Number of Bins: controls resolution of the volume profile
– VAH Percentile and VAL Percentile: choose which percentile levels to use for dynamic buffers
Use Cases:
– Quickly identify areas of high participation (POC) and potential support/resistance (VAL/VAH)
– Filter out weak breakouts using dynamic buffers
– Combine with other signals to improve entries/exits
⚠️ Disclaimer:
This script is for educational and informational purposes only.
It does not constitute financial advice or a recommendation to buy or sell any security.
Past performance or historical data does not guarantee future results.
Always perform your own analysis and use risk management when trading.
Hummingbird Probability Mapping IndicatorHummingbird Probability Mapping Indicator - A nature inspired indicator that utilizes combinations of the following trend patterns and projects a probability mapping with greater than 70% accuracy based on real-time analysis.
EMA Trend
MACD
RSI
VWAP Spread
Burst
Squeeze
Volatility (ATRp)
Qi Dass
Foxbrady D/G CrossFoxbrady D/G Cross - Golden Cross & Death Cross Indicator**
A clean and simple indicator that identifies Golden Cross and Death Cross events using the classic 50-day and 200-day simple moving averages.
Features:
- Blue line: 50-day SMA (fast moving average)
- Red line: 200-day SMA (slow moving average)
- Green "GC" label appears at the exact crossover point when a Golden Cross occurs (bullish signal)
- Red "DC" label appears at the exact crossover point when a Death Cross occurs (bearish signal)
- Built-in alert conditions for both events
- Customizable MA periods to suit your trading style
How to Use:
The Golden Cross (50 MA crossing above 200 MA) is traditionally viewed as a bullish long-term signal, while the Death Cross (50 MA crossing below 200 MA) is considered a bearish indicator. This indicator makes it easy to spot these events historically and receive alerts when they occur in real-time.
Perfect for swing traders and long-term investors looking to identify major trend changes.
MFx Radar (Money Flow x-Radar)Description:
MFx Radar is a precision-built multi-timeframe analysis tool designed to identify high-probability trend shifts and accumulation/distribution events using a combination of WaveTrend dynamics, normalized money flow, RSI, BBWP, and OBV-based trend biasing.
Multi-Timeframe Trend Scanner
Analyze trend direction across 5 customizable timeframes using WaveTrend logic to produce a clear trend consensus.
Smart Money Flow Detection
Adaptive hybrid money flow combines CMF and MFI, normalized across lookback periods, to pinpoint shifts in accumulation or distribution with high sensitivity.
Event-Based Labels & Alerts
Minimalist "Accum" and "Distr" text labels appear at key inflection points, based on hybrid flow flips — designed to highlight smart money moves without clutter.
Trigger & Pattern Recognition
Built-in logic detects anchor points, trigger confirmations, and rare "Snake Eye" formations directly on WaveTrend, enhancing trade timing accuracy.
Visual Dashboard Table
A real-time table provides score-based insight into signal quality, trend direction, and volume behavior, giving you a full picture at a glance.
MFx Radar helps streamline discretionary and system-based trading decisions by surfacing key confluences across price, volume, and momentum all while staying out of your way visually.
How to Use MFx Radar
MFx Radar is a multi-timeframe market intelligence tool designed to help you spot trend direction, momentum shifts, volume strength, and high-probability trade setups using confluence across price, flow, and timeframes.
Where to find settings To see the full visual setup:
After adding the script, open the Settings gear. Go to the Inputs tab and enable:
Show Trigger Diamonds
Show WT Cross Circles
Show Anchor/Trigger/Snake Eye Labels
Show Table
Show OBV Divergence
Show Multi-TF Confluence
Show Signal Score
Then, go to the Style tab to adjust colors and fills for the wave plots and hybrid money flow. (Use published chart as a reference.)
What the Waves and Colors Mean
Blue WaveTrend (WT1 / WT2). These are the main momentum waves.
WT1 > WT2 = bullish momentum
WT1 < WT2 = bearish momentum
Above zero = bullish bias
Below zero = bearish bias
When WT1 crosses above WT2, it often marks the beginning of a move — these are shown as green trigger diamonds.
VWAP-MACD Line
The yellow fill helps spot volume-based momentum.
Rising = trend acceleration
Use together with BBWP (bollinger band width percentile) and hybrid money flow for confirmation.
Hybrid Money Flow
Combines CMF and MFI, normalized and smoothed.
Green = accumulation
Red = distribution
Transitions are key — especially when price moves up, but money flow stays red (a divergence warning).
This is useful for spotting fakeouts or confirming smart money shifts.
Orange Vertical Highlights
Shows when price is rising, but money flow is still red.
Often a sign of hidden distribution or "exit pump" behavior.
Table Dashboard (Bottom-Right)
BBWP (Volatility Pulse)
When BBWP is low (<20), it signals consolidation — a breakout is likely to follow.
Use this with ADX and WaveTrend position to anticipate directional breakouts.
Trend by ADX
Shows whether the market is trending and in which direction.
Combined with money flow and RSI, this gives strong confirmation on breakouts.
OBV HTF Bias
Gives higher timeframe pressure (bullish/bearish/neutral).
Helps avoid taking counter-trend trades.
Pattern Labels (WT-Based)
A = Anchor Wave — WT hitting oversold
T = Trigger Wave — WT turning back up after anchor
👀 = Snake Eyes — Rare pattern, usually signaling strong reversal potential
These help in timing entries, especially when they align with other signals like BBWP breakouts, confluence, or smart money flow flips.
Multi-Timeframe (MTF) Consensus
The system checks WaveTrend on 5 different timeframes and gives:
Color-coded signals on each TF
A final score: “Mostly Up,” “Mostly Down,” or “Mixed”
When MTFs align with wave crosses, BBWP expansion, and hybrid money flow shifts, the probability of sustained move is higher.
Divergence Spotting (Advanced Tip)
Watch for:Price rising while money flow is red → Possible trap / early exit
Price dropping while money flow is green → Early accumulation
Combine this with anchor-trigger patterns and MTF trend support for spotting bottoms or tops early.
Final Tips
Use WT trigger crosses as initial signal. Confirm with money flow direction + color flip
Look at BBWP for breakout timing. Use table as your decision dashboard
Favor trades that align with MTF consensus
VWAP Multi Sessions + EMA + TEMA + PivotThis indicator combines several technical tools in one, designed for both intraday and swing traders to provide a complete view of market dynamics.
- VWAP Multi Sessions: calculates and plots five independent VWAPs, each based on a specific time range. This allows you to better identify value zones and price evolution during different phases of the trading day.
- Moving Averages (EMA): three strategic EMAs (55, 144, and 233 periods) are included to track the broader trend and highlight potential crossovers.
- TEMA (Triple Exponential Moving Average): two TEMAs (144 and 233 periods) offer a more responsive alternative to EMAs, reducing lag while filtering out some market noise.
- Daily Levels: the previous day’s open, close, high, and low are plotted as key support and resistance references.
- Pivot Point (P): also included is the classic daily pivot from the previous session, calculated as (High + Low + Close) / 3, which acts as a central level around which price often gravitates.
In summary, this indicator combines:
- intraday value references (session VWAPs),
- trend indicators (EMA and TEMA),
- and daily reference points (OHLC and Pivot).
It is particularly suited for intraday, scalping, and swing trading strategies, helping traders anticipate potential reaction zones in the market more effectively.
SPX Year-End 2025 Targets by AnalystsJust year end analyst targets for SPX as of 02 October 2025, as answered by Grok
Exhaustion Detector by exp3rtsThis advanced indicator is designed to spot buyer and seller exhaustion zones by combining candle structure, volume anomalies, momentum oscillators, and support/resistance context. Optimized for the 5-minute chart, it highlights potential turning points where momentum is likely fading.
Multi-factor detection – Uses RSI, Stochastic, volume spikes, wick-to-body ratios, and ATR context to identify exhaustion.
Smart filtering – Optional trend filter (EMA) and support/resistance proximity filter refine signals.
Cooldown logic – Prevents repeated signals in rapid succession to reduce noise.
Confidence scoring – Each exhaustion signal is graded for strength, so you can gauge conviction.
Visual clarity – Clear arrows mark exhaustion signals, background zones highlight pressure areas, and debug labels show score breakdowns (toggleable).
Use this tool to:
Anticipate potential reversals before price turns
Spot exhaustion at key support/resistance zones
Add a contrarian signal filter to your trading system
Custom Choppiness HistogramThe Custom Choppiness Histogram is a visually enhanced, multi-timeframe version of the traditional Choppiness Index , designed to make it easier to spot when the market is trending vs. ranging.
🔹 Key Features:
Histogram Visualization: Clear, color-coded bars for instant interpretation.
Two Coloring Modes:
1.Change Mode → Colors based on increase/decrease vs. previous CI value.
2.Absolute Levels → Uses common CI thresholds (e.g., >61.8 = choppy, <38.2 = trending).
Grey Bars / Neutral Zone: Bars turn grey when the market is neither strongly trending nor strongly choppy — signaling a neutral or indecisive market.
Multi-Timeframe Option: Analyze Choppiness from any higher timeframe while trading on a lower chart.
Custom Thresholds: Adjust high/low CI levels to fit your strategy.
🔹 How to Use:
Green bars → Market is becoming more trending.
Red bars → Market is becoming more choppy/ranging.
Grey bars → Market is in a neutral zone; use caution and combine with other signals.
Use the timeframe input to filter trades (e.g., check if the 1H is trending before entering on the 5M).
🔹 Best Practice:
Use as a context filter alongside your entry/exit strategy (e.g., MACD, ICT/Smart Money, Supply & Demand).
Helps reduce false entries by avoiding trades during sideways conditions.
⚠️ Disclaimer:
This script is provided for educational purposes only. It is not financial advice and should not be used as a sole basis for making trading decisions. Always do your own research and test thoroughly before applying to live markets. Trading carries risk, and you are solely responsible for your decisions.
Nth Candle by exp3rtsThis lightweight and versatile TradingView indicator highlights every Xth candle on your chart, making it easy to spot cyclical price behavior or track specific intervals in the market.
- Custom Interval – Choose how often candles should be highlighted (e.g., every 5th, 10th, or
20th bar).
- Color Coding – Highlighted candles are shaded green if bullish and red if bearish, giving you
quick visual insights into momentum at those intervals.
- Clean Overlay – The indicator draws directly on your main chart without clutter, so you can
combine it with your favorite setups and strategies.
Use this tool to:
1) Identify repeating patterns and cycles
2) Mark periodic reference candles
3) Support discretionary trading decisions with clear visual cues
Pivot Triangles High/Low (anchored)“It is used to detect price action pivots. You can choose the number of candles before a pivot is marked. It is useful for identifying trends.”
Hour/Day/Month Optimizer [CHE] Hour/Day/Month Optimizer — Bucketed seasonality ranking for hours, weekdays, and months with additive or compounded returns, win rate, simple Sharpe proxy, and trade counts
Summary
This indicator profiles time-of-day, day-of-week, and month-of-year behavior by assigning every bar to a bucket and accumulating its return into that bucket. It reports per-bucket score (additive or compounded), win rate, a dispersion-aware return proxy, and trade counts, then ranks buckets and highlights the current one if it is best or worst. A compact on-chart table shows the top buckets or the full ranking; a last-bar label summarizes best and worst. Optional hour filtering and UTC shifting let you align buckets with your trading session rather than exchange time.
Motivation: Why this design?
Traders often see repetitive timing effects but struggle to separate genuine seasonality from noise. Static averages are easily distorted by sample size, compounding, or volatility spikes. The core idea here is simple, explicit bucket aggregation with user-controlled accumulation (sum or compound) and transparent quality metrics (win rate, a dispersion-aware proxy, and counts). The result is a practical, legible seasonality surface that can be used for scheduling and filtering rather than prediction.
What’s different vs. standard approaches?
Reference baseline: Simple heatmaps or average-return tables that ignore compounding, dispersion, or sample size.
Architecture differences:
Dual aggregation modes: additive sum of bar returns or compounded factor.
Per-bucket win rate and trade count to expose sample support.
A simple dispersion-aware return proxy to penalize unstable averages.
UTC offset and optional custom hour window.
Deterministic, closed-bar rendering via a lightweight on-chart table.
Practical effect: You see not only which buckets look strong but also whether the observation is supported by enough bars and whether stability is acceptable. The background tint and last-bar label give immediate context for the current bucket.
How it works (technical)
Each bar is assigned to a bucket based on the selected dimension (hour one to twenty-four, weekday one to seven, or month one to twelve) after applying the UTC shift. An optional hour filter can exclude bars outside a chosen window. For each bucket the script accumulates either the sum of simple returns or the compounded product of bar factors. It also counts bars and wins, where a win is any bar with a non-negative return. From these, it derives:
Score: additive total or compounded total minus the neutral baseline.
Win rate: wins as a percentage of bars in the bucket.
Dispersion-aware proxy (“Sharpe” column): a crude ratio that rises when average return improves and falls when variability increases.
Buckets are sorted by a user-selected key (score, win rate, dispersion proxy, or trade count). The current bar’s bucket is tinted if it matches the global best or worst. At the last bar, a table is drawn with headers, an optional info row, and either the top three or all rows, using zebra backgrounds and color-coding (lime for best, red for worst). Rendering is last-bar only; no higher-timeframe data is requested, and no future data is referenced.
Parameter Guide
UTC Offset (hours) — Shifts bucket assignment relative to exchange time. Default: zero. Tip: Align to your local or desk session.
Use Custom Hours — Enables a local session window. Default: off. Trade-off: Reduces noise outside your active hours but lowers sample size.
Start / End — Inclusive hour window one to twenty-four. Defaults: eight to seventeen. Tip: Widen if rankings look unstable.
Aggregation — “Additive” sums bar returns; “Multiplicative” compounds them. Default: Additive. Tip: Use compounded for long-horizon bias checks.
Dimension — Bucket by Hour, Day, or Month. Default: Hour. Tip: Start Hour for intraday planning; switch to Day or Month for scheduling.
Show — “Top Three” or “All”. Default: Top Three. Trade-off: Clarity vs. completeness.
Sort By — Score, Win Rate, Sharpe, or Trades. Default: Score. Tip: Use Trades to surface stable buckets; use Win Rate for skew awareness.
X / Y — Table anchor. Defaults: right / top. Tip: Move away from price clusters.
Text — Table text size. Default: normal.
Light Mode — Light palette for bright charts. Default: off.
Show Parameters Row — Info header with dimension and span. Default: on.
Highlight Current Bucket if Best/Worst — Background tint when current bucket matches extremes. Default: on.
Best/Worst Barcolor — Tint colors. Defaults: lime / red.
Mark Best/Worst on Last Bar — Summary label on the last bar. Default: on.
Reading & Interpretation
Score column: Higher suggests stronger cumulative behavior for the chosen aggregation. Compounded mode emphasizes persistence; additive mode treats all bars equally.
Win Rate: Stability signal; very high with very low trades is unreliable.
“Sharpe” column: A quick stability proxy; use it to down-rank buckets that look good on score but fluctuate heavily.
Trades: Sample size. Prefer buckets with adequate counts for your timeframe and asset.
Tinting: If the current bucket is globally best, expect a lime background; if worst, red. This is context, not a trade signal.
Practical Workflows & Combinations
Trend following: Use Hour or Day to avoid initiating trades during historically weak buckets; require structure confirmation such as higher highs and higher lows, plus a momentum or volatility filter.
Mean reversion: Prefer buckets with moderate scores but acceptable win rate and dispersion proxy; combine with deviation bands or volume normalization.
Exits/Stops: Tighten exits during historically weak buckets; relax slightly during strong ones, but keep absolute risk controls independent of the table.
Multi-asset/Multi-TF: Start with Hour on liquid intraday assets; for swing, use Day. On monthly seasonality, require larger lookbacks to avoid overfitting.
Behavior, Constraints & Performance
Repaint/confirmation: Calculations use completed bars only; table and label are drawn on the last bar and can update intrabar until close.
security()/HTF: None used; repaint risk limited to normal live-bar updates.
Resources: Arrays per dimension, light loops for metric building and sorting, `max_bars_back` two thousand, and capped label/table counts.
Known limits: Sensitive to sample size and regime shifts; ignores costs and slippage; bar-based wins can mislead on assets with frequent gaps; compounded mode can over-weight streaks.
Sensible Defaults & Quick Tuning
Start: Hour dimension, Additive, Top Three, Sort by Score, default session window off.
Too many flips: Switch to Sort by Trades or raise sample by widening hours or timeframe.
Too sluggish/over-smoothed: Switch to Additive (if on compounded) or shorten your chart timeframe while keeping the same dimension.
Overfit risk: Prefer “All” view to verify that top buckets are not isolated with tiny counts; use Day or Month only with long histories.
What this indicator is—and isn’t
This is a seasonality and scheduling layer that ranks time buckets using transparent arithmetic and simple stability checks. It is not a predictive model, not a complete trading system, and it does not manage risk. Use it to plan when to engage, then rely on structure, confirmation, and independent risk management for entries and exits.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino