Pure Price Zone Flow🔎 What this indicator is
It’s a price-action-based zone indicator. Unlike moving average systems, this one relies only on:
1. Swing Highs & Swing Lows → The highest and lowest points within a recent lookback period (like "mini support & resistance").
2. ATR (Average True Range) → A volatility measure that expands the zone, making it more adaptive to different market conditions.
3. Breakouts & Retests → When price breaks above a swing high (bullish) or below a swing low (bearish), the indicator marks it and highlights the new trend.
👉 The goal is to spot clean structure shifts and define clear trend zones where traders can position themselves.
________________________________________
⚙️ How it is calculated
1. Swing High & Swing Low
o We look back len candles (default 20).
o Find the highest high (swingHigh) and the lowest low (swingLow) in that window.
o This forms the price range zone.
2. ATR Expansion
o We calculate ATR over the same len.
o Add/subtract it (multiplied by atrMult) to the zone edges to expand them.
o This ensures the zones breathe with volatility (tight in quiet markets, wide in choppy ones).
3. Mid-Zone
o Simply the average of swingHigh and swingLow.
o If price is above mid → bullish bias.
o If below mid → bearish bias.
o This gives us the trend color for candles.
4. Breakouts
o If the close crosses above swingHigh, we mark a bullish breakout with a label.
o If the close crosses below swingLow, we mark a bearish breakdown.
________________________________________
📊 How it helps traders
This indicator helps by:
1. Identifying Structure Shifts
o Many traders watch swing highs/lows for breakouts or reversals.
o This automates the process and visually confirms when structure is broken.
2. Dynamic Zone Trading
o Instead of fixed support/resistance, the ATR expansion adapts to volatility.
o This avoids false signals in high-volatility conditions.
3. Trend Bias at a Glance
o Candle coloring instantly tells you whether price is in bullish or bearish territory relative to the mid-zone.
4. Breakout Confirmation
o The labels show when a breakout has occurred, so traders can react quickly (e.g., enter with trend, wait for retest, or avoid fading moves).
________________________________________
🌍 Markets it works best in
• Crypto (Bitcoin, Ethereum, etc.): Very effective since crypto is breakout-driven and respects swing levels.
• Forex: Good for volatility-adaptive structure analysis, especially in trending pairs.
• Indices (SPX, NASDAQ, DAX, NIFTY): Useful for breakout trading during session opens or key news events.
• Commodities (Gold, Oil, Silver): Works well to define intraday ranges and breakout levels.
⚠️ Less useful in low-volatility, mean-reverting assets (like some penny stocks or sideways ranges), because breakouts may be rare or fake.
________________________________________
💡 How it adds value
• Strips away unnecessary complexity (no lagging averages).
• Focuses directly on what price is doing structurally.
• Adaptive → works across different markets & timeframes.
• Easy visualization → zones, trend coloring, breakout markers.
• Helps traders trade with the flow of the market, instead of guessing tops/bottoms.
________________________________________
👉 In short:
This indicator turns raw price action into clear, actionable zones.
It highlights when the market shifts from balance to breakout, so traders can align with momentum rather than fighting it.
Cerca negli script per "如何用wind搜索股票的发行价和份数"
Trend Change Strength – by G.I.N.e TradingIdentifies powerful trend reversals with high follow-through potential. The sub-pane plots green bars for strong bullish shifts, red bars for strong bearish shifts, and gray bars for sideways/no-trade conditions. Bar height reflects how many “strength conditions” are met.
How it works (signals = K-of-7 conditions)
The indicator scores each bar by checking up to 7 independent strength factors:
Trend inflection: HMA slope flips with a minimum slope magnitude.
Price confirmation: Close crosses the HMA with an ATR buffer.
Directional energy: ADX above threshold and rising.
Momentum thrust: RSI exits the neutral band and MACD turns/accelerates.
Volatility expansion: ATR above its moving average and BBWidth expanding.
Volume + candle quality: Volume above MA × multiplier with a strong body location (thrust candle).
Structural breakout: Close breaks recent high/low window.
Bullish (green) when at least K bullish conditions are true.
Bearish (red) when at least K bearish conditions are true.
Lateral (gray) when a separate flat filter (low ADX, flat slope, BBWidth below its MA) is active.
Key inputs
Trend/Price: HMA length, min slope %, ATR buffer, breakout lookback.
Momentum: RSI period + neutral band, MACD (fast/slow/signal), momentum lookback.
Vol/Volatility: Volume MA period & multiplier, min candle body ratio, ATR/BBWidth expansion settings.
ADX Gate: ADX period/smoothing/threshold, optional gating.
Logic: needHits K (minimum strong conditions), confirmBars (persistence), cooldownBars (avoid rapid re-signals).
Lateral Filter: thresholds for ADX, slope %, and BBWidth vs its MA.
How to use
Trade only green/red bars (direction comes from bar color); skip gray bars.
Combine with your entries (HARSI/MACD/price action) and your exit/trailing logic.
Use needHits to control selectivity: higher K = fewer, stronger signals.
Tuning tips
More selective: increase needHits, ADX threshold, minSlope%, ATR/BB expansion multipliers, and breakout lookback.
More permissive: lower needHits, soften thresholds, reduce cooldown.
Best for
Daily stocks and intraday futures/indices when you want quality reversal entries with evidence of momentum, volatility, directionality, volume, and structure—all aligned.
Smart Pattern Scanner ProSmart Pattern Scanner Pro — Trainer’s Guide (Step-by-Step)
1) What this tool does
Smart Pattern Scanner Pro (SPS Pro) scans multiple timeframes at once for classic candlestick patterns, filters them by trend, and presents everything in a clean table with price, signal direction, volume context, a “Vol Strength” progress bar, and a human-friendly timestamp. It also composes a single alert message when one or more patterns are found on the latest bar close.
________________________________________
2) The table at a glance (how to read one row)
Each row = one timeframe (e.g., 5m, 15m, 1h, 4h, Daily, Weekly)
• Timeframe – Shown with a readable name (“5 Minutes”, “1 Hour”, “Daily”, etc.).
• Price – The latest close at the moment the pattern is confirmed on that timeframe.
• Pattern – The first qualifying pattern detected on the last confirmed bar of that timeframe (or “—” if none).
• Signal –
o 🟢 ▲ = Bullish
o 🔴 ▼ = Bearish
o 🔵 ◆ = Neutral (e.g., Doji/Spinning Top)
• Buy Vol / Sell Vol (optional) – A rough split of volume for the most recent closed candle on that timeframe (up-close volume vs. down-close volume).
• Vol Strength (optional) – A 10-block text bar showing Total Volume ÷ SMA(Volume); quick read:
o ~0–1.0: muted activity
o 1.0: above average
o 1.5: notably elevated
• Time – The end time of the bar in your selected Timezone (Exchange by default).
If a timeframe shows “—” under Pattern, it simply means no eligible pattern was confirmed on the last completed candle for that TF.
________________________________________
3) Inputs & customization (what each section controls)
📊 Table Settings
• Table Position – Choose where the table sits on the chart (Top/Middle/Bottom + Left/Center/Right).
• Table Size – Controls the text size for all table cells.
• Show Volume Analysis – Toggles Buy Vol / Sell Vol columns.
• Show Progress Indicators – Toggles the Vol Strength column.
• Timezone – Set to Exchange, or override it to view timestamps in your local preference.
🎨 Color Theme
• Bullish / Bearish / Neutral colors – Control signal and highlight accents.
• Volume Up / Volume Down colors – Control the colors of the volume numbers and the Vol Strength bar.
• Backgrounds, borders, and text use a professional dark palette for contrast and readability.
⏱️ Timeframes
• Timeframes (comma-separated) – e.g., 5,15,60,240,1D,1W
Valid entries: 1,3,5,15,30,60,120,240,480,720,1D/D,1W/W,1M/M,3M
The scanner will create one row per timeframe.
📈 Technical Analysis
• Detect Trend Based on SMA – If on, patterns are trend-qualified using an SMA gate:
o Uptrend (uTrd) = close > SMA(maLen)
o Downtrend (dTrd) = close < SMA(maLen)
• SMA Length (maLen) – Length for the trend SMA gate (default 50).
• Volume MA Length (volMaLen) – SMA length used to compute Vol Strength.
🕯️ Pattern Selection
• Pattern Type – Scan Bullish, Bearish, or Both.
• Checkboxes – Turn specific patterns on/off (Engulfing, Morning/Evening Stars, Three Soldiers/Crows, Doji family, Hammers, Tasuki Gaps, Windows, Harami, Piercing/Dark Cloud, etc.).
Tip: For faster performance, disable patterns you don’t use.
________________________________________
4) How detection actually works (under the hood)
1. Per-timeframe scanning
The script iterates through your list of timeframes. For each TF it calls the detection engine via request.security(…tf…, main(true)) so that the logic runs natively on that timeframe.
2. Trend qualifier (optional)
If Detect Trend Based on SMA is enabled:
o Bullish patterns often require the recent context to be at/after downtrend (e.g., a reversal) or during an uptrend depending on the pattern.
o Bearish patterns similarly check for uTrd/dTrd.
You’ll notice some checks use offsets like , , to ensure the trend context existed before the current bar, making signals more realistic.
3. First-match wins
Inside each TF scan, patterns are checked in a fixed order. The code assigns the first eligible pattern to the row and ignores subsequent ones for that bar. This keeps rows clean and avoids double-signaling.
4. Confirmed bar only
The script saves a pattern only when the bar is confirmed (barstate.isconfirmed), reducing the “painting” of signals that vanish before close.
Important: For higher TFs, the table won’t update that TF’s row until its bar closes. E.g., a Daily pattern appears only after the daily candle closes.
5. Volume context
o BuyVol = TF volume if that TF bar closed up, else 0
o SellVol = TF volume if that TF bar closed down, else 0
o VolRatio = TF total volume ÷ SMA(volume, volMaLen)
That ratio feeds the Vol Strength bar for quick “is today active?” context.
6. Time formatting
The time shown is the end time of the TF bar, formatted to your Timezone input (Exchange by default). Intraday TFs show HH:mm; higher TFs show a clean date or time per your settings.
________________________________________
5) Alerts — how they’re built and how to use them
• On each bar close, SPS Pro assembles one multiline alert if any timeframe reported a pattern.
Example format:
• 🎯 Pattern Alert - NIFTY
• ├ 15: Engulfing (Bull) @ 24650.20
• ├ 60: Dark Cloud (Bear) @ 24580.90
• └─────────────
• To receive alerts in TradingView:
1. Add the indicator to your chart.
2. Click Create Alert.
3. In the Condition, choose “Any alert() function call” for this script.
4. Set “Once per bar close” (recommended, matches the script).
5. Choose your delivery channels and save.
________________________________________
6) Practical workflows (for new traders)
A) Intraday momentum trade (scalp/day trade)
1. Set TFs to 5,15,60.
2. Enable Engulfing, Hammer/Hanging Man, Morning/Evening Star, Shooting Star, Doji.
3. Keep Trend Based on SMA ON (SMA 50).
4. Wait for 5m + 15m to align in the same direction (both 🟢 or both 🔴).
5. Prefer entries when Vol Strength > 1.0 on the entry TF.
6. Place stop beyond the pattern’s invalidation (e.g., below Hammer low for long).
7. Scale out near prior intraday S/R; trail stops.
B) Swing reversal trade
1. Use higher TFs: 60,240,1D,1W.
2. Focus on Rising/Falling Three Methods, Morning/Evening (Doji) Stars, Three Soldiers/Crows.
3. Look for a fresh pattern on 4h or Daily, ideally with Vol Strength > 1.3.
4. Confirm confluence with structure (trendlines, weekly levels).
5. Plan wider stops and multi-day hold; review news/catalysts.
C) News avoidance & confirmation
• If Vol Strength spikes without a clean pattern, consider standing aside or waiting for the next bar to avoid whipsaw.
• When a pattern appears with a strong Vol Strength bar, it often signals attention-worthy activity—still validate with your own plan.
________________________________________
7) Best-practice interpretation tips
• Confluence beats single signals. Two TFs pointing the same way + decent Vol Strength is more reliable than a lone 5m signal.
• Neutral patterns (Doji/Spinning Top) are context markers, not trade triggers by themselves. Wait for follow-through.
• Trend gate matters. Keeping SMA gating ON reduces counter-trend noise.
• Bars must close. Remember: higher-TF rows only change after that TF bar closes.
• “First-match wins” means the order of checks matters. You can reorder or disable patterns to fit your style.
________________________________________
8) Performance & limits (TradingView realities)
• You’re scanning several TFs, running many pattern checks. Disable unused patterns or trim TFs if you hit resource limits.
• dynamic_requests=true helps, but extreme combinations (lots of TFs + all patterns + small chart TF) can still be heavy.
• If an exchange symbol’s volume behaves oddly, re-check Volume MA Length and your Timezone for clarity.
________________________________________
9) Common FAQs & troubleshooting
• “Why do I see ‘—’ on some rows?”
No qualifying pattern on the last closed bar of that TF, or your trend gate filtered it out.
• “Why are some signals late?”
Signals appear only on bar close (by design). That’s deliberate to avoid premature triggers.
• “My alert didn’t fire.”
Make sure the chart has an active alert set to “Any alert() function call” for this script and your alert frequency is Once per bar close.
• “Can I change the strength thresholds?”
Yes—edit the line that colors Vol Strength (currently >1.5 = stronger). Adjust to your preference.
• “I want more than one pattern per TF.”
This version stores one (the first match). You can adapt the logic to collect multiple, but keep the UI readable.
________________________________________
10) Suggested training exercises for new traders
1. Replay Mode drill – On a liquid symbol, step through 2 weeks of 5m/15m data. Log which SPS signals would you take/skip and why.
2. Confluence journal – Require at least two TFs aligned. Track outcomes for 20 trades.
3. Vol Strength filter – Only act when Vol Strength > 1.2. Compare results vs. no filter.
4. Pattern-specific week – Trade only Engulfing setups for one week (paper trading), then only Stars next week. Learn the nuances.
5. Risk practice – Fix risk at 0.5–1R per trade. Journal adherence to stops and take-profits.
________________________________________
11) Advanced customization ideas (optional)
• Re-order pattern checks to favor your preferred setups.
• Tighten/loosen trend gates (e.g., require uTrd and uTrd around breakout patterns).
• Add a score column (e.g., +2 for multi-TF alignment, +1 for Vol Strength >1.3, −1 if Neutral on higher TF).
• Map “Body/Header/Title” text sizes to table sizes if you want more granular typography (current code uses the overall Table Size).
________________________________________
12) Strict disclaimer (aiTrendview)
aiTrendview Educational Notice & Risk Warning
• This scanner is provided strictly for education and research. It is not investment advice, a recommendation, or a solicitation to buy/sell any security, derivative, or cryptocurrency.
• Candlestick patterns and volume context are imperfect and can fail. Past performance does not guarantee future results.
• Markets involve substantial risk. You can lose more than your principal, especially with margin, options, or leveraged products.
• Signals are generated after bar close and may be delayed at higher timeframes or due to data/vendor issues.
• Always validate with your own analysis, risk management rules, and, where appropriate, consult a qualified financial advisor.
• By using this tool, you agree not to misuse it for unlawful activity, spam alerts, or to represent it as a guaranteed system. You accept full responsibility for any trades taken and outcomes incurred.
________________________________________
13) Quick setup checklist
• Add SPS Pro to your chart.
• Configure Timeframes you actually trade.
• Toggle Show Volume and Vol Strength as desired.
• Keep SMA Trend Gate ON for cleaner signals (tune maLen to your market).
• Create a TradingView alert for “Any alert() function call” → Once per bar close.
• Paper-trade a sample of signals before going live.
Forex Killzone Marker By Deepesh//@version=5
indicator("Forex Killzone Marker", overlay=true)
// Convert IST to UTC
// IST = UTC +5:30
// London Killzone: 11:30 AM – 12:30 PM IST = 06:00 – 07:00 UTC
// NY Killzone: 5:30 PM – 6:30 PM IST = 12:00 – 13:00 UTC
// === Time Filtering: Only last 7 days === //
lookbackDays = 7
startFilterTime = timestamp("Etc/UTC", year, month, dayofmonth, hour, minute) - lookbackDays * 24 * 60 * 60 * 1000
isWithinLastWeek = time >= startFilterTime
// === Killzone Range Functions === //
inKillzone(startHour, startMin, endHour, endMin) =>
startTime = timestamp("Etc/UTC", year, month, dayofmonth, startHour, startMin)
endTime = timestamp("Etc/UTC", year, month, dayofmonth, endHour, endMin)
time >= startTime and time < endTime
// Killzone Windows
inLondonKillzone = inKillzone(6, 0, 7, 0)
inNYKillzone = inKillzone(12, 0, 13, 0)
// === Background Marking === //
bgcolor(isWithinLastWeek and inLondonKillzone ? color.new(color.green, 85) : na)
bgcolor(isWithinLastWeek and inNYKillzone ? color.new(color.orange, 85) : na)
FlowScape PredictorFlowScape Predictor is a non-repainting, regime-aware entry qualifier that turns complex market context into two readiness scores (Long & Short, each 0/25/50/75/100) and clean, confirmed-bar signals. It blends three orthogonal pillars so you act only when trend energy, momentum, and location agree:
Regime (energy): ATR-normalized linear-regression slope of a smooth HMA → EMA baseline, gated by ADX to confirm when pressure is meaningful.
Momentum (push): RSI slope alignment so price has directional follow-through, not just drift.
Structure (location): proximity to pivot-confirmed swings, scaled by ATR, so “ready” appears near constructive pullbacks—not mid-trend chases.
A soft ATR cloud wraps the baseline for context. A yellow Predictive Baseline extends beyond the last bar to visualize near-term trajectory. It is visual-only: scores/alerts never use it.
What you see
Baseline line that turns green/red when regime is strong in that direction; gray when weak.
ATR cloud around the baseline (context for stretch and pullbacks).
Scores (Long & Short, 0–100 in steps of 25) and optional “L/S” icons on bar close.
Yellow Predictive Baseline that extends to the right for a few bars (visual trajectory of the smoothed baseline).
The scoring system (simple and transparent)
Each side (Long/Short) sums four binary checks, 25 points each:
Regime aligned: trendStrong is true and LR slope sign favors that side.
Momentum aligned: RSI side (>50 for Long, <50 for Short) and RSI slope confirms direction.
Baseline side: price is above (Long) / below (Short) the baseline.
Location constructive: distance from the last confirmed pivot is healthy (ATR-scaled; not overstretched).
Valid totals are 0, 25, 50, 75, 100.
Best-quality signal: 100/0 (your side/opposite) on bar close.
Good, still valid: 75/0, especially when the missing block is only “location” right as price re-engages the cloud/baseline.
Avoid: 75/25 or any opposition > 0 in a weak (gray) regime.
The Predictive (Kalman) line — what it is and isn’t
The yellow line is a visual forward extension of the smoothed baseline to help you see the current trajectory and time pullback resumptions. It does not predict price and is excluded from scores and alerts.
How it’s built (plain English):
We maintain a one-dimensional Kalman state x as a smoothed estimate of the baseline. Each bar we observe the current baseline z.
The filter adjusts its trust using the Kalman gain K = P / (P + R) and updates:
x := x + K*(z − x), then P := (1 − K)*P + Q.
Q (process noise): Higher Q → expects faster change → tracks turns quicker (less smoothing).
R (measurement noise): Higher R → trusts raw baseline less → smoother, steadier projection.
What you control:
Lead (how many bars forward to draw).
Kalman Q/R (visual smoothness vs. responsiveness).
Toggle the line on/off if you prefer a minimal chart.
Important: The predictive line extends the baseline, not price. It’s a visual timing aid—don’t automate off it.
How to use (step-by-step)
Keep the chart clean and use a standard OHLC/candlestick chart.
Read the regime: Prefer trades with green/red baseline (trendStrong = true).
Check scores on bar close:
Take Long 100 / Short 0 or Long 75 / Short 0 when the chart shows a tidy pullback re-engaging the cloud/baseline.
Mirror the logic for shorts.
Confirm location: If price is > ~1.5 ATR from its reference pivot, let it come back—avoid chasing.
Set alerts: Add an alert on Long Ready or Short Ready; these fire on closed bars only.
Risk management: Use ATR-buffered stops beyond the recent pivot; target fixed-R multiples (e.g., 1.5–3.0R). Manage the trade with the baseline/cloud if you trail.
Best-practice playbook (quick rules)
Green light: 100/0 (best) or 75/0 (good) on bar close in a colored (non-gray) regime.
Location first: Prefer entries near the baseline/cloud right after a pullback, not far above/below it.
Avoid mixed signals: Skip 75/25 and anything with opposition while the baseline is gray.
Use the yellow line with discretion: It helps you see rhythm; it’s not a signal source.
Timeframes & tuning (practical defaults)
Intraday indices/FX (5m–15m): Demand 100/0 in chop; allow 75/0 when ADX is awake and pullback is clean.
Crypto intraday (15m–1h): Prefer 100/0; 75/0 on the first pullback after a regime turn.
Swing (1h–4h/D1): 75/0 is often sufficient; 100/0 is excellent (fewer but cleaner signals).
If choppy: raise ADX threshold, raise the readiness bar (insist on 100/0), or lengthen the RSI slope window.
What makes FlowScape different
Energy-first regime filter: ATR-normalized LR slope + ADX gate yields a consistent read of trend quality across symbols and timeframes.
Location-aware entries: ATR-scaled pivot proximity discourages mid-air chases, encouraging pullback timing.
Separation of concerns: The predictive line is visual-only, while scores/alerts are confirmed on close for non-repainting behavior.
One simple score per side: A single 0–100 readiness figure is easier to tune than juggling multiple indicators.
Transparency & limitations
Scores are coarse by design (25-point blocks). They’re a gatekeeper, not a promise of outcomes.
Pivots confirm after right-side bars, so structure signals appear after swings form (non-repainting by design).
Avoid using non-standard chart types (Heikin Ashi, Renko, Range, etc.) for signals; use a clean, standard chart.
No lookahead, no higher-timeframe requests; alerts fire on closed bars only.
Fibs Has Lied 🌟 Fibs Has Lied - Indicator Overview 🌟
Designed for indices like US30, NQ, and SPX, this indicator highlights setups where price interacts with key EMA levels during specific trading sessions (default: 6:30–11:30 AM EST).
🌟 Key Features & Levels 🌟
🔹EMA Crossover Setups
The indicator uses the 100-period and 200-period EMAs to identify bullish and bearish setups:
- Bullish Setup: Triggers when the 100 EMA crosses above the 200 EMA, followed by two consecutive candles opening above the 100 EMA, with the low within a specified point distance (e.g., 20 points for US30).
- Bearish Setup: Triggers when the 100 EMA crosses below the 200 EMA, followed by two consecutive candles opening below the 100 EMA, with the high within the point distance.
- Signals are marked with green (buy) or red (sell) triangles and text, ensuring you don’t miss a setup. 📈
🔹 Reset Conditions for Re-Entries
After an initial setup, the indicator watches for “reset” opportunities:
- Buy Reset: If price moves below the 200 EMA after a bullish crossover, then returns with two consecutive candles where lows are above the 100 EMA (within point distance), a new buy signal is plotted.
- Sell Reset: If price moves above the 200 EMA after a bearish crossover, then returns with two consecutive candles where highs are below the 100 EMA (within point distance), a new sell signal is plotted.
This feature captures additional entries after liquidity grabs or fakeouts, aligning with ICT’s manipulation concepts. 🔄
🔹 Session-Based Filtering
Focus your trades during high-liquidity windows! The default session (6:30–11:30 AM EST, New York timezone) targets the London/NY overlap, where price often seeks liquidity or sets up for reversals. Toggle the time filter off for 24/7 signals if desired. 🕒
🔹Symbol-Specific Point Distance
Customizable entry zones based on your chosen index:
- US30: 20 points from the 100 EMA.
- NQ: 3 points from the 100 EMA.
- SPX: 2.5 points from the 100 EMA.
This ensures setups are tailored to the volatility of your market, maximizing relevance. 🎯
🔹 Market Structure Markers (Optional)
Visualize swing points with pivot-based labels:
- HH (Higher High): Signals uptrend continuation.
- HL (Higher Low): Indicates potential bullish support.
- LH (Lower High): Suggests weakening uptrend or reversal.
- LL (Lower Low): Points to downtrend continuation.
- Toggle these on/off to keep your chart clean while analyzing trend direction. 📊
🔹 EMA Visualization
Optionally plot the 100 EMA (blue) and 200 EMA (red) to see key levels where price reacts. These act as dynamic support/resistance, perfect for spotting liquidity pools or ICT’s Power of 3 setups. ⚖️
🌟 Customization Options 🌟
- Symbol Selection: Choose US30, NQ, or SPX to adjust point distance for entries.
- Time Filter: Enable/disable the 6:30–11:30 AM EST session to focus on high-liquidity periods.
- EMA Display: Toggle 100/200 EMAs on/off to reduce chart clutter.
- Market Structure: Show/hide HH/HL/LH/LL labels for cleaner analysis.
- Signal Markers: Green (buy) and red (sell) triangles with text are auto-plotted for easy identification.
🌟 Usage Tips 🌟
- Best Timeframes: Use on 3m for intraday scalping and 30m for swing trades.
- Combine with ICT Tools: Pair with order blocks, fair value gaps, or kill zones for stronger setups.
- Focus on Session: The default 6:30–11:30 AM EST session captures London/NY volatility—perfect for liquidity-driven moves.
- Avoid Overcrowding: Disable market structure or EMAs if you only want setup signals.
OPR — DAX or USEnglish
This indicator automatically plots the Opening Price Range (OPR) for different indices, with customizable start and end times for each instrument.
For the DAX, it draws the high (green), low (red), and midline (grey dotted) for the specified range, defaulting to 09:00–09:15, and extends the lines until the selected end time (default 11:00).
For US indices (Dow Jones, Nasdaq, S&P500), it applies the same logic for the default 15:30–15:45 range, with two vertical black bars marking the start and end of the time window.
Each symbol only displays its own relevant lines (e.g., viewing DAX will only show DAX markers).
Parameters allow adjusting times and visibility for each market.
Sniper NAS100 Swiss Knife IndicatorSniper Trading System – Master Indicator
Description:
“Trade with the precision of the market makers themselves.”
The Sniper Trading System – Master Indicator is the crown jewel of institutional-level trading tools, engineered for those who demand perfect timing, deadly accuracy, and surgical execution in any market.
Designed by a 3× ASCAP Award-winning, multi–funded prop firm trader, this system fuses algorithmic precision with battle-tested price action logic, delivering an unmatched trading edge across Forex, Futures, Indices, and Crypto.
Core Features
Dealer Range Mapping – Auto-detects the hidden accumulation/distribution zones that drive market direction.
Multi-Standard Deviation Targets – Projected with gradient precision (+1 to +4 / -1 to -4) for scalps or swing holds.
12 AM Bias Candle Logic – Reveals the true daily directional bias before the herd even wakes up.
Liquidity Sweep Detection – Spots equal highs/lows & engineered stop hunts before the main move.
Kill Zone Time Windows – Pre-programmed with the London Session Sniper Hours & New York Precision Plays.
Multi-Timeframe RSI Filter – Filters false signals & highlights exhaustion points for sniper entries.
Dynamic Alerts – Fire real-time push, email, or webhook notifications for entry, exit, and confluence events.
How It Works
Identify Bias – Use the 12 AM candle + DXY/RSI overlays to confirm bullish or bearish control.
Wait for Liquidity Sweep – Let the market makers hunt stops; your job is to wait.
Execute at Kill Zones – Follow the preloaded precision entry times for God-tier sniper plays.
Ride to Target Zones – Exit at projected standard deviation levels for mathematically consistent profits.
Ideal For
Day Traders looking for clean entries and exits.
Vertical Line Timeline 10 Inputs by LK**Vertical Line Timeline (10 Inputs)**
This TradingView indicator plots vertical lines on your chart at up to **10 specific times of day**. You can define each time in **HH.MM format** (e.g., `9.30` for 9:30 AM). When the current bar’s time matches any of the defined times (based on the chart’s timezone), the indicator automatically draws a **full-height vertical line** at that bar.
**Features:**
* **Up to 10 custom time inputs** (HH.MM format)
* **Custom color** for each time marker
* **Adjustable line width** (1–6 px)
* **Solid or dotted style** toggle
* **Full-height vertical lines** (extend through the entire chart height)
* Works on any intraday timeframe where bar start times can match the defined times
* No labels or extra elements — clean and minimal display
**Use cases:**
* Marking important market sessions (e.g., London Open, New York Open, Asian Close)
* Highlighting personal trade execution windows
* Visual cues for strategy backtesting or time-based setups
Kelly Position Size CalculatorThis position sizing calculator implements the Kelly Criterion, developed by John L. Kelly Jr. at Bell Laboratories in 1956, to determine mathematically optimal position sizes for maximizing long-term wealth growth. Unlike arbitrary position sizing methods, this tool provides a scientifically solution based on your strategy's actual performance statistics and incorporates modern refinements from over six decades of academic research.
The Kelly Criterion addresses a fundamental question in capital allocation: "What fraction of capital should be allocated to each opportunity to maximize growth while avoiding ruin?" This question has profound implications for financial markets, where traders and investors constantly face decisions about optimal capital allocation (Van Tharp, 2007).
Theoretical Foundation
The Kelly Criterion for binary outcomes is expressed as f* = (bp - q) / b, where f* represents the optimal fraction of capital to allocate, b denotes the risk-reward ratio, p indicates the probability of success, and q represents the probability of loss (Kelly, 1956). This formula maximizes the expected logarithm of wealth, ensuring maximum long-term growth rate while avoiding the risk of ruin.
The mathematical elegance of Kelly's approach lies in its derivation from information theory. Kelly's original work was motivated by Claude Shannon's information theory (Shannon, 1948), recognizing that maximizing the logarithm of wealth is equivalent to maximizing the rate of information transmission. This connection between information theory and wealth accumulation provides a deep theoretical foundation for optimal position sizing.
The logarithmic utility function underlying the Kelly Criterion naturally embodies several desirable properties for capital management. It exhibits decreasing marginal utility, penalizes large losses more severely than it rewards equivalent gains, and focuses on geometric rather than arithmetic mean returns, which is appropriate for compounding scenarios (Thorp, 2006).
Scientific Implementation
This calculator extends beyond basic Kelly implementation by incorporating state of the art refinements from academic research:
Parameter Uncertainty Adjustment: Following Michaud (1989), the implementation applies Bayesian shrinkage to account for parameter estimation error inherent in small sample sizes. The adjustment formula f_adjusted = f_kelly × confidence_factor + f_conservative × (1 - confidence_factor) addresses the overconfidence bias documented by Baker and McHale (2012), where the confidence factor increases with sample size and the conservative estimate equals 0.25 (quarter Kelly).
Sample Size Confidence: The reliability of Kelly calculations depends critically on sample size. Research by Browne and Whitt (1996) provides theoretical guidance on minimum sample requirements, suggesting that at least 30 independent observations are necessary for meaningful parameter estimates, with 100 or more trades providing reliable estimates for most trading strategies.
Universal Asset Compatibility: The calculator employs intelligent asset detection using TradingView's built-in symbol information, automatically adapting calculations for different asset classes without manual configuration.
ASSET SPECIFIC IMPLEMENTATION
Equity Markets: For stocks and ETFs, position sizing follows the calculation Shares = floor(Kelly Fraction × Account Size / Share Price). This straightforward approach reflects whole share constraints while accommodating fractional share trading capabilities.
Foreign Exchange Markets: Forex markets require lot-based calculations following Lot Size = Kelly Fraction × Account Size / (100,000 × Base Currency Value). The calculator automatically handles major currency pairs with appropriate pip value calculations, following industry standards described by Archer (2010).
Futures Markets: Futures position sizing accounts for leverage and margin requirements through Contracts = floor(Kelly Fraction × Account Size / Margin Requirement). The calculator estimates margin requirements as a percentage of contract notional value, with specific adjustments for micro-futures contracts that have smaller sizes and reduced margin requirements (Kaufman, 2013).
Index and Commodity Markets: These markets combine characteristics of both equity and futures markets. The calculator automatically detects whether instruments are cash-settled or futures-based, applying appropriate sizing methodologies with correct point value calculations.
Risk Management Integration
The calculator integrates sophisticated risk assessment through two primary modes:
Stop Loss Integration: When fixed stop-loss levels are defined, risk calculation follows Risk per Trade = Position Size × Stop Loss Distance. This ensures that the Kelly fraction accounts for actual risk exposure rather than theoretical maximum loss, with stop-loss distance measured in appropriate units for each asset class.
Strategy Drawdown Assessment: For discretionary exit strategies, risk estimation uses maximum historical drawdown through Risk per Trade = Position Value × (Maximum Drawdown / 100). This approach assumes that individual trade losses will not exceed the strategy's historical maximum drawdown, providing a reasonable estimate for strategies with well-defined risk characteristics.
Fractional Kelly Approaches
Pure Kelly sizing can produce substantial volatility, leading many practitioners to adopt fractional Kelly approaches. MacLean, Sanegre, Zhao, and Ziemba (2004) analyze the trade-offs between growth rate and volatility, demonstrating that half-Kelly typically reduces volatility by approximately 75% while sacrificing only 25% of the growth rate.
The calculator provides three primary Kelly modes to accommodate different risk preferences and experience levels. Full Kelly maximizes growth rate while accepting higher volatility, making it suitable for experienced practitioners with strong risk tolerance and robust capital bases. Half Kelly offers a balanced approach popular among professional traders, providing optimal risk-return balance by reducing volatility significantly while maintaining substantial growth potential. Quarter Kelly implements a conservative approach with low volatility, recommended for risk-averse traders or those new to Kelly methodology who prefer gradual introduction to optimal position sizing principles.
Empirical Validation and Performance
Extensive academic research supports the theoretical advantages of Kelly sizing. Hakansson and Ziemba (1995) provide a comprehensive review of Kelly applications in finance, documenting superior long-term performance across various market conditions and asset classes. Estrada (2008) analyzes Kelly performance in international equity markets, finding that Kelly-based strategies consistently outperform fixed position sizing approaches over extended periods across 19 developed markets over a 30-year period.
Several prominent investment firms have successfully implemented Kelly-based position sizing. Pabrai (2007) documents the application of Kelly principles at Berkshire Hathaway, noting Warren Buffett's concentrated portfolio approach aligns closely with Kelly optimal sizing for high-conviction investments. Quantitative hedge funds, including Renaissance Technologies and AQR, have incorporated Kelly-based risk management into their systematic trading strategies.
Practical Implementation Guidelines
Successful Kelly implementation requires systematic application with attention to several critical factors:
Parameter Estimation: Accurate parameter estimation represents the greatest challenge in practical Kelly implementation. Brown (1976) notes that small errors in probability estimates can lead to significant deviations from optimal performance. The calculator addresses this through Bayesian adjustments and confidence measures.
Sample Size Requirements: Users should begin with conservative fractional Kelly approaches until achieving sufficient historical data. Strategies with fewer than 30 trades may produce unreliable Kelly estimates, regardless of adjustments. Full confidence typically requires 100 or more independent trade observations.
Market Regime Considerations: Parameters that accurately describe historical performance may not reflect future market conditions. Ziemba (2003) recommends regular parameter updates and conservative adjustments when market conditions change significantly.
Professional Features and Customization
The calculator provides comprehensive customization options for professional applications:
Multiple Color Schemes: Eight professional color themes (Gold, EdgeTools, Behavioral, Quant, Ocean, Fire, Matrix, Arctic) with dark and light theme compatibility ensure optimal visibility across different trading environments.
Flexible Display Options: Adjustable table size and position accommodate various chart layouts and user preferences, while maintaining analytical depth and clarity.
Comprehensive Results: The results table presents essential information including asset specifications, strategy statistics, Kelly calculations, sample confidence measures, position values, risk assessments, and final position sizes in appropriate units for each asset class.
Limitations and Considerations
Like any analytical tool, the Kelly Criterion has important limitations that users must understand:
Stationarity Assumption: The Kelly Criterion assumes that historical strategy statistics represent future performance characteristics. Non-stationary market conditions may invalidate this assumption, as noted by Lo and MacKinlay (1999).
Independence Requirement: Each trade should be independent to avoid correlation effects. Many trading strategies exhibit serial correlation in returns, which can affect optimal position sizing and may require adjustments for portfolio applications.
Parameter Sensitivity: Kelly calculations are sensitive to parameter accuracy. Regular calibration and conservative approaches are essential when parameter uncertainty is high.
Transaction Costs: The implementation incorporates user-defined transaction costs but assumes these remain constant across different position sizes and market conditions, following Ziemba (2003).
Advanced Applications and Extensions
Multi-Asset Portfolio Considerations: While this calculator optimizes individual position sizes, portfolio-level applications require additional considerations for correlation effects and aggregate risk management. Simplified portfolio approaches include treating positions independently with correlation adjustments.
Behavioral Factors: Behavioral finance research reveals systematic biases that can interfere with Kelly implementation. Kahneman and Tversky (1979) document loss aversion, overconfidence, and other cognitive biases that lead traders to deviate from optimal strategies. Successful implementation requires disciplined adherence to calculated recommendations.
Time-Varying Parameters: Advanced implementations may incorporate time-varying parameter models that adjust Kelly recommendations based on changing market conditions, though these require sophisticated econometric techniques and substantial computational resources.
Comprehensive Usage Instructions and Practical Examples
Implementation begins with loading the calculator on your desired trading instrument's chart. The system automatically detects asset type across stocks, forex, futures, and cryptocurrency markets while extracting current price information. Navigation to the indicator settings allows input of your specific strategy parameters.
Strategy statistics configuration requires careful attention to several key metrics. The win rate should be calculated from your backtest results using the formula of winning trades divided by total trades multiplied by 100. Average win represents the sum of all profitable trades divided by the number of winning trades, while average loss calculates the sum of all losing trades divided by the number of losing trades, entered as a positive number. The total historical trades parameter requires the complete number of trades in your backtest, with a minimum of 30 trades recommended for basic functionality and 100 or more trades optimal for statistical reliability. Account size should reflect your available trading capital, specifically the risk capital allocated for trading rather than total net worth.
Risk management configuration adapts to your specific trading approach. The stop loss setting should be enabled if you employ fixed stop-loss exits, with the stop loss distance specified in appropriate units depending on the asset class. For stocks, this distance is measured in dollars, for forex in pips, and for futures in ticks. When stop losses are not used, the maximum strategy drawdown percentage from your backtest provides the risk assessment baseline. Kelly mode selection offers three primary approaches: Full Kelly for aggressive growth with higher volatility suitable for experienced practitioners, Half Kelly for balanced risk-return optimization popular among professional traders, and Quarter Kelly for conservative approaches with reduced volatility.
Display customization ensures optimal integration with your trading environment. Eight professional color themes provide optimization for different chart backgrounds and personal preferences. Table position selection allows optimal placement within your chart layout, while table size adjustment ensures readability across different screen resolutions and viewing preferences.
Detailed Practical Examples
Example 1: SPY Swing Trading Strategy
Consider a professionally developed swing trading strategy for SPY (S&P 500 ETF) with backtesting results spanning 166 total trades. The strategy achieved 110 winning trades, representing a 66.3% win rate, with an average winning trade of $2,200 and average losing trade of $862. The maximum drawdown reached 31.4% during the testing period, and the available trading capital amounts to $25,000. This strategy employs discretionary exits without fixed stop losses.
Implementation requires loading the calculator on the SPY daily chart and configuring the parameters accordingly. The win rate input receives 66.3, while average win and loss inputs receive 2200 and 862 respectively. Total historical trades input requires 166, with account size set to 25000. The stop loss function remains disabled due to the discretionary exit approach, with maximum strategy drawdown set to 31.4%. Half Kelly mode provides the optimal balance between growth and risk management for this application.
The calculator generates several key outputs for this scenario. The risk-reward ratio calculates automatically to 2.55, while the Kelly fraction reaches approximately 53% before scientific adjustments. Sample confidence achieves 100% given the 166 trades providing high statistical confidence. The recommended position settles at approximately 27% after Half Kelly and Bayesian adjustment factors. Position value reaches approximately $6,750, translating to 16 shares at a $420 SPY price. Risk per trade amounts to approximately $2,110, representing 31.4% of position value, with expected value per trade reaching approximately $1,466. This recommendation represents the mathematically optimal balance between growth potential and risk management for this specific strategy profile.
Example 2: EURUSD Day Trading with Stop Losses
A high-frequency EURUSD day trading strategy demonstrates different parameter requirements compared to swing trading approaches. This strategy encompasses 89 total trades with a 58% win rate, generating an average winning trade of $180 and average losing trade of $95. The maximum drawdown reached 12% during testing, with available capital of $10,000. The strategy employs fixed stop losses at 25 pips and take profit targets at 45 pips, providing clear risk-reward parameters.
Implementation begins with loading the calculator on the EURUSD 1-hour chart for appropriate timeframe alignment. Parameter configuration includes win rate at 58, average win at 180, and average loss at 95. Total historical trades input receives 89, with account size set to 10000. The stop loss function is enabled with distance set to 25 pips, reflecting the fixed exit strategy. Quarter Kelly mode provides conservative positioning due to the smaller sample size compared to the previous example.
Results demonstrate the impact of smaller sample sizes on Kelly calculations. The risk-reward ratio calculates to 1.89, while the Kelly fraction reaches approximately 32% before adjustments. Sample confidence achieves 89%, providing moderate statistical confidence given the 89 trades. The recommended position settles at approximately 7% after Quarter Kelly application and Bayesian shrinkage adjustment for the smaller sample. Position value amounts to approximately $700, translating to 0.07 standard lots. Risk per trade reaches approximately $175, calculated as 25 pips multiplied by lot size and pip value, with expected value per trade at approximately $49. This conservative position sizing reflects the smaller sample size, with position sizes expected to increase as trade count surpasses 100 and statistical confidence improves.
Example 3: ES1! Futures Systematic Strategy
Systematic futures trading presents unique considerations for Kelly criterion application, as demonstrated by an E-mini S&P 500 futures strategy encompassing 234 total trades. This systematic approach achieved a 45% win rate with an average winning trade of $1,850 and average losing trade of $720. The maximum drawdown reached 18% during the testing period, with available capital of $50,000. The strategy employs 15-tick stop losses with contract specifications of $50 per tick, providing precise risk control mechanisms.
Implementation involves loading the calculator on the ES1! 15-minute chart to align with the systematic trading timeframe. Parameter configuration includes win rate at 45, average win at 1850, and average loss at 720. Total historical trades receives 234, providing robust statistical foundation, with account size set to 50000. The stop loss function is enabled with distance set to 15 ticks, reflecting the systematic exit methodology. Half Kelly mode balances growth potential with appropriate risk management for futures trading.
Results illustrate how favorable risk-reward ratios can support meaningful position sizing despite lower win rates. The risk-reward ratio calculates to 2.57, while the Kelly fraction reaches approximately 16%, lower than previous examples due to the sub-50% win rate. Sample confidence achieves 100% given the 234 trades providing high statistical confidence. The recommended position settles at approximately 8% after Half Kelly adjustment. Estimated margin per contract amounts to approximately $2,500, resulting in a single contract allocation. Position value reaches approximately $2,500, with risk per trade at $750, calculated as 15 ticks multiplied by $50 per tick. Expected value per trade amounts to approximately $508. Despite the lower win rate, the favorable risk-reward ratio supports meaningful position sizing, with single contract allocation reflecting appropriate leverage management for futures trading.
Example 4: MES1! Micro-Futures for Smaller Accounts
Micro-futures contracts provide enhanced accessibility for smaller trading accounts while maintaining identical strategy characteristics. Using the same systematic strategy statistics from the previous example but with available capital of $15,000 and micro-futures specifications of $5 per tick with reduced margin requirements, the implementation demonstrates improved position sizing granularity.
Kelly calculations remain identical to the full-sized contract example, maintaining the same risk-reward dynamics and statistical foundations. However, estimated margin per contract reduces to approximately $250 for micro-contracts, enabling allocation of 4-5 micro-contracts. Position value reaches approximately $1,200, while risk per trade calculates to $75, derived from 15 ticks multiplied by $5 per tick. This granularity advantage provides better position size precision for smaller accounts, enabling more accurate Kelly implementation without requiring large capital commitments.
Example 5: Bitcoin Swing Trading
Cryptocurrency markets present unique challenges requiring modified Kelly application approaches. A Bitcoin swing trading strategy on BTCUSD encompasses 67 total trades with a 71% win rate, generating average winning trades of $3,200 and average losing trades of $1,400. Maximum drawdown reached 28% during testing, with available capital of $30,000. The strategy employs technical analysis for exits without fixed stop losses, relying on price action and momentum indicators.
Implementation requires conservative approaches due to cryptocurrency volatility characteristics. Quarter Kelly mode is recommended despite the high win rate to account for crypto market unpredictability. Expected position sizing remains reduced due to the limited sample size of 67 trades, requiring additional caution until statistical confidence improves. Regular parameter updates are strongly recommended due to cryptocurrency market evolution and changing volatility patterns that can significantly impact strategy performance characteristics.
Advanced Usage Scenarios
Portfolio position sizing requires sophisticated consideration when running multiple strategies simultaneously. Each strategy should have its Kelly fraction calculated independently to maintain mathematical integrity. However, correlation adjustments become necessary when strategies exhibit related performance patterns. Moderately correlated strategies should receive individual position size reductions of 10-20% to account for overlapping risk exposure. Aggregate portfolio risk monitoring ensures total exposure remains within acceptable limits across all active strategies. Professional practitioners often consider using lower fractional Kelly approaches, such as Quarter Kelly, when running multiple strategies simultaneously to provide additional safety margins.
Parameter sensitivity analysis forms a critical component of professional Kelly implementation. Regular validation procedures should include monthly parameter updates using rolling 100-trade windows to capture evolving market conditions while maintaining statistical relevance. Sensitivity testing involves varying win rates by ±5% and average win/loss ratios by ±10% to assess recommendation stability under different parameter assumptions. Out-of-sample validation reserves 20% of historical data for parameter verification, ensuring that optimization doesn't create curve-fitted results. Regime change detection monitors actual performance against expected metrics, triggering parameter reassessment when significant deviations occur.
Risk management integration requires professional overlay considerations beyond pure Kelly calculations. Daily loss limits should cease trading when daily losses exceed twice the calculated risk per trade, preventing emotional decision-making during adverse periods. Maximum position limits should never exceed 25% of account value in any single position regardless of Kelly recommendations, maintaining diversification principles. Correlation monitoring reduces position sizes when holding multiple correlated positions that move together during market stress. Volatility adjustments consider reducing position sizes during periods of elevated VIX above 25 for equity strategies, adapting to changing market conditions.
Troubleshooting and Optimization
Professional implementation often encounters specific challenges requiring systematic troubleshooting approaches. Zero position size displays typically result from insufficient capital for minimum position sizes, negative expected values, or extremely conservative Kelly calculations. Solutions include increasing account size, verifying strategy statistics for accuracy, considering Quarter Kelly mode for conservative approaches, or reassessing overall strategy viability when fundamental issues exist.
Extremely high Kelly fractions exceeding 50% usually indicate underlying problems with parameter estimation. Common causes include unrealistic win rates, inflated risk-reward ratios, or curve-fitted backtest results that don't reflect genuine trading conditions. Solutions require verifying backtest methodology, including all transaction costs in calculations, testing strategies on out-of-sample data, and using conservative fractional Kelly approaches until parameter reliability improves.
Low sample confidence below 50% reflects insufficient historical trades for reliable parameter estimation. This situation demands gathering additional trading data, using Quarter Kelly approaches until reaching 100 or more trades, applying extra conservatism in position sizing, and considering paper trading to build statistical foundations without capital risk.
Inconsistent results across similar strategies often stem from parameter estimation differences, market regime changes, or strategy degradation over time. Professional solutions include standardizing backtest methodology across all strategies, updating parameters regularly to reflect current conditions, and monitoring live performance against expectations to identify deteriorating strategies.
Position sizes that appear inappropriately large or small require careful validation against traditional risk management principles. Professional standards recommend never risking more than 2-3% per trade regardless of Kelly calculations. Calibration should begin with Quarter Kelly approaches, gradually increasing as comfort and confidence develop. Most institutional traders utilize 25-50% of full Kelly recommendations to balance growth with prudent risk management.
Market condition adjustments require dynamic approaches to Kelly implementation. Trending markets may support full Kelly recommendations when directional momentum provides favorable conditions. Ranging or volatile markets typically warrant reducing to Half or Quarter Kelly to account for increased uncertainty. High correlation periods demand reducing individual position sizes when multiple positions move together, concentrating risk exposure. News and event periods often justify temporary position size reductions during high-impact releases that can create unpredictable market movements.
Performance monitoring requires systematic protocols to ensure Kelly implementation remains effective over time. Weekly reviews should compare actual versus expected win rates and average win/loss ratios to identify parameter drift or strategy degradation. Position size efficiency and execution quality monitoring ensures that calculated recommendations translate effectively into actual trading results. Tracking correlation between calculated and realized risk helps identify discrepancies between theoretical and practical risk exposure.
Monthly calibration provides more comprehensive parameter assessment using the most recent 100 trades to maintain statistical relevance while capturing current market conditions. Kelly mode appropriateness requires reassessment based on recent market volatility and performance characteristics, potentially shifting between Full, Half, and Quarter Kelly approaches as conditions change. Transaction cost evaluation ensures that commission structures, spreads, and slippage estimates remain accurate and current.
Quarterly strategic reviews encompass comprehensive strategy performance analysis comparing long-term results against expectations and identifying trends in effectiveness. Market regime assessment evaluates parameter stability across different market conditions, determining whether strategy characteristics remain consistent or require fundamental adjustments. Strategic modifications to position sizing methodology may become necessary as markets evolve or trading approaches mature, ensuring that Kelly implementation continues supporting optimal capital allocation objectives.
Professional Applications
This calculator serves diverse professional applications across the financial industry. Quantitative hedge funds utilize the implementation for systematic position sizing within algorithmic trading frameworks, where mathematical precision and consistent application prove essential for institutional capital management. Professional discretionary traders benefit from optimized position management that removes emotional bias while maintaining flexibility for market-specific adjustments. Portfolio managers employ the calculator for developing risk-adjusted allocation strategies that enhance returns while maintaining prudent risk controls across diverse asset classes and investment strategies.
Individual traders seeking mathematical optimization of capital allocation find the calculator provides institutional-grade methodology previously available only to professional money managers. The Kelly Criterion establishes theoretical foundation for optimal capital allocation across both single strategies and multiple trading systems, offering significant advantages over arbitrary position sizing methods that rely on intuition or fixed percentage approaches. Professional implementation ensures consistent application of mathematically sound principles while adapting to changing market conditions and strategy performance characteristics.
Conclusion
The Kelly Criterion represents one of the few mathematically optimal solutions to fundamental investment problems. When properly understood and carefully implemented, it provides significant competitive advantage in financial markets. This calculator implements modern refinements to Kelly's original formula while maintaining accessibility for practical trading applications.
Success with Kelly requires ongoing learning, systematic application, and continuous refinement based on market feedback and evolving research. Users who master Kelly principles and implement them systematically can expect superior risk-adjusted returns and more consistent capital growth over extended periods.
The extensive academic literature provides rich resources for deeper study, while practical experience builds the intuition necessary for effective implementation. Regular parameter updates, conservative approaches with limited data, and disciplined adherence to calculated recommendations are essential for optimal results.
References
Archer, M. D. (2010). Getting Started in Currency Trading: Winning in Today's Forex Market (3rd ed.). John Wiley & Sons.
Baker, R. D., & McHale, I. G. (2012). An empirical Bayes approach to optimising betting strategies. Journal of the Royal Statistical Society: Series D (The Statistician), 61(1), 75-92.
Breiman, L. (1961). Optimal gambling systems for favorable games. In J. Neyman (Ed.), Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability (pp. 65-78). University of California Press.
Brown, D. B. (1976). Optimal portfolio growth: Logarithmic utility and the Kelly criterion. In W. T. Ziemba & R. G. Vickson (Eds.), Stochastic Optimization Models in Finance (pp. 1-23). Academic Press.
Browne, S., & Whitt, W. (1996). Portfolio choice and the Bayesian Kelly criterion. Advances in Applied Probability, 28(4), 1145-1176.
Estrada, J. (2008). Geometric mean maximization: An overlooked portfolio approach? The Journal of Investing, 17(4), 134-147.
Hakansson, N. H., & Ziemba, W. T. (1995). Capital growth theory. In R. A. Jarrow, V. Maksimovic, & W. T. Ziemba (Eds.), Handbooks in Operations Research and Management Science (Vol. 9, pp. 65-86). Elsevier.
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-291.
Kaufman, P. J. (2013). Trading Systems and Methods (5th ed.). John Wiley & Sons.
Kelly Jr, J. L. (1956). A new interpretation of information rate. Bell System Technical Journal, 35(4), 917-926.
Lo, A. W., & MacKinlay, A. C. (1999). A Non-Random Walk Down Wall Street. Princeton University Press.
MacLean, L. C., Sanegre, E. O., Zhao, Y., & Ziemba, W. T. (2004). Capital growth with security. Journal of Economic Dynamics and Control, 28(4), 937-954.
MacLean, L. C., Thorp, E. O., & Ziemba, W. T. (2011). The Kelly Capital Growth Investment Criterion: Theory and Practice. World Scientific.
Michaud, R. O. (1989). The Markowitz optimization enigma: Is 'optimized' optimal? Financial Analysts Journal, 45(1), 31-42.
Pabrai, M. (2007). The Dhandho Investor: The Low-Risk Value Method to High Returns. John Wiley & Sons.
Shannon, C. E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27(3), 379-423.
Tharp, V. K. (2007). Trade Your Way to Financial Freedom (2nd ed.). McGraw-Hill.
Thorp, E. O. (2006). The Kelly criterion in blackjack sports betting, and the stock market. In L. C. MacLean, E. O. Thorp, & W. T. Ziemba (Eds.), The Kelly Capital Growth Investment Criterion: Theory and Practice (pp. 789-832). World Scientific.
Van Tharp, K. (2007). Trade Your Way to Financial Freedom (2nd ed.). McGraw-Hill Education.
Vince, R. (1992). The Mathematics of Money Management: Risk Analysis Techniques for Traders. John Wiley & Sons.
Vince, R., & Zhu, H. (2015). Optimal betting under parameter uncertainty. Journal of Statistical Planning and Inference, 161, 19-31.
Ziemba, W. T. (2003). The Stochastic Programming Approach to Asset, Liability, and Wealth Management. The Research Foundation of AIMR.
Further Reading
For comprehensive understanding of Kelly Criterion applications and advanced implementations:
MacLean, L. C., Thorp, E. O., & Ziemba, W. T. (2011). The Kelly Capital Growth Investment Criterion: Theory and Practice. World Scientific.
Vince, R. (1992). The Mathematics of Money Management: Risk Analysis Techniques for Traders. John Wiley & Sons.
Thorp, E. O. (2017). A Man for All Markets: From Las Vegas to Wall Street. Random House.
Cover, T. M., & Thomas, J. A. (2006). Elements of Information Theory (2nd ed.). John Wiley & Sons.
Ziemba, W. T., & Vickson, R. G. (Eds.). (2006). Stochastic Optimization Models in Finance. World Scientific.
Defense Mode Dashboard ProWhat it is
A one‑look market regime dashboard for ES, NQ, YM, RTY, and SPY that tells you when to play defense, when you might have an offense cue, and when to chill. It blends VIX, VIX term structure, ATR 5 over 60, and session gap signals with clean alerts and a compact table you can park anywhere.
Why traders like it
Because it filters out the noise. Regime first, tactics second. You avoid trading size into landmines and lean in when volatility cooperates.
What it measures
Volatility stress with VIX level and VIX vs 20‑SMA
Term structure using VX1 vs VX2 with two modes
Diff mode: VX1 minus VX2
Ratio mode: VX1 divided by VX2
Realized volatility using ATR5 over ATR60 with optional smoothing
Session risk from RTH opening gaps and overnight range, normalized by ATR
How to use in 30 seconds
Pick a preset in the inputs. ES, NQ, YM, RTY, SPY are ready.
Leave thresholds at defaults to start.
Add one TradingView alert using “Any alert() function call”.
Trade smaller or stand aside when the header reads DEFENSE ON. Consider leaning in only when you see OFFENSE CUE and your playbook agrees.
Defaults we recommend
VIX triggers: 22 and 1.25× the 20‑SMA
Term mode: Diff with tolerance 0.00. Use Ratio at 1.00+ for choppier markets
ATR 5/60 defense: 1.25. Offense cue: 0.85 or lower
ATR smoothing: 1. Try 2 to 3 if you want fewer flips
Gap mode: RTH. Turn Both on if you want ON range to count too
RTH wild gap: 0.60× ATR5. ON wild range: 0.80× ATR5
Alert cadence: Once per RTH session
Snooze: Quick snooze first 30 minutes on. Fire on snooze exit off, unless you really want the catch‑up ping
New since the last description
Multi‑asset presets set symbols and RTH windows for ES, NQ, YM, RTY, SPY
Term ratio mode with near‑flat warning when ratio is between 1.00 and your trigger
ATR smoothing for the 5 over 60 ratio
RTH keying for cadence, so “Once per RTH session” behaves like a trader expects
Snooze upgrades with quick snooze tied to the first N minutes of RTH and an optional fire‑on‑snooze‑exit
Compact title merge and user color controls for labels, values, borders, and background
Exposed series for integrations: DefenseOn(1=yes) and OffenseCue(1=yes)
Debug toggle to visualize gap points, ON range, and term readings
Stronger NA handling with a clear “No core data” row when feeds are missing
Notes
Dynamic alerts require “Any alert() function call”.
Works on any chart timeframe. Daily reads and 1‑minute anchors handle the regime logic.
Conferma Rotture by G.I.N.e Trading (Auto/Manual Profile)This indicator is designed to detect Range Expansion Bars (REB) and validate them through multiple filters, including trend alignment, fractal breakouts, volume strength, and VSA logic.
It can be used as a standalone breakout detector or as a confirmation tool for existing strategies.
Main Components
Range Expansion Detection (REB)
A bar is considered a REB when its range (High − Low) exceeds a dynamic threshold based on either:
Average range over N bars, or
ATR over N bars (if enabled).
Thresholds are adjustable and can adapt automatically to the instrument (e.g., DAX, Bund).
Trend Filter — HMA Slope
Calculates the slope of a Hull Moving Average to determine trend direction.
REB signals are only valid when aligned with the current trend (optional filter).
Fractal Breakout Confirmation
Uses Bill Williams fractals to identify the most recent swing high/low.
A REB is confirmed only if it breaks the latest fractal in the signal’s direction (optional).
Volume Filters
Simple Volume Check: Volume must be greater than the moving average × multiplier.
VSA Filter: Requires wide spread + high volume, confirming strong participation.
Armed Trigger Mode (Two-step Confirmation)
Step 1: REB detected → state is “armed” for a set number of bars.
Step 2: Position triggers only if price breaks the REB bar’s high/low within the validity window.
Visual Elements
Green/Red Columns — Confirmed REB signals (Long / Short).
White Line — REB intensity (range / base).
Yellow ±0.5 Line — “Armed” state before trigger activation.
Aqua Circles — VSA confirmation (wide spread + high volume).
Teal Line — Last up fractal level.
Orange Line — Last down fractal level.
Usage Example
Detect breakouts with strong momentum and volume.
Combine with fractal breakout for additional confirmation.
Use in “armed” mode to avoid false entries and require a follow-up trigger.
Especially suited for futures like DAX and Bund, but parameters can be adapted to other assets.
Entropy (Fiedor/Kontoyiannis) - Part 2 of Fiedor's TheoryThis indicator estimates the Shannon entropy of a price series using a Markov chain model of binary returns, following the approach of Fiedor (2014) and Kontoyiannis (1997).
% of Max shows current entropy as a percentage of its theoretical maximum (1 bit for binary up/down moves).
Percentile ranks the current entropy against historical values in the chosen lookback window.
High entropy suggests price movement is less predictable by frequentist models; low entropy implies more structure and predictability.
Use this as an informational oscillator, not a trading signal.
This is a visualization of Part 1 of Fiedor's Theory. The same entropy logic is already embedded in Part 1 however the second pane is a nice reminder of why it works.
ATR+CCI Monetary Risk Tool - TP/SL⚙️ ATR+CCI Monetary Risk Tool — Volatility-aware TP/SL & Position Sizing
Exact prices (no rounding), ATR-percentile dynamic stops, and risk-budget sizing for consistent execution.
🧠 What this indicator is
A risk-first planning tool. It doesn’t generate orders; it gives you clean, objective levels (Entry, SL, TP) and position size derived from your risk budget. It shows only the latest setup to keep charts readable, and a compact on-chart table summarizing the numbers you actually act on.
✨ What makes it different
Dynamic SL by regime (ATR percentile): Instead of a fixed multiple, the SL multiplier adapts to the current volatility percentile (low / medium / high). That helps avoid tight stops in noisy markets and over-wide stops in quiet markets.
Risk budgeting, not guesswork: Size is computed from Account Balance × Max Risk % divided by SL distance × point value. You risk the same dollars across assets/timeframes.
Precision that matches your instrument: Entry, TP, SL, and SL Distance are displayed as exact prices (no rounding), truncated to syminfo.mintick so they align with broker/exchange precision.
Symbol-aware point value: Uses syminfo.pointvalue so you don’t maintain tick tables.
Non-repaint option: Work from closed bars to keep the plan stable.
🔧 How to use (quick start)
Add to chart and pick your timeframe and symbol.
In settings:
Set Account Balance (USD) and Max Risk per Trade (%).
Choose R:R (1:1 … 1:5).
Pick ATR Period and CCI Period (defaults are sensible).
Keep Dynamic ATR ON to adapt SL by regime.
Keep Use closed-bar values ON to avoid repaint when planning.
Read the labels (Entry/TP/SL) and the table (SL Distance, Position Size, Max USD Risk, ATR Percentile, effective SL Mult).
Combine with your entry trigger (price action, levels, momentum, etc.). This indicator handles risk & targets.
📐 How levels are computed
Bias: CCI ≥ 0 ⇒ long, otherwise short.
ATR Percentile: Percent rank of ATR(atrPeriod) over a lookback window.
Effective SL Mult:
If percentile < Low threshold ⇒ use Low SL Mult (tighter).
If between thresholds ⇒ use Base SL Mult.
If percentile > High threshold ⇒ use High SL Mult (wider).
Stop-Loss: SL = Entry ± ATR × SL_Mult (minus for long, plus for short).
Take-Profit: TP = Entry ± (Entry − SL) × R (R from the R:R dropdown).
Position Size:
USD Risk = Balance × Risk%
Contracts = USD Risk ÷ (|Entry − SL| × PointValue)
For futures, quantity is floored to whole contracts.
Exact prices: Entry/TP/SL and SL Distance are not rounded; they’re truncated to mintick so what you see matches valid price increments.
📊 What you’ll see on chart
Latest Entry (blue), TP (green), SL (red) with labels (optional emojis: ➡️ 🎯 🛑).
Info Table with:
Bias, Entry, TP, SL (exact, truncated to mintick)
SL Distance (exact, truncated)
Position Size (contracts/units)
Max USD Risk
Point Value
ATR Percentile and effective SL Mult
🧪 Practical examples
High-volatility session (e.g., XAUUSD, 1H): ATR percentile is high ⇒ wider SL, smaller size. Reduces churn from normal noise during macro events.
Range-bound market (e.g., EURUSD, 4H): ATR percentile low ⇒ tighter SL, better R:R. Helps you avoid carrying unnecessary risk.
Index swing planning (e.g., ES1!, Daily): Non-repaint levels + risk budgeting = consistent sizing across days/weeks, easier to review and journal.
🧭 Why traders should use it
Consistency: Same dollar risk regardless of instrument or volatility regime.
Clarity: One-trade view forces focus; you see the numbers that matter.
Adaptivity: Stops calibrated to the market’s current behavior, not last month’s.
Discipline: A visible checklist (SL distance, size, USD risk) before you hit buy/sell.
🔧 Input guide (practical defaults)
CCI Period: 100 by default; use as a bias filter, not an entry signal.
ATR Period: 14 by default; raise for smoother, lower for more reactive.
ATR Percentile Lookback: 200 by default (stable regime detection).
Percentile thresholds: 33/66 by default; widen the gap to change how often regimes switch.
SL Mults: Start ~1.5 / 2.0 / 2.5 (low/base/high). Tune by asset.
Risk % per trade: Common pro ranges are 0.25–1.0%; adjust to your risk tolerance.
R:R: Start with 1:2 or 1:3 for balanced skew; adapt to strategy edge.
Closed-bar values: Keep ON for planning/live; turn OFF only for exploration.
💡 Best practices
Combine with your entry logic (structure, momentum, liquidity levels).
Review ATR percentile and effective SL Mult across sessions so you understand regime shifts.
For futures, remember size is floored to whole contracts—safer by design.
Journal trades with the table snapshot to improve risk discipline over time.
⚠️ Notes & limitations
This is not a strategy; it does not place orders or alerts.
No slippage/commissions modeled here; build a strategy() version for backtests that mirror your broker/exchange.
Displayed non-price metrics use two decimals; prices and SL Distance are exact (truncated to mintick).
📎 Disclaimer
For educational purposes only. Not financial advice. Markets involve risk. Test thoroughly before trading live.
Confidence Score – DAX & BUND (Auto) by G.I.N.e TradingConfidence Score – DAX & BUND (Auto)
This indicator calculates a confidence score (0–5) to filter trade signals based on market conditions, adapting its parameters automatically for the DAX and the German Bund futures.
The score is built from five independent conditions:
ADX Strength – Measures trend directionality. Score point if ADX is above a defined threshold.
RSI Position – Avoids the neutral “no-trade zone” between two RSI levels. Score point if RSI is outside this range.
Price Range Expansion – Checks whether the recent price range (over N bars) is large enough relative to current price.
Candle Body Size – Ensures the current candle body is significant compared to the total high–low range (avoiding very small-bodied candles).
Volume Confirmation – Requires current volume to be above its moving average and higher than the previous bar.
Score Interpretation:
4–5 points → Green: strong, clear market conditions (high confidence).
2–3 points → Orange: moderate conditions (trade with caution).
0–1 points → Red: weak, choppy market (high noise).
DAX Logic:
Used for trend-following entries only.
Trades are allowed only if the score is above the DAX threshold and the price is aligned with the main trend (defined by HMA).
BUND Logic:
Used for trend-reversal entries only.
Trades are allowed only if the score is above the Bund threshold and the price is against the main trend, confirming a potential reversal setup.
Key Features:
Automatic instrument detection (DAX vs. BUND) with parameter adjustment.
Separate score thresholds for DAX (trend continuation) and Bund (reversals).
Visual columns showing score levels and optional bar coloring when score ≥ 4.
Context windows plotted as small markers to indicate when trade setups are allowed according to the instrument-specific rules.
This indicator should be used as a filter in combination with your core entry strategy (e.g., HARSI Cross, MACD, VSA) to avoid taking trades in low-confidence, noisy market conditions.
Regime KaleidoscopeWhat is Regime Kaleidoscope?
Regime Kaleidoscope is an advanced market regime visualizer and adaptive signal generator.
It helps traders instantly understand whether current market conditions are best for mean-reversion (fading price back to the mean) or breakout/trend-following (riding strong moves), using a data-driven, non-repainting approach.
How It Works
1. Regime Detection & Background Colors
The indicator analyzes both volatility (ATR) and the shape of each candle (body size vs. range) over a rolling window.
Each bar is classified into one of three regimes, and the chart’s background color changes accordingly:
Regime Background Color What It Means How to Use
Low Vol Balanced Green background Market is calm, compressed. More likely to revert back to mean. Look for mean-reversion signals only (fade moves).
High Vol Directional Red background Market is in a high-volatility, trending, or “breakout” state.
Red does NOT mean bearish. It simply means conditions are ripe for strong directional moves—either up or down. Look for breakout signals only (ride strong moves after structure break).
Chop Gray background Market is indecisive or transitioning between states. Signals are minimized or blocked. Best to wait or trade with extra caution.
→ Red background means high volatility/trending regime, not a signal direction!
Green means “mean-revert environment,” not always bullish!
Gray means “chop/transition”—usually best avoided.
2. Signals — How to Read and Trade Them
Mean-Reversion Signals (Green Regime Only):
Appear when price is stretched away from a rolling mean (SMA) by a configurable ATR-based threshold.
Optional: Only allowed in the direction of the higher-timeframe trend, if enabled.
Long signals: Fade extreme dips (look for triangle-up shapes & green labels).
Short signals: Fade extreme spikes (triangle-down shapes & red labels).
Labels show signal strength (distance from mean in ATR units).
Breakout Signals (Red Regime Only):
Only triggered when price breaks above or below a confirmed swing high or low (pivot), with a strong candle and optional trend confirmation.
Long signals: Breakout above last swing high (regardless of background color).
Short signals: Breakout below last swing low.
Labels show signal strength (distance from pivot in ATR units).
Red background does NOT mean sell— it means “trend environment”—so both long and short signals are possible, depending on which direction price is breaking out.
Signal Controls & Filtering:
Signals only fire at bar close (non-repainting), never intrabar or on future data.
ATR “floor” blocks signals when volatility is too low for meaningful moves.
Cooldown: Signals are limited to one per regime per direction for a minimum number of bars (user input).
Optional confirmation candles: Only strong reversals or breakouts count, reducing noise and whipsaws.
All signals are visible as triangle shapes below/above bars, and labeled with strength.
3. Visual Guide
Background color: Maps the regime, not buy/sell direction.
Transition label: Appears only when the regime changes, so you can see state shifts at a glance.
Triangle shapes & labels: Mark entry points; label gives strength.
Info table (optional): Shows regime and ATR at transitions.
Why is Regime Kaleidoscope Unique?
Uses rolling statistical percentiles of ATR and candle body shape for dynamic market state detection—not just a moving average or volatility band.
Separates regime from signal direction, so you always know “what mode the market is in” and when signals actually have a higher probability.
No repainting. All logic is strictly bar-close, confirmed pivots, and non-future-leaking.
Highly customizable—all thresholds, filters, trend confirmation, and cooldown are user inputs.
How To Use
Add to any chart.
Use the background color to identify if you’re in a mean-revert, breakout, or chop regime.
Take only the signals that match the regime:
Green = fade extremes, Red = ride breakouts, Gray = wait.
Tune settings for your asset and timeframe.
All signals are educational—always test before live use!
Past performance is not necessarily indicative of future results.
Test the indicator on your assets and timeframes. All signals are for educational use only.
thors_forex_factory_utilityLibrary "forex_factory_utility"
Supporting Utility Library for the Live Economic Calendar by toodegrees Indicator; responsible for data handling, and plotting news event data.
isLeapYear()
Finds if it's currently a leap year or not.
Returns: Returns True if the current year is a leap year.
daysMonth(M)
Provides the days in a given month of the year, adjusted during leap years.
Parameters:
M (int) : Month in numerical integer format (i.e. Jan=1).
Returns: Days in the provided month.
MMM(M)
Converts a month from a numerical integer format to a MMM format (i.e. 'Jan').
Parameters:
M (int) : Month in numerical integer format (i.e. Jan=1).
Returns: Month in MMM format (i.e. 'Jan').
dow(D)
Converts a numbered day of the week string in format to 'DDD' format (i.e. "1" = Sun).
Parameters:
D (string) : Numbered day of the week from 1 to 7, starting on Sunday.
Returns: Returns the day of the week in 'DDD' format (i.e. "Fri").
size(S, N)
Converts a size string into the corresponding Pine Script v5 format, or N times smaller/bigger.
Parameters:
S (string) : Size string: "Tiny", "Small", "Normal", "Large", or "Huge".
N (int) : Size variation, can be positive (larger than S), or negative (smaller than S).
Returns: Size string in Pine Script v5 format.
lineStyle(S)
Converts a line style string into the corresponding Pine Script v5 format.
Parameters:
S (string) : Line style string: "Dashed", "Dotted" or "Solid".
Returns: Line style string in Pine Script v5 format.
lineTrnsp(S)
Converts a transparency style string into the corresponding integer value.
Parameters:
S (string) : Line style string: "Light", "Medium" or "Heavy".
Returns: Transparency integer.
boxLoc(X, Y)
Converts position strings of X and Y into a table position in Pine Script v5 format.
Parameters:
X (string) : X-axis string: "Left", "Center", or "Right".
Y (string) : Y-axis string: "Top", "Middle", or "Bottom".
Returns: Table location string in Pine Script v5 format.
method bubbleSort_NewsTOD(N)
Performs bubble sort on a Forex Factory News array of all news from the same date, ordering them in ascending order based on the time of the day.
Namespace types: array
Parameters:
N (array) : Forex Factory News array.
Returns: void
bubbleSort_News(N)
Performs bubble sort on a Forex Factory News array, ordering them in ascending order based on the time of the day, and date.
Parameters:
N (array) : Forex Factory News array.
Returns: Sorted Forex Factory News array.
weekNews(N, C, I)
Creates a Forex Factory News array containing the current week's Forex Factory News.
Parameters:
N (array) : Forex Factory News array containing this week's unfiltered Forex Factory News.
C (array) : Currency filter array (string array).
I (array) : Impact filter array (color array).
Returns: Forex Factory News array containing the current week's Forex Factory News.
todayNews(W, D, M)
Creates a Forex Factory News array containing the current day's Forex Factory News.
Parameters:
W (array) : Forex Factory News array containing this week's Forex Factory News.
D (array) : Forex Factory News array for the current day's Forex Factory News.
M (bool) : Boolean that marks whether the current chart has a Day candle-switch at Midnight New York Time.
Returns: Forex Factory News array containing the current day's Forex Factory News.
adjustTimezone(N, TZH, TZM)
Transposes the Time of the Day, and Date, in the Forex Factory News Table to a custom Timezone.
Parameters:
N (array) : Forex Factory News array.
TZH (int) : Custom Timezone hour.
TZM (int) : Custom Timezone minute.
Returns: Reformatted Forex Factory News array.
NewsAMPM_TOD(N)
Reformats the Time of the Day in the Forex Factory News Table to AM/PM format.
Parameters:
N (array) : Forex Factory News array.
Returns: Reformatted Forex Factory News array.
impFilter(X, L, M, H)
Creates a filter array from the User's desired Forex Facory News to be shown based on Impact.
Parameters:
X (bool) : Boolean - if True Holidays listed on Forex Factory will be shown.
L (bool) : Boolean - if True Low Impact listed on Forex Factory News will be shown.
M (bool) : Boolean - if True Medium Impact listed on Forex Factory News will be shown.
H (bool) : Boolean - if True High Impact listed on Forex Factory News will be shown.
Returns: Color array with the colors corresponding to the Forex Factory News to be shown.
curFilter(A, C1, C2, C3, C4, C5, C6, C7, C8, C9)
Creates a filter array from the User's desired Forex Facory News to be shown based on Currency.
Parameters:
A (bool) : Boolean - if True News related to the current Chart's symbol listed on Forex Factory will be shown.
C1 (bool) : Boolean - if True News related to the Australian Dollar listed on Forex Factory will be shown.
C2 (bool) : Boolean - if True News related to the Canadian Dollar listed on Forex Factory will be shown.
C3 (bool) : Boolean - if True News related to the Swiss Franc listed on Forex Factory will be shown.
C4 (bool) : Boolean - if True News related to the Chinese Yuan listed on Forex Factory will be shown.
C5 (bool) : Boolean - if True News related to the Euro listed on Forex Factory will be shown.
C6 (bool) : Boolean - if True News related to the British Pound listed on Forex Factory will be shown.
C7 (bool) : Boolean - if True News related to the Japanese Yen listed on Forex Factory will be shown.
C8 (bool) : Boolean - if True News related to the New Zealand Dollar listed on Forex Factory will be shown.
C9 (bool) : Boolean - if True News related to the US Dollar listed on Forex Factory will be shown.
Returns: String array with the currencies corresponding to the Forex Factory News to be shown.
FF_OnChartLine(N, T, S)
Plots vertical lines where a Forex Factory News event will occur, or has already occurred.
Parameters:
N (array) : News-type array containing all the Forex Factory News.
T (int) : Transparency integer value (0-100) for the lines.
S (string) : Line style in Pine Script v5 format.
Returns: void
method updateStringMatrix(M, P, V)
Updates a string Matrix containing the tooltips for Forex Factory News Event information for a given candle.
Namespace types: matrix
Parameters:
M (matrix) : String matrix.
P (int) : Position (row) of the Matrix to update based on the impact.
V (string) : information to push to the Matrix.
Returns: void
FF_OnChartLabel(N, Y, S, O)
Plots labels where a Forex Factory News has already occurred based on its/their impact.
Parameters:
N (array) : News-type array containing all the Forex Factory News.
Y (string) : String that gives direction on where to plot the label (options= "Above", "Below", "Auto").
S (string) : Label size in Pine Script v5 format.
O (bool) : Show outline of labels?
Returns: void
historical(T, D, W, X)
Deletes Forex Factory News drawings which are ourside a specific Time window.
Parameters:
T (int) : Number of days input used for Forex Factory News drawings' history.
D (bool) : Boolean that when true will only display Forex Factory News drawings of the current day.
W (bool) : Boolean that when true will only display Forex Factory News drawings of the current week.
X (string) : String that gives direction on what lines to plot based on Time (options= "Future", "Both").
Returns: void
newTable(P, B)
Creates a new Table object with parameters tailored to the Forex Factory News Table.
Parameters:
P (string) : Position string for the Table, in Pine Script v5 format.
B (color) : Border and frame color for the News Table.
Returns: Empty Forex Factory News Table.
resetTable(P, S, headTextC, headBgC, B)
Resets a Table object with parameters and headers tailored to the Forex Factory News Table.
Parameters:
P (string) : Position string for the Table, in Pine Script v5 format.
S (string) : Size string for the Table's text, in Pine Script v5 format.
headTextC (color)
headBgC (color)
B (color) : Border and frame color for the News Table.
Returns: Empty Forex Factory News Table.
logNews(N, TBL, R, S, rowTextC, rowBgC)
Adds an event to the Forex Factory News Table.
Parameters:
N (News) : News-type object.
TBL (table) : Forex Factory News Table object to add the News to.
R (int) : Row to add the event to in the Forex Factory News Table.
S (string) : Size string for the event's text, in Pine Script v5 format.
rowTextC (color)
rowBgC (color)
Returns: void
FF_Table(N, P, S, headTextC, headBgC, rowTextC, rowBgC, B)
Creates the Forex Factory News Table.
Parameters:
N (array) : News-type array containing all the Forex Factory News.
P (string) : Position string for the Table, in Pine Script v5 format.
S (string) : Size string for the Table's text, in Pine Script v5 format.
headTextC (color)
headBgC (color)
rowTextC (color)
rowBgC (color)
B (color) : Border and frame color for the News Table.
Returns: Forex Factory News Table.
timeline(N, T, F, TZH, TZM, D)
Shades Forex Factory News events in the Forex Factory News Table after they occur.
Parameters:
N (array) : News-type array containing all the Forex Factory News.
T (table) : Forex Facory News table object.
F (color) : Color used as shading once the Forex Factory News has occurred.
TZH (int) : Custom Timezone hour, if any.
TZM (int) : Custom Timezone minute, if any.
D (bool) : Daily Forex Factory News flag.
Returns: Forex Factory News Table.
News
Custom News type which contains informatino about a Forex Factory News Event.
Fields:
dow (series string) : Day of the week, in DDD format (i.e. 'Mon').
dat (series string) : Date, in MMM D format (i.e. 'Jan 1').
_t (series int)
tod (series string) : Time of the day, in hh:mm 24-Hour format (i.e 17:10).
cur (series string) : Currency, in CCC format (i.e. "USD").
imp (series color) : Impact, the respective impact color for Forex Factory News Events.
ttl (series string) : Title, encoded in a custom number mapping (see the toodegrees/toodegrees_forex_factory library to learn more).
tmst (series int)
ln (series line)
Squeeze Momentum Regression Clouds [SciQua]╭──────────────────────────────────────────────╮
☁️ Squeeze Momentum Regression Clouds
╰──────────────────────────────────────────────╯
🔍 Overview
The Squeeze Momentum Regression Clouds (SMRC) indicator is a powerful visual tool for identifying price compression , trend strength , and slope momentum using multiple layers of linear regression Clouds. Designed to extend the classic squeeze framework, this indicator captures the behavior of price through dynamic slope detection, percentile-based spread analytics, and an optional UI for trend inspection — across up to four customizable regression Clouds .
────────────────────────────────────────────────────────────
╭────────────────╮
⚙️ Core Features
╰────────────────╯
Up to 4 Regression Clouds – Each Cloud is created from a top and bottom linear regression line over a configurable lookback window.
Slope Detection Engine – Identifies whether each band is rising, falling, or flat based on slope-to-ATR thresholds.
Spread Compression Heatmap – Highlights compressed zones using yellow intensity, derived from historical spread analysis.
Composite Trend Scoring – Aggregates directional signals from each Cloud using your chosen weighting model.
Color-Coded Candles – Optional candle coloring reflects the real-time composite score.
UI Table – A toggleable info table shows slopes, compression levels, percentile ranks, and direction scores for each Cloud.
Gradient Cloud Styling – Apply gradient coloring from Cloud 1 to Cloud 4 for visual slope intensity.
Weight Aggregation Options – Use equal weighting, inverse-length weighting, or max pooling across Clouds to determine composite trend strength.
────────────────────────────────────────────────────────────
╭──────────────────────────────────────────╮
🧪 How to Use the Indicator
1. Understand Trend Bias with Cloud Colors
╰──────────────────────────────────────────╯
Each Cloud changes color based on its current slope:
Green indicates a rising trend.
Red indicates a falling trend.
Gray indicates a flat slope — often seen during chop or transitions.
Cloud 1 typically reflects short-term structure, while Cloud 4 represents long-term directional bias. Watch for multi-Cloud alignment — when all Clouds are green or red, the trend is strong. Divergence among Clouds often signals a potential shift.
────────────────────────────────────────────────────────────
╭───────────────────────────────────────────────╮
2. Use Compression Heat to Anticipate Breakouts
╰───────────────────────────────────────────────╯
The space between each Cloud’s top and bottom regression lines is measured, normalized, and analyzed over time. When this spread tightens relative to its history, the script highlights the band with a yellow compression glow .
This visual cue helps identify squeeze zones before volatility expands. If you see compression paired with a changing slope color (e.g., gray to green), this may indicate an impending breakout.
────────────────────────────────────────────────────────────
╭─────────────────────────────────╮
3. Leverage the Optional Table UI
╰─────────────────────────────────╯
The indicator includes a dynamic, floating table that displays real-time metrics per Cloud. These include:
Slope direction and value , with historical Min/Max reference.
Top and Bottom percentile ranks , showing how price sits within the Cloud range.
Current spread width , compared to its historical norms.
Composite score , which blends trend, slope, and compression for that Cloud.
You can customize the table’s position, theme, transparency, and whether to show a combined summary score in the header.
────────────────────────────────────────────────────────────
╭─────────────────────────────────────────────╮
4. Analyze Candle Color for Composite Signals
╰─────────────────────────────────────────────╯
When enabled, the indicator colors candles based on a weighted composite score. This score factors in:
The signed slope of each Cloud (up, down, or flat)
The percentile pressure from the top and bottom bands
The degree of spread compression
Expect green candles in bullish trend phases, red candles during bearish regimes, and gray candles in mixed or low-conviction zones.
Candle coloring provides a visual shorthand for market conditions , useful for intraday scanning or historical backtesting.
────────────────────────────────────────────────────────────
╭────────────────────────╮
🧰 Configuration Guidance
╰────────────────────────╯
To tailor the indicator to your strategy:
Use Cloud lengths like 21, 34, 55, and 89 for a balanced multi-timeframe view.
Adjust the slope threshold (default 0.05) to control how sensitive the trend coloring is.
Set the spread floor (e.g., 0.15) to tune when compression is detected and visualized.
Choose your weighting style : Inverse Length (favor faster bands), Equal, or Max Pooling (most aggressive).
Set composite weights to emphasize trend slope, percentile bias, or compression—depending on your market edge.
────────────────────────────────────────────────────────────
╭────────────────╮
✅ Best Practices
╰────────────────╯
Use aligned Cloud colors across all bands to confirm trend conviction.
Combine slope direction with compression glow for early breakout entry setups.
In choppy markets, watch for Clouds 1 and 2 turning flat while Clouds 3 and 4 remain directional — a sign of potential trend exhaustion or consolidation.
Keep the table enabled during backtesting to manually evaluate how each Cloud behaved during price turns and consolidations.
────────────────────────────────────────────────────────────
╭───────────────────────╮
📌 License & Usage Terms
╰───────────────────────╯
This script is provided under the Creative Commons Attribution-NonCommercial 4.0 International License .
✅ You are allowed to:
Use this script for personal or educational purposes
Study, learn, and adapt it for your own non-commercial strategies
❌ You are not allowed to:
Resell or redistribute the script without permission
Use it inside any paid product or service
Republish without giving clear attribution to the original author
For commercial licensing , private customization, or collaborations, please contact Joshua Danford directly.
Volume Statistics - IntraweekVolume Statistics - Intraweek: For Orderflow Traders
This tool is designed for traders using volume footprint charts and orderflow methods.
Why it matters:
In orderflow trading, you care about the quality of volume behind each move. You’re not just watching price; you’re watching how much aggression is behind that price move. That’s where this indicator helps.
What to look at:
* Current Volume shows you how much volume is trading right now.
* Central Volume (median or average over 24h or 7D) gives you a baseline for what's normal volume VS abnormal volume.
* The Diff vs Central tells you immediately if current volume is above or below normal.
How this helps:
* If volume is above normal, it suggested elevated levels of buyer or seller aggression. Look for strong follow-through or continuation.
* If volume is below normal, it may signal low interest, passive participation, a lack of conviction, or a fake move.
* Use this context to decide if what you're seeing in the footprint (imbalances, absorption, traps) is actually worth acting on.
Extra context:
* The highest and lowest volume levels and their timestamps help you spot prior key reactions.
* Second and third highest bars help you see other major effort points in the recent window.
Comment with any suggestions on how to improve this indicator.
ACR(Average Candle Range) With TargetsWhat is ACR?
The Average Candle Range (ACR) is a custom volatility metric that calculates the mean distance between the high and low of a set number of past candles. ACR focuses only on the actual candle range (high - low) of specific past candles on a chosen timeframe.
This script calculates and visualizes the Average Candle Range (ACR) over a user-defined number of candles on a custom timeframe. It displays a table of recent range values, plots dynamic bullish and bearish target levels, and marks the start of each new candle with a vertical line. All calculations update in real time as price action develops. This script was inspired by the “ICT ADR Levels - Judas x Daily Range Meter°” by toodegrees.
Key Features
Custom Timeframe Selection: Choose any timeframe (e.g., 1D, 4H, 15m) for analysis.
User-Defined Lookback: Calculate the average range across 1 to 10 previous candles.
Dynamic Targets:
Bullish Target: Current candle low + ACR.
Bearish Target: Current candle high – ACR.
Live Updates: Targets adjust intrabar as highs or lows change during the current candle.
Candle Start Markers: Vertical lines denote the open of each new candle on the selected timeframe.
Floating Range Table:
Displays the current ACR value.
Lists individual ranges for the previous five candles.
Extend Target Lines: Choose to extend bullish and bearish target levels fully across the screen.
Global Visibility Controls: Toggle on/off all visual elements (targets, vertical lines, and table) for a cleaner view.
How It Works
At each new candle on the user-selected timeframe, the script:
Draws a vertical line at the candle’s open.
Recalculates the ACR based on the inputted previous number of candles.
Plots target levels using the current candle's developing high and low values.
Limitation
Once the price has already moved a full ACR in the opposite direction from your intended trade, the associated target loses its practical value. For example, if you intended to trade long but the bearish ACR target is hit first, the bullish target is no longer a reliable reference for that session.
Use Case
This tool is designed for traders who:
Want to visualize the average movement range of candles over time.
Use higher or lower timeframe candles as structural anchors.
Require real-time range-based price levels for intraday or swing decision-making.
This script does not generate entry or exit signals. Instead, it supports range awareness and target projection based on historical candle behavior.
Key Difference from Similar Tools
While this script was inspired by “ICT ADR Levels - Judas x Daily Range Meter°” by toodegrees, it introduces a major enhancement: the ability to customize the timeframe used for calculating the range. Most ADR or candle-range tools are locked to a single timeframe (e.g., daily), but this version gives traders full control over the analysis window. This makes it adaptable to a wide range of strategies, including intraday and swing trading, across any market or asset.
Period Highlighter ProPeriod Highlighter Pro is a versatile Pine Script indicator designed to visually highlight specific time periods on your TradingView charts, making it easier to analyze seasonal patterns, trading sessions, or specific weekdays. With customizable settings for months, weekdays, or intraday time ranges, this tool adapts to your trading strategy, allowing you to focus on key periods with precision.
Features
Flexible Highlight Modes: Choose from three modes to highlight:
Month Range: Highlight specific months or a range (e.g., March to June) for seasonal analysis.
Weekday Range: Highlight specific weekdays (e.g., Mondays or Monday to Wednesday) for weekly pattern analysis.
Time Range: Highlight daily time windows (e.g., 15:30–22:00) for intraday session analysis, restricted to weekdays.
Customizable Timezone: Set any IANA timezone (e.g., America/New_York, Europe/London) or UTC offset to align highlights with your preferred market hours.
Historical Range Control: Define how far back to apply highlights with options for years (Month Range), weeks (Weekday Range), or days (Time Range).
Visual Customization: Choose your highlight color to match your chart style.
User-Friendly Inputs: Intuitive dropdowns and tooltips guide you through configuring each mode, ensuring only relevant settings are adjusted.
How It Works
Select a highlight mode and configure the corresponding settings:
Month Range: Pick a start month and an optional end month (or "Disabled" for a single month) and set the number of years back.
Weekday Range: Choose a start weekday and an optional end weekday (or "Disabled" for a single day) and set the number of weeks back.
Time Range: Specify a start and end time (24-hour format) and the number of weekdays back. The indicator then applies a semi-transparent background color to chart bars that meet your criteria, making it easy to spot relevant periods.
Use Cases
Seasonal Traders: Highlight specific months to analyze recurring market patterns.
Day Traders: Focus on active trading sessions (e.g., New York open) with precise time range highlighting.
Weekly Pattern Analysts: Isolate specific weekdays to study price behavior.
Global Traders: Adjust for any timezone to align with your market of interest.
Why Use Period Highlighter Pro?
This indicator simplifies time-based analysis by providing a clear visual overlay for your chosen periods. Whether you're studying historical trends or focusing on specific trading hours, Period Highlighter Pro offers the flexibility and precision to enhance your chart analysis.
Licensed under the Mozilla Public License 2.0.
CQ_[TACHIMETER]The Tachimeter Indicator: A Fun Financial Gauge
Visualizing Market Momentum in Real Time
Introduction
The Tachimeter is a playful and innovative indicator designed for those who enjoy observing the financial markets with a touch of excitement. Much like the tachometer in a car measures engine revolutions per minute, the Tachimeter measures the "revolutions" of money in the market — showing just how fast funds are moving in or out, every twenty seconds.
What Does the Tachimeter Show?
At its core, the Tachimeter displays how much money (in U.S. dollars) is shifting direction — either up or down — from the current price within a 20-second window. The indicator operates on a scale that starts at $0 (no significant movement) and extends to $1200, representing the maximum flow observed in each 20-second period.
• Scale: $0 to $1200 every 20 seconds
• Direction: Indicates if money is moving upwards (buying) or downwards (selling)
• Purpose: For entertainment and observation, not for actual trading decisions
Visual Design and Interpretation
The Tachimeter features a gauge reminiscent of a car’s tachometer. The gauge moves to show the current intensity of money flowing into or out of the market right now, providing an immediate sense of how "fast" buyers or sellers are acting.
• Gauge Indicator: The amount of squares shows the speed of ongoing transactions, just like a rev counter in a vehicle.
• Color-Coded Title: The title of the indicator switches colors based on the market’s relationship to the daily opening price:
• Red: When the current price is lower than the daily opening price, indicating downward momentum.
• Green: When the current price is higher than the daily opening price, signaling buying momentum.
How to Use the Tachimeter
This indicator is intended purely for fun — it gives you a rapid, visual sense of market activity, letting you "feel" the excitement of fluctuating prices. If you enjoy watching the markets move, the Tachimeter adds a dynamic, visceral element to your experience.
• Watch the needle twitch higher as heavy buying or selling takes place.
• Notice title color changes as the market sentiment shifts from bullish (green) to bearish (red), or vice versa.
• Use it as a conversation starter or to enhance your enjoyment of fast-paced trading sessions.
Final Thoughts
Like your car’s tachometer helps you sense when to shift gears, the Tachimeter lets you sense when the market is "revving up." It’s not a tool for serious decision-making, but it transforms raw financial data into an engaging, interactive visual — perfect for those who appreciate both finance and a bit of fun.
Enjoy watching the market’s RPMs!
Linear Mean Reversion Strategy📘 Strategy Introduction: Linear Mean Reversion with Fixed Stop
This strategy implements a simple yet powerful mean reversion model that assumes price tends to oscillate around a dynamic average over time. It identifies statistically significant deviations from the moving average using a z-score, and enters trades expecting a return to the mean.
🧠 Core Logic:
A z-score is calculated by comparing the current price to its moving average, normalized by standard deviation, over a user-defined half-life window.
Trades are entered when the z-score crosses a threshold (e.g., ±1), signaling overbought or oversold conditions.
The strategy exits positions either when price reverts back near the mean (z-score close to 0), or if a fixed stop loss of 100 points is hit, whichever comes first.
⚙️ Key Features:
Dynamic mean and volatility estimation using moving average and standard deviation
Configurable z-score thresholds for entry and exit
Position size scaling based on z-score magnitude
Fixed stop loss to control risk and avoid prolonged drawdowns
🧪 Use Case:
Ideal for range-bound markets or assets that exhibit stationary behavior around a mean, this strategy is especially useful on assets with mean-reverting characteristics like currency pairs, ETFs, or large-cap stocks. It is best suited for traders looking for short-term reversions rather than long-term trends.