NQ Market DNA: ML ScorerNQ Market DNA: ML Scorer — Indicator Description
NQ Market DNA: ML Scorer is a session-structure and machine-learning scoring tool designed specifically for Nasdaq futures (NQ/MNQ). It converts the market’s overnight behavior into a single, probability-style score (0–100%) and a clear directional bias for the upcoming New York session.
This script is not a generic “trend indicator.” It is a rules-based implementation of a machine-learning model whose feature set and weightings were built and calibrated in Python using historical session data. The Pine Script version is the real-time execution layer: it measures the live session structure, applies the model weights, and displays the result on-chart.
________________________________________
What the indicator plots
1) Session Boxes (Structure Map)
The indicator draws three session ranges using boxes and a midline:
• Asia Session (20:00–02:00 NY time by default)
• London Session (02:00–08:00 NY time by default)
• New York Session (08:00–16:00 NY time by default)
Each session box:
• Expands in real time as highs/lows develop
• Includes a dotted midline (session midpoint)
• “Locks” its final values once the session ends
2) Extension Levels (Target Interaction)
When Asia or London ends, the script projects high and low extension lines forward into the day. These lines extend until one of the following happens:
• Price trades back through the level (a touch/cross condition), or
• The script reaches the hard stop at 16:00 (end of NY session)
This makes it easy to visually track whether later sessions respect or invalidate prior-session extremes.
________________________________________
The ML scoring concept
Output: “Probability of High First” (0–100%)
The model’s output is a normalized score intended to behave like a probability. Practically:
• Score ≥ 50% → Bullish bias (“London High First”)
• Score < 50% → Bearish bias (“London Low First”)
The score is produced by summing weighted session features. If a feature is bullish, it contributes its weight; if bearish, it contributes zero. The weights approximately sum to ~100, so the final score naturally maps into a 0–100 range.
Bias coloring
The on-chart score cell uses a risk-style color gradient:
• Strong Bullish (typically > 75): green
• Neutral / mixed (around 40–75): orange
• Bearish / weak (below ~40): red
________________________________________
Features used by the model (and why they matter)
The ML scorer is driven by session positioning, trend, and volatility. Your Python research determined the relative importance of each feature; the largest weights reflect the strongest historical explanatory power.
Primary drivers (most important)
1. NY Open Location (Weight ~63.73%)
Checks whether the NY session opens above or below the London midpoint.
This is treated as the dominant structural signal because it captures whether NY is opening in the “upper half” or “lower half” of London’s range.
2. London Trend (Weight ~28.09%)
London close vs London open (bullish if close > open).
This represents whether London printed a directional push versus chop.
3. London Outcome / Structure (Weight ~4.21%)
Classifies London relative to Asia:
o “High-only sweep” (bullish structure) if London breaks Asia high without breaking Asia low
This is a proxy for one-sided liquidity behavior rather than symmetric volatility.
Minor factors (smaller weights, but still additive)
4. London Volatility (Weight ~1.11%)
London range relative to its own rolling average (lookback-controlled).
Used as a contextual amplifier: higher-than-normal London range can support continuation.
5. Asia Volatility (Weight ~1.05%)
Asia range relative to its rolling average.
Helps distinguish “quiet overnight” vs “expanded overnight,” which can change the day’s tendency.
6. Asia Trend (Weight ~1.00%)
Asia close vs Asia open.
A light directional context input.
7. London Open Location vs Asia Mid (Weight ~0.81%)
Whether London opens above/below the Asia midpoint.
Helps quantify early handoff positioning.
________________________________________
How to read the table
The table is designed to be a compact decision panel:
• ML PREDICTOR: the score (%) for the current day once NY has opened
• NY Bias: bullish or bearish interpretation based on the 50 threshold
• Top Drivers: shows the state of the highest-weighted features (NY location, London trend, structure)
• Minor Factors: a condensed read on volatility context (e.g., “High Vol” vs “Mixed/Low”)
This layout lets you quickly understand not only the bias, but what caused it.
________________________________________
Best-practice usage notes
• This tool is intended to be used as a context engine, not a standalone entry signal.
• It is most effective when combined with your execution framework (levels, risk model, confirmations, etc.).
• Because it relies on session boundaries, chart symbol and market hours must match the intended instrument (NQ futures) for the cleanest behavior.
________________________________________
Critical disclaimer and settings warning
IMPORTANT — DO NOT CHANGE SETTINGS.
This indicator’s machine-learning weights and feature calibration were derived in Python from historical data under a specific configuration (session windows, timezone, and feature definitions). Changing any inputs—especially session times, timezone, rolling windows, or ML feature weights—can materially invalidate the model’s expected behavior and may produce misleading outputs.
Use with caution.
This script is provided for educational and informational purposes only and does not constitute financial advice. Futures trading involves substantial risk and is not suitable for all traders. Past performance and historical patterns do not guarantee future results. You are solely responsible for any trading decisions and risk management.
If you ever re-train or re-calibrate the model in Python, update the weights only by replacing them with the new Python-derived values as a complete set—do not “tune” them manually.
Indicators and strategies
Swing TraderCore Logic
This is a swing reversal system designed to catch bounces at swing lows (LONG) and rejections at swing highs (SHORT).
Signal Flow:
Warning Phase: Yellow diamonds appear when price makes new lows/highs within the lookback period
Entry Phase: Signals fire when price bounces back after the warning (close > previous low for LONG, close < previous high for SHORT)
Swing Size Filter: Requires minimum point movement (default 50 points) between the stored high/low levels
Strengths
✅ Two-step system prevents premature entries - warns first, then confirms
✅ Alternating signals - won't fire consecutive LONGs or SHORTs
✅ Swing size requirement ensures meaningful moves
✅ Clean visuals - large labels, thick lines, clear table
zhanzhang66Key Indicators for Crypto & US Stock Analysis
These indicators are vital for crypto and US stock trading, aiding in trend identification, overbought/oversold judgment, valuation assessment and reversal signal capture, supporting rational trading decisions.
Crypto Indicators
• RSI: Measures price strength to spot overbought/oversold conditions.
• MACD: Tracks trend direction and momentum, capturing reversal signals.
• Bollinger Bands: Gauges price volatility and potential breakouts.
• Volume: Verifies trend validity and market liquidity.
• EMA/SMA: Identifies short/long-term trend directions.
• RSI Divergence: Warns of potential trend reversals.
• Fibonacci Retracement: Predicts key support/resistance levels.
• Stochastic Oscillator: Pinpoints extreme overbought/oversold states.
US Stock Indicators
• EPS: Reflects company profitability, a core fundamental metric.
• P/E Ratio: Evaluates stock valuation rationality.
• MACD/RSI: Tracks trend, momentum and overbought/oversold conditions.
• Volume: Confirms price movement strength.
• SMA/EMA: Clarifies short/long-term trends.
• ADX: Measures trend strength to avoid sideways market trades.
• Bollinger Bands: Judges volatility and breakout directions.
• Dividend Yield: Key for value investors, showing stable returns.
• ROE: Assesses company profit efficiency for long-term investment.
Density Zones (GM Crossing Clusters) + QHO Spin FlipsINDICATOR NAME
Density Zones (GM Crossing Clusters) + QHO Spin Flips
OVERVIEW
This indicator combines two complementary ideas into a single overlay: *this combines my earlier Geometric Mean Indicator with the Quantum Harmonic Oscillator (Overlay) with additional enhancements*
1) Density Zones (GM Crossing Clusters)
A “Density Zone” is detected when price repeatedly crosses a Geometric Mean equilibrium line (GM) within a rolling lookback window. Conceptually, this identifies regions where the market is repeatedly “snapping” across an equilibrium boundary—high churn, high decision pressure, and repeated re-selection of direction.
2) QHO Spin Flips (Regression-Residual σ Breaches)
A “Spin Flip” is detected when price deviates beyond a configurable σ-threshold (κ) from a regression-based equilibrium, using normalized residuals. Conceptually, this marks excursions into extreme states (decoherence / expansion), which often precede a reversion toward equilibrium and/or a regime re-scaling.
These two systems are related but not identical:
- Density Zones identify where equilibrium crossings cluster (a “singularity”/anchor behavior around GM).
- Spin Flips identify when price exceeds statistically extreme displacement from the regression equilibrium (LSR), indicating expansion beyond typical variance.
CORE CONCEPTS AND FORMULAS
SECTION A — GEOMETRIC MEAN EQUILIBRIUM (GM)
We define two moving averages:
(1) MA1_t = SMA(close_t, L1)
(2) MA2_t = SMA(close_t, L2)
We define the equilibrium anchor as the geometric mean of MA1 and MA2:
(3) GM_t = sqrt( MA1_t * MA2_t )
This GM line acts as an equilibrium boundary. Repeated crossings are interpreted as high “equilibrium churn.”
SECTION B — CROSS EVENTS (UP/DOWN)
A “cross event” is registered when the sign of (close - GM) changes:
Define a sign function s_t:
(4) s_t =
+1 if close_t > GM_t
-1 if close_t < GM_t
s_{t-1} if close_t == GM_t (tie-breaker to avoid false flips)
Then define the crossing event indicator:
(5) crossEvent_t = 1 if s_t != s_{t-1}
0 otherwise
Additionally, the indicator plots explicit cross markers:
- Cross Above GM: crossover(close, GM)
- Cross Below GM: crossunder(close, GM)
These provide directional visual cues and match the original Geometric Mean Indicator behavior.
SECTION C — DENSITY MEASURE (CROSSING CLUSTER COUNT)
A Density Zone is based on the number of cross events occurring in the last W bars:
(6) D_t = Σ_{i=0..W-1} crossEvent_{t-i}
This is a “crossing density” score: how many times price has toggled across GM recently.
The script implements this efficiently using a cumulative sum identity:
Let x_t = crossEvent_t.
(7) cumX_t = Σ_{j=0..t} x_j
Then:
(8) D_t = cumX_t - cumX_{t-W} (for t >= W)
cumX_t (for t < W)
SECTION D — DENSITY ZONE TRIGGER
We define a Density Zone state:
(9) isDZ_t = ( D_t >= θ )
where:
- θ (theta) is the user-selected crossing threshold.
Zone edges:
(10) dzStart_t = isDZ_t AND NOT isDZ_{t-1}
(11) dzEnd_t = NOT isDZ_t AND isDZ_{t-1}
SECTION E — DENSITY ZONE BOUNDS
While inside a Density Zone, we track the running high/low to display zone bounds:
(12) dzHi_t = max(dzHi_{t-1}, high_t) if isDZ_t
(13) dzLo_t = min(dzLo_{t-1}, low_t) if isDZ_t
On dzStart:
(14) dzHi_t := high_t
(15) dzLo_t := low_t
Outside zones, bounds are reset to NA.
These bounds visually bracket the “singularity span” (the churn envelope) during each density episode.
SECTION F — QHO EQUILIBRIUM (REGRESSION CENTERLINE)
Define the regression equilibrium (LSR):
(16) m_t = linreg(close_t, L, 0)
This is the “centerline” the QHO system uses as equilibrium.
SECTION G — RESIDUAL AND σ (FIELD WIDTH)
Residual:
(17) r_t = close_t - m_t
Rolling standard deviation of residuals:
(18) σ_t = stdev(r_t, L)
This σ_t is the local volatility/width of the residual field around the regression equilibrium.
SECTION H — NORMALIZED DISPLACEMENT AND SPIN FLIP
Define the standardized displacement:
(19) Y_t = (close_t - m_t) / σ_t
(If σ_t = 0, the script safely treats Y_t = 0.)
Spin Flip trigger uses a user threshold κ:
(20) spinFlip_t = ( |Y_t| > κ )
Directional spin flips:
(21) spinUp_t = ( Y_t > +κ )
(22) spinDn_t = ( Y_t < -κ )
The default κ=3.0 corresponds to “3σ excursions,” which are statistically extreme under a normal residual assumption (even though real markets are not perfectly normal).
SECTION I — QHO BANDS (OPTIONAL VISUALIZATION)
The indicator optionally draws the standard σ-bands around the regression equilibrium:
(23) 1σ bands: m_t ± 1·σ_t
(24) 2σ bands: m_t ± 2·σ_t
(25) 3σ bands: m_t ± 3·σ_t
These provide immediate context for the Spin Flip events.
WHAT YOU SEE ON THE CHART
1) MA1 / MA2 / GM lines (optional)
- MA1 (blue), MA2 (red), GM (green).
- GM is the equilibrium anchor for Density Zones and cross markers.
2) GM Cross Markers (optional)
- “GM↑” label markers appear on bars where close crosses above GM.
- “GM↓” label markers appear on bars where close crosses below GM.
3) Density Zone Shading (optional)
- Background shading appears while isDZ_t = true.
- This is the period where the crossing density D_t is above θ.
4) Density Zone High/Low Bounds (optional)
- Two lines (dzHi / dzLo) are drawn only while in-zone.
- These bounds bracket the full churn envelope during the density episode.
5) QHO Bands (optional)
- 1σ, 2σ, 3σ shaded zones around regression equilibrium.
- These visualize the current variance field.
6) Regression Equilibrium (LSR Centerline)
- The white centerline is the regression equilibrium m_t.
7) Spin Flip Markers
- A circle is plotted when |Y_t| > κ (beyond your chosen σ-threshold).
- Marker size is user-controlled (tiny → huge).
HOW TO USE IT
Step 1 — Pick the equilibrium anchor (GM)
- L1 and L2 define MA1 and MA2.
- GM = sqrt(MA1 * MA2) becomes your equilibrium boundary.
Typical choices:
- Faster equilibrium: L1=20, L2=50 (default-like).
- Slower equilibrium: L1=50, L2=200 (macro anchor).
Interpretation:
- GM acts like a “center of mass” between two moving averages.
- Crosses show when price flips from one side of equilibrium to the other.
Step 2 — Tune Density Zones (W and θ)
- W controls the time window measured (how far back you count crossings).
- θ controls how many crossings qualify as a “density/singularity episode.”
Guideline:
- Larger W = slower, broader density detection.
- Higher θ = only the most intense churn is labeled as a Density Zone.
Interpretation:
- A Density Zone is not “bullish” or “bearish” by itself.
- It is a condition: repeated equilibrium toggling (high churn / high compression).
- These often precede expansions, but direction is not implied by the zone alone.
Step 3 — Tune the QHO spin flip sensitivity (L and κ)
- L controls regression memory and σ estimation length.
- κ controls how extreme the displacement must be to trigger a spin flip.
Guideline:
- Smaller L = more reactive centerline and σ.
- Larger L = smoother, slower “field” definition.
- κ=3.0 = strong extreme filter.
- κ=2.0 = more frequent flips.
Interpretation:
- Spin flips mark when price exits the “normal” residual field.
- In your model language: a moment of decoherence/expansion that is statistically extreme relative to recent equilibrium.
Step 4 — Read the combined behavior (your key thesis)
A) Density Zone forms (GM churn clusters):
- Market repeatedly crosses equilibrium (GM), compressing into a bounded churn envelope.
- dzHi/dzLo show the envelope range.
B) Expansion occurs:
- Price can release away from the density envelope (up or down).
- If it expands far enough relative to regression equilibrium, a Spin Flip triggers (|Y| > κ).
C) Re-coherence:
- After a spin flip, price often returns toward equilibrium structures:
- toward the regression centerline m_t
- and/or back toward the density envelope (dzHi/dzLo) depending on regime behavior.
- The indicator does not guarantee return, but it highlights the condition where return-to-field is statistically likely in many regimes.
IMPORTANT NOTES / DISCLAIMERS
- This indicator is an analytical overlay. It does not provide financial advice.
- Density Zones are condition states derived from GM crossing frequency; they do not predict direction.
- Spin Flips are statistical excursions based on regression residuals and rolling σ; markets have fat tails and non-stationarity, so σ-based thresholds are contextual, not absolute.
- All parameters (L1, L2, W, θ, L, κ) should be tuned per asset, timeframe, and volatility regime.
PARAMETER SUMMARY
Geometric Mean / Density Zones:
- L1: MA1 length
- L2: MA2 length
- GM_t = sqrt(SMA(L1)*SMA(L2))
- W: crossing-count lookback window
- θ: crossing density threshold
- D_t = Σ crossEvent_{t-i} over W
- isDZ_t = (D_t >= θ)
- dzHi/dzLo track envelope bounds while isDZ is true
QHO / Spin Flips:
- L: regression + residual σ length
- m_t = linreg(close, L, 0)
- r_t = close_t - m_t
- σ_t = stdev(r_t, L)
- Y_t = r_t / σ_t
- spinFlip_t = (|Y_t| > κ)
Visual Controls:
- toggles for GM lines, cross markers, zone shading, bounds, QHO bands
- marker size options for GM crosses and spin flips
ALERTS INCLUDED
- Density Zone START / END
- Spin Flip UP / DOWN
- Cross Above GM / Cross Below GM
SUMMARY
This indicator treats the Geometric Mean as an equilibrium boundary and identifies “Density Zones” when price repeatedly crosses that equilibrium within a rolling window, forming a bounded churn envelope (dzHi/dzLo). It also models a regression-based equilibrium field and triggers “Spin Flips” when price makes statistically extreme σ-excursions from that field. Used together, Density Zones highlight compression/decision regions (equilibrium churn), while Spin Flips highlight extreme expansion states (σ-breaches), allowing the user to visualize how price compresses around equilibrium, releases outward, and often re-stabilizes around equilibrium structures over time.
ZLSMA//@version=5
indicator("T3 Al-Sat Sinyalli", overlay=true, shorttitle="T3 Signal")
// Kullanıcı ayarları
length = input.int(14, minval=1, title="Periyot")
vFactor = input.float(0.7, minval=0.0, maxval=1.0, title="Volatility Factor (0-1)")
// EMA hesaplamaları
ema1 = ta.ema(close, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
// T3 hesaplaması
c1 = -vFactor * vFactor * vFactor
c2 = 3 * vFactor * vFactor + 3 * vFactor * vFactor * vFactor
c3 = -6 * vFactor * vFactor - 3 * vFactor - 3 * vFactor * vFactor * vFactor
c4 = 1 + 3 * vFactor + vFactor * vFactor * vFactor + 3 * vFactor * vFactor
t3 = c1 * ema3 + c2 * ema2 + c3 * ema1 + c4 * close
// T3 çizimi
plot(t3, color=color.new(color.blue, 0), linewidth=2, title="T3")
// Mum renkleri
barcolor(close > t3 ? color.new(color.green, 0) : color.new(color.red, 0))
// Al-Sat sinyalleri
buySignal = ta.crossover(close, t3)
sellSignal = ta.crossunder(close, t3)
// Okları çiz
plotshape(buySignal, title="Al", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sat", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
EMA Color Cross + Trend Arrows//@version=5
indicator("T3 Al-Sat Sinyalli", overlay=true, shorttitle="T3 Signal")
// Kullanıcı ayarları
length = input.int(14, minval=1, title="Periyot")
vFactor = input.float(0.7, minval=0.0, maxval=1.0, title="Volatility Factor (0-1)")
// EMA hesaplamaları
ema1 = ta.ema(close, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
// T3 hesaplaması
c1 = -vFactor * vFactor * vFactor
c2 = 3 * vFactor * vFactor + 3 * vFactor * vFactor * vFactor
c3 = -6 * vFactor * vFactor - 3 * vFactor - 3 * vFactor * vFactor * vFactor
c4 = 1 + 3 * vFactor + vFactor * vFactor * vFactor + 3 * vFactor * vFactor
t3 = c1 * ema3 + c2 * ema2 + c3 * ema1 + c4 * close
// T3 çizimi
plot(t3, color=color.new(color.blue, 0), linewidth=2, title="T3")
// Mum renkleri
barcolor(close > t3 ? color.new(color.green, 0) : color.new(color.red, 0))
// Al-Sat sinyalleri
buySignal = ta.crossover(close, t3)
sellSignal = ta.crossunder(close, t3)
// Okları çiz
plotshape(buySignal, title="Al", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sat", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
C2 Closure Alert From Key Level (FVG & Swings)This indicator is designed based on the C2 Closure Trader, specifically focusing on identifying high-probability C2 Candle Closures and Key Level Sweeps. It automates the detection of "Candle 2" setups where price sweeps a key level (Swing High/Low or FVG) and closes back inside, signaling a potential reversal or continuation.
Key Features :
Advanced C2 Detection:
Detects when the current candle (C2) sweeps the previous candle (C1).
Deep Context Check: It validates the setup by checking if C1 was interacting with a Key Level (Swing High/Low or FVG) OR if C1 just created a Fresh FVG.
Logic: Ensures no valid setup is missed, even if the sweep happens instantly after FVG creation.
Straight Sweep Lines (Visuals):
Draws a clean, straight horizontal line from the C1 High/Low to the C2 candle.
Helps you visualize exactly which level was swept.
Customization: You can change the line color and width from settings.
Smart FVG & Swing Levels:
Automatically plots Active Bullish/Bearish FVGs and Swing Highs/Lows.
Mitigation Logic: Levels remain active until a valid signal is generated or price invalidates them. Once used, they turn gray (mitigated) to keep the chart clean.
Mechanical Settings Menu:
Fully customizable inputs organized into clean groups (Algorithm, Signal, Visuals, Limits).
Label Size Control: Adjust the signal label size (Tiny to Huge) to fit your screen.
Transparent Labels: Clean "C2" text without background boxes for a professional look.
Robust Alert System:
Three specific alert options added for automation:
Bullish C2 Closure: Fires only on valid Long setups.
Bearish C2 Closure: Fires only on valid Short setups.
Any C2 Close: Fires on any valid setup.
Note: Alerts are strictly set to trigger Once Per Bar Close to avoid false signals during running candles.
How to Use:
Add to Chart: Apply the indicator to your timeframe (Recommended: 15m, 1H, 4H for narrative).
Identify Signals: Look for the "C2" text label.
Green C2: Bullish Setup (Sweep of Low + Close Up).
Red C2: Bearish Setup (Sweep of High + Close Down).
Validation: The indicator automatically checks if the sweep occurred at a valid Swing Point or FVG. If you see the signal, the context is valid.
Entry: Use the close of the C2 candle as your confirmation to frame a trade or look for lower timeframe entries.
Settings Guide:
Algorithm Sensitivity: Adjust Pivot Left/Right Bars to define how strict the Swing Highs/Lows should be.
Signal Appearance: Change the text (e.g., "Entry") or adjust the Label Size.
Active/History Limits: Control how many active or old (mitigated) lines/boxes stay on the chart to manage clutter.
Visuals: Customize colors for Bull/Bear FVGs, Highs/Lows, and Sweep Lines to match your chart theme.
Disclaimer: This tool is for educational and analytical purposes only. Always manage your risk properly.
EMA COLOR BUY SELL
indicator("Sorunsuz EMA Renk + AL/SAT", overlay=true)
length = input.int(20, "EMA Periyodu")
src = input.source(close, "Kaynak")
emaVal = ta.ema(src, length)
isUp = emaVal > emaVal
emaCol = isUp ? color.green : color.red
plot(emaVal, "EMA", color=emaCol, linewidth=2)
buy = isUp and not isUp // kırmızı → yeşil
sell = not isUp and isUp // yeşil → kırmızı
plotshape(buy, style=shape.arrowup, location=location.belowbar, color=color.green, size=size.large, text="AL")
plotshape(sell, style=shape.arrowdown, location=location.abovebar, color=color.red, size=size.large, text="SAT")
alertcondition(buy, "EMA AL", "EMA yukarı döndü")
alertcondition(sell, "EMA SAT", "EMA aşağı döndü")
EMA Cross Color Buy/Sell//@version=5
indicator("EMA Color Cross + Trend Arrows V6", overlay=true, max_bars_back=500)
// === Inputs ===
fastLen = input.int(9, "Hızlı EMA")
slowLen = input.int(21, "Yavaş EMA")
// === EMA Hesapları ===
emaFast = ta.ema(close, fastLen)
emaSlow = ta.ema(close, slowLen)
// Trend Yönü
trendUp = emaFast > emaSlow
trendDown = emaFast < emaSlow
// === Çizgi Renkleri ===
lineColor = trendUp ? color.new(color.green, 0) : color.new(color.red, 0)
// === EMA Çizgileri (agresif kalın) ===
plot(emaFast, "Hızlı EMA", lineColor, 4)
plot(emaSlow, "Yavaş EMA", color.new(color.gray, 70), 2)
// === Ok Sinyalleri ===
buySignal = ta.crossover(emaFast, emaSlow)
sellSignal = ta.crossunder(emaFast, emaSlow)
// Büyük Oklar
plotshape(buySignal, title="AL", style=shape.triangleup, color=color.green, size=size.large, location=location.belowbar)
plotshape(sellSignal, title="SAT", style=shape.triangledown, color=color.red, size=size.large, location=location.abovebar)
// === Trend Bar Color ===
barcolor(trendUp ? color.green : color.red)
S50 Complete Hedge & Trade SystemTFEX:S501!
คู่มือการเทรด CALENDAR SPREAD
1. กลยุทธ์หลัก: MEAN REVERSION SPREAD TRADING
หลักการ:
- Spread ระหว่าง series จะมีค่าเฉลี่ย (Mean) และแกว่งไปมารอบๆ ค่าเฉลี่ยนี้
- เมื่อ Spread เบี่ยงเบนไปจาก Mean มากเกินไป จะกลับมาหาค่าเฉลี่ย (Mean Reversion)
2. INDICATORS ที่ใช้
A. Z-Score
Z-Score = (Spread ปัจจุบัน - Spread เฉลี่ย) / Standard Deviation
การตีความ:
- Z > +2.0 → Spread แพงเกินไป → SHORT spread
- Z < -2.0 → Spread ถูกเกินไป → LONG spread
- Z ≈ 0 → Spread อยู่ที่ค่าเฉลี่ย → EXIT
B. Correlation
Correlation > 0.9 = ดีมาก (เคลื่อนไหวพร้อมกัน 90%+)
Correlation > 0.7 = ดี (ใช้ได้)
Correlation < 0.7 = ไม่แนะนำ (Hedge ไม่มีประสิทธิภาพ)
C. Beta & Hedge Ratio
Beta = Cov(S1, S2) / Var(S2)→ บอกว่า S1 เคลื่อนไหวเท่าไหร่เมื่อ S2 เคลื่อนไหว 1 หน่วย
Hedge Ratio = Beta→ ใช้คำนวณจำนวน contract ที่ต้อง hedge
3. วิธีการเทรด SPREAD (ทีละขั้นตอน)
STEP 1: หาโอกาส
เงื่อนไข Entry:
1. |Z-Score| >= 2.0
2. Correlation > 0.7
3. Signal = "SHORT SPREAD" หรือ "LONG SPREAD"
STEP 2: คำนวณ Position Size
ตัวอย่าง:
- Account Size = 1,000,000 บาท
- Risk Per Trade = 2% = 20,000 บาท
- Spread Std Dev = 15 จุด
- Stop Loss = 1.0x Std Dev = 15 จุด
- S50 มูลค่า = 5 บาท/จุด
Position Size = Risk Amount / (SL Distance × Point Value)
= 20,000 / (15 × 5)
= 20,000 / 75
= 266 contracts (ปัดเป็น 26 สัญญา)
STEP 3: คำนวณ Hedge Ratio
สมมติ: Beta (S1:S2) = 1.05
ถ้าเทรด SHORT S2-S1 spread:
- Sell S2: 26 contracts
- Buy S1: 26 × 1.05 = 27.3 → ปัดเป็น 27 contracts
Portfolio Delta ≈ 0 (Market Neutral)
4. ตัวอย่างการเทรดจริง
SCENARIO A: SHORT SPREAD (Z-Score = +2.5)
สถานการณ์:
- S2-S1 Spread = 50 จุด
- Spread MA = 35 จุด
- Spread Std Dev = 6 จุด
- Z-Score = (50-35)/6 = +2.5 ⚠️ แพงเกินไป
- Correlation = 0.92 ✅
- Beta = 1.05
TRADE PLAN:
1. SELL S2: 10 contracts @ 1,200
2. BUY S1: 10 × 1.05 = 10.5 → 11 contracts @ 1,150
Initial Spread = 50 จุด
Take Profit (TP):
- Target Spread = MA = 35 จุด
- TP Distance = 50 - 35 = 15 จุด
- Profit = 15 × 5 = 75 บาท/spread
- Total Profit = 75 × 10 = 750 บาท
Stop Loss (SL):
- SL Spread = MA + (1.5 × Std Dev) = 35 + 9 = 44 จุด
- SL Distance = 50 - 44 = 6 จุด (ผิดพลาด - ควรเป็น 50 + 6 = 56)
- Loss = 6 × 5 × 10 = 300 บาท
Risk:Reward = 300:750 = 1:2.5
SCENARIO B: LONG SPREAD (Z-Score = -2.3)
สถานการณ์:
- S3-S2 Spread = 20 จุด
- Spread MA = 35 จุด
- Spread Std Dev = 6.5 จุด
- Z-Score = (20-35)/6.5 = -2.3 ⚠️ ถูกเกินไป
- Correlation = 0.88 ✅
- Beta = 1.03
TRADE PLAN:
1. BUY S3: 10 contracts @ 1,230
2. SELL S2: 10 × 1.03 = 10.3 → 10 contracts @ 1,210
Initial Spread = 20 จุด
Take Profit:
- Target Spread = 35 จุด
- Profit = (35-20) × 5 × 10 = 750 บาท
Stop Loss:
- SL Spread = MA - (1.5 × Std Dev) = 35 - 9.75 = 25.25 จุด
- SL = 20 - (20-25.25) = 14 จุด
- Loss = 6 × 5 × 10 = 300 บาท
5. RISK MANAGEMENT
A. Position Sizing Rules
1. อย่าเสี่ยงเกิน 2-3% ต่อการเทรด
2. ใช้ Beta Hedge Ratio เสมอ
3. ตรวจสอบ Margin requirement
B. Stop Loss Strategy
วิธีที่ 1: Fixed Std Dev
- SL = Entry ± (1.0-1.5x Std Dev)
วิธีที่ 2: ATR-based
- SL = Entry ± (1.5x ATR)
วิธีที่ 3: Time-based
- ปิดภายใน 3-5 วัน ถ้าไม่ได้กำไร
C. Take Profit Strategy
วิธีที่ 1: Target MA
- TP เมื่อ Spread กลับมาที่ MA
วิธีที่ 2: Partial Profit
- ปิด 50% เมื่อได้ 1x Std Dev
- ปิดอีก 50% เมื่อ Z-Score = 0
วิธีที่ 3: Trailing Stop
- Trailing SL = 0.5x Std Dev
6. สูตรคำนวณสำคัญ
1. Position Size
position_size = (account_size × risk_pct) / (sl_distance × point_value)
2. Hedge Contracts
hedge_contracts = position_size × beta
3. Profit/Loss Calculation
pnl = (exit_spread - entry_spread) × contracts × point_value
4. Risk:Reward Ratio
risk = sl_distance × contracts × point_value
reward = tp_distance × contracts × point_value
rr_ratio = reward / risk // ควร >= 2:1
5. Spread Value
spread_value = price_far - price_near
7. CHECKLIST ก่อนเทรด
☐ Z-Score >= ±2.0
☐ Correlation > 0.7
☐ Beta Hedge Ratio คำนวณแล้ว
☐ Position Size ไม่เกิน 2-3% risk
☐ TP/SL กำหนดชัดเจน
☐ Risk:Reward >= 2:1
☐ Margin เพียงพอ
☐ ตรวจสอบ Expiry Date ทั้ง 2 series
8. เทคนิคขั้นสูง
A. Calendar Roll Strategy
เมื่อ Near series ใกล้หมดอายุ:
1. ปิด Near leg
2. เปิด Next series leg ใหม่
3. รักษา Spread position ต่อไป
B. Butterfly Spread
ใช้ 3 series พร้อมกัน:
- Buy S1
- Sell 2×S2
- Buy S3
เหมาะกับตลาดไซด์เวย์
C. Dynamic Hedging
ปรับ Hedge Ratio ตาม:
- Beta ที่เปลี่ยนแปลง
- Volatility
- Time to Expiry
Vega Convexity Engine [PRO]ENGINEERED ASYMMETRY.
This is the flagship Stage 2 Specialist Model of the Vega Crypto Strategies ecosystem.
While the free "Regime Filter" tells you when to trade (filtering out chop), the Convexity Engine tells you how to trade. It activates only when the Regime Filter confirms an Impulse, classifying the specific vector of the market move to maximize risk-adjusted returns.
PRO FEATURES
This script visualizes the output of our Hierarchical Machine Learning Engine:
🚀 Directional Classification:
It does not just say "Buy." It classifies volatility into 4 distinct probability classes:
- EXPLOSION: High-confidence, high-velocity upside (Fat-Tail).
- RALLY: Standard trend continuation.
- PULLBACK: Short-term correction opportunity.
- CRASH: High-confidence downside (Long Squeeze Detection).
🛡️ Dynamic Risk Engine (Intraday Stops):
The "+" markers on your chart represent the Vega Institutional Stop Loss . These levels dynamically adjust based on Average True Range (ATR) and Volatility Z-Scores.
Strategy: If price breaches the "+" marker, the hypothesis is invalidated. Exit immediately.
📊 Institutional HUD:
A professional heads-up display showing the current Regime, Vector, and Risk Deployment status in real-time.
THE PHILOSOPHY
"Convexity" means limited downside with unlimited upside. By combining the Regime Filter (sitting in cash during noise) with Dynamic Stops (cutting losers fast), this engine is designed to capture the "fat tails" of the crypto market distribution.
🔒 HOW TO GET ACCESS
This is an Invite-Only script. It is strictly for members of Vega Crypto Strategies .
To unlock access, please visit the link in the Author Profile below or check our signature. Once subscribed via Whop, your TradingView username will be automatically authorized instantly.
Disclaimer: This tool is for educational purposes only. Past performance is not indicative of future results. Trading cryptocurrencies involves significant risk.
SuperTrend Basit v5 - Agresif//@version=5
indicator("SuperTrend Basit v5 - Agresif", overlay=true)
// === Girdi ayarları ===
factor = input.float(3.0, "ATR Katsayısı")
atrPeriod = input.int(10, "ATR Periyodu")
// === Hesaplamalar ===
= ta.supertrend(factor, atrPeriod)
// === Çizim ===
bodyColor = direction == 1 ? color.new(color.lime, 0) : color.new(color.red, 0)
bgcolor(direction == 1 ? color.new(color.lime, 85) : color.new(color.red, 85))
plot(supertrend, color=bodyColor, linewidth=4, title="SuperTrend Çizgisi") // Kalın çizgi
// === Al/Sat sinyali ===
buySignal = ta.crossover(close, supertrend)
sellSignal = ta.crossunder(close, supertrend)
plotshape(buySignal, title="AL", location=location.belowbar, color=color.lime, style=shape.triangleup, size=size.large, text="AL")
plotshape(sellSignal, title="SAT", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.large, text="SAT")
SuperTrend BUY SELL Color//@version=6
indicator("SuperTrend by Cell Color", overlay=true, precision=2)
// --- Parametreler ---
atrPeriod = input.int(10, "ATR Periyodu")
factor = input.float(3.0, "Çarpan")
showTrend = input.bool(true, "Trend Renkli Hücreleri Göster")
// --- ATR Hesaplama ---
atr = ta.atr(atrPeriod)
// --- SuperTrend Hesaplama ---
up = hl2 - factor * atr
dn = hl2 + factor * atr
var float trendUp = na
var float trendDown = na
var int trend = 1 // 1 = bullish, -1 = bearish
trendUp := (close > trendUp ? math.max(up, trendUp ) : up)
trendDown := (close < trendDown ? math.min(dn, trendDown ) : dn)
trend := close > trendDown ? 1 : close < trendUp ? -1 : trend
// --- Renkli Hücreler ---
barcolor(showTrend ? (trend == 1 ? color.new(color.green, 0) : color.new(color.red, 0)) : na)
// --- SuperTrend Çizgileri ---
plot(trend == 1 ? trendUp : na, color=color.green, style=plot.style_line, linewidth=2)
plot(trend == -1 ? trendDown : na, color=color.red, style=plot.style_line, linewidth=2)
GHOST SNIPERGHOST SNIPER™ – BB Reversal Engine + Smart Entry / Exit Structure Core
MNQ / MES / Stocks / ETFs / Crypto / FX
BB Reversals · Breakouts · PD Structure · Liquidity Sweeps · Displacement · Smart Targets · Quick SL & TP Logic
________________________________________
Summary
Ghost Sniper™ is a high-precision reversal and breakout engine designed for intraday scalping on MNQ/MES, while remaining highly effective across equities, ETFs, crypto, and FX.
It blends a custom Bollinger Reversal Framework (BB Bottom / BB Top Sniper) with an internal ICT-style structure core to filter noise and isolate only high-quality turning points.
The system reads stretch and failure conditions, detects band breakouts, and identifies Bollinger Band failures to anticipate sharp reversals. It includes a Quick TP (QTP) and Quick SL (SL-Q) module for micro-scalps, along with full ICT-style structural targets (TP1, TP2, TP3) for extended runs.
All TP levels and SL placement are derived from smart structural logic, designed to reduce premature stop-outs and improve fill reliability during volatility.
Real-time intrabar logic ensures entries trigger the moment structure confirms — no repainting.
________________________________________
BUY / SELL Signal Activation & Checklist HUD
Ghost Sniper™ uses a rule-based BUY / SELL triggering system driven by real-time structural confirmation — not delayed indicators or hindsight logic.
Entries only activate when a multi-condition internal checklist aligns, combining:
• Bollinger stretch, failure, or breakout behavior
• Liquidity sweep or rejection context
• Micro structure confirmation (BOS / displacement)
• Premium / Discount positioning
• Momentum and reversal candle confirmation
A built-in Checklist Activation HUD visually displays when conditions are forming, aligning, or fully confirmed, allowing traders to see why a signal is valid — not just that it fired.
BUY / SELL signals trigger only when checklist confirmation is reached, filtering low-probability setups and maintaining clean, high-quality entries.
All logic operates intrabar and in real time, with no repainting.
________________________________________
Market Structure & Context Awareness
Ghost Sniper™ incorporates a streamlined ICT-inspired framework, including:
• Liquidity sweep awareness (stop-runs and grabs)
• Micro BOS confirmation
• Premium / Discount context
• Impulse and displacement reads
• Reversal candle assist
• Optional PD / HTF alignment gates
To support institutional-grade context without visual clutter, Ghost Sniper™ also includes a comprehensive set of fully optional, user-selectable tools, allowing traders to tailor the chart to their workflow:
• VWAP
• Up to 5 configurable moving averages
• Bollinger Bands
• Automatic liquidity sweep level detection
• Opening Range Breakout (ORB)
• Midnight Open
• 9:30 AM New York Open
• Previous Day High / Low (PDH / PDL)
• Previous Week High / Low (PWH / PWL)
• Current Week High / Low (CWH / CWL)
• Monthly High / Low
• Previous Month High / Low (PMH / PML)
• Global session tracking, including:
o Asia Session
o London Session
o New York Session
All levels and context tools are individually selectable, designed to provide structure and bias awareness while keeping charts clean and focused.
________________________________________
Execution & Risk Logic
Ghost Sniper™ automatically prints clean, minimal BUY / SELL signals, intelligent stop placement, and progressive target logic:
QTP → TP1 → TP2 → TP3
A built-in Break-Even engine, structural invalidation logic, and one-trade-at-a-time control help maintain disciplined execution and consistent risk management.
Designed for traders who want a fast, decisive, and high-probability entry engine without visual noise or unnecessary complexity.
________________________________________
Disclaimer
This tool is for educational and research purposes only and is not financial advice.
Always test thoroughly in replay or paper trading before using in live markets.
Renkli EMA_MA CROSS
indicator("Renkli MA Kesişimi + Oklar", overlay=true, precision=2
fastLen = input.int(20, "Hızlı MA (Fast)")
slowLen = input.int(50, "Yavaş MA (Slow)")
maType = input.string("EMA", "MA Tipi", options= )
showArrows = input.bool(true, "Okları Göster")
fastMA = maType == "EMA" ? ta.ema(close, fastLen) : ta.sma(close, fastLen)
slowMA = maType == "EMA" ? ta.ema(close, slowLen) : ta.sma(close, slowLen)
barcolor(fastMA > slowMA ? color.new(color.green, 0) : color.new(color.red, 0))
longSignal = ta.crossover(fastMA, slowMA)
shortSignal = ta.crossunder(fastMA, slowMA)
plotshape(showArrows and longSignal, title="Al", style=shape.labelup, location=location.belowbar, color=color.green, size=size.large, text="AL")
plotshape(showArrows and shortSignal, title="Sat", style=shape.labeldown, location=location.abovebar, color=color.red, size=size.large, text="SAT")
plot(fastMA, color=color.blue, title="Hızlı MA")
plot(slowMA, color=color.orange, title="Yavaş MA")
Daily Vertical Linesadjust the time hour and minute base on ur timeframe.
please note that for asian beijing time you will need to deduct 1 hour
Renkli EMA Crossover//@version=5
indicator("Renkli EMA Crossover", overlay=true)
// EMA periyotları
fastLength = input.int(9, "Hızlı EMA")
slowLength = input.int(21, "Yavaş EMA")
// EMA hesaplama
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
// EMA renkleri
fastColor = fastEMA > fastEMA ? color.green : color.red
slowColor = slowEMA > slowEMA ? color.blue : color.orange
// EMA çizgileri (agresif kalın)
plot(fastEMA, color=fastColor, linewidth=3, title="Hızlı EMA")
plot(slowEMA, color=slowColor, linewidth=3, title="Yavaş EMA")
// Kesişimler
bullCross = ta.crossover(fastEMA, slowEMA)
bearCross = ta.crossunder(fastEMA, slowEMA)
// Oklarla sinyal gösterimi
plotshape(bullCross, title="Al Sinyali", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.large)
plotshape(bearCross, title="Sat Sinyali", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.large)
Smart High low Pivot Points
## Description
The **Pivot High Low Indicator** is a powerful technical analysis tool designed to automatically identify and highlight significant pivot points in price action. This indicator marks crucial reversal zones where price has formed local peaks (pivot highs) and troughs (pivot lows), helping traders spot potential support/resistance levels and trend reversal points.
The indicator features intelligent price formatting that adapts to any market - from crypto tokens to large-cap stocks - displaying values in readable formats (M/B/T notation for large numbers, precise decimals for small values).
---
## Key Features
### 🎯 **Dual Pivot Detection System**
- **Pivot Highs**: Automatically identifies local price peaks where price is higher than surrounding bars
- **Pivot Lows**: Detects local price bottoms where price is lower than surrounding bars
- Independent left/right length settings for each pivot type
### 🎨 **Fully Customizable Appearance**
- Separate color controls for pivot high and low labels
- Custom text colors for optimal visibility
- Distinct label background colors (default: green for highs, red for lows)
- Clean, non-intrusive chart overlay
### ⚙️ **Flexible Configuration**
- Adjustable left/right bar lengths for sensitivity control
- Independent settings for highs and lows
- Real-time adaptation to market conditions
---
## Benefits
✅ **Identify Key Support & Resistance Levels** - Pivot points often act as important price levels where reversals occur
✅ **Spot Trend Reversals Early** - Recognize when momentum shifts from bullish to bearish or vice versa
✅ **Enhanced Market Structure Analysis** - Understand swing highs and lows for better trade timing
✅ **Works Across All Markets** - Optimized for stocks, forex, crypto, commodities, and indices
✅ **Clean Visual Presentation** - Labeled price points directly on chart without clutter
✅ **Universal Price Display** - Automatically formats prices for readability regardless of asset value
## Settings Available
### **LENGTH LEFT / RIGHT**
| Setting | Default | Min | Description |
|---------|---------|-----|-------------|
| **Pivot High - Left** | 15 | 1 | Number of bars to the left that must be lower than the pivot high |
| **Pivot High - Right** | 15 | 1 | Number of bars to the right that must be lower than the pivot high |
| **Pivot Low - Left** | 7 | 1 | Number of bars to the left that must be higher than the pivot low |
| **Pivot Low - Right** | 7 | 1 | Number of bars to the right that must be higher than the pivot low |
**💡 Tip**: Higher values = fewer, more significant pivots. Lower values = more frequent, minor pivots.
### **TEXT COLOR / LABEL COLOR**
| Setting | Default | Description |
|---------|---------|-------------|
| **Pivot High - Text Color** | White | Color of the price text on pivot high labels |
| **Pivot High - Label Color** | Green (#005703) | Background color of pivot high labels |
| **Pivot Low - Text Color** | White | Color of the price text on pivot low labels |
| **Pivot Low - Label Color** | Red (#7b0000) | Background color of pivot low labels |
## Use Cases
- 📈 **Swing Trading**: Identify swing high/low entry and exit points
- 🎯 **Support/Resistance**: Mark key levels for limit orders
- 📊 **Market Structure**: Analyze higher highs/higher lows or lower highs/lower lows
- ⚡ **Breakout Trading**: Spot when price breaks above pivot highs or below pivot lows
- 🔄 **Reversal Trading**: Enter trades at confirmed pivot points
Single Candle Divergence E.V//AMarks single‑candle divergences between the asset on your chart and any user‑selectable second asset, displaying the second asset’s full OHLC candles in a dedicated separate panel.
HA Line + Trend Oklar//@version=5
indicator("HA Line + Trend Oklar", overlay=true)
// Heiken Ashi hesaplamaları
haClose = (open + high + low + close) / 4
var float haOpen = na
haOpen := na(haOpen) ? (open + close) / 2 : (haOpen + haClose ) / 2
haHigh = math.max(high, math.max(haOpen, haClose))
haLow = math.min(low, math.min(haOpen, haClose))
// Trend yönüne göre renk
haColor = haClose >= haClose ? color.green : color.red
// HA kapanış çizgisi
plot(haClose, color=haColor, linewidth=3, title="HA Close Line")
// Agresif oklar ile trend gösterimi
upArrow = ta.crossover(haClose, haClose )
downArrow = ta.crossunder(haClose, haClose )
plotshape(upArrow, title="Up Arrow", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.large)
plotshape(downArrow, title="Down Arrow", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.large)
Bollinger Bands with Price Labels============================================================================
BOLLINGER BANDS PRO - ENHANCED TRADING INDICATOR
============================================================================
HEADLINE: Professional Bollinger Bands with Dynamic Price Labels & Smart Alerts
DESCRIPTION:
// This advanced Bollinger Bands indicator goes beyond the basic implementation
// by providing real-time price tracking, customizable visual themes, and
// intelligent alert system for better trading decisions.
// KEY FEATURES:
• Dynamic Price Labels - Auto-formatting for readability (M/B/T for large numbers)
• Smart Alerts - Get notified on key price crossovers and band touches
• Dual Color Themes - Dark and Light modes for any chart background
• Custom Label Styling - Full control over size, shape, position, and colors
• Visual Clarity - Dotted lines connecting bands to labels
• Separate Color Zones - Different fills above/below basis for instant analysis
• Real-time Updates - Labels update dynamically with live price action
// BENEFITS OVER STANDARD BOLLINGER BANDS:
✓ No need to hover over lines to see exact prices
✓ Instant recognition of overbought/oversold zones with color coding
✓ Professional appearance with customizable branding
✓ Automated alerts eliminate constant chart monitoring
✓ Better readability for high-value assets (crypto, stocks)
✓ Cleaner charts with organized label placement
✓ Theme compatibility for day/night trading sessions
// PERFECT FOR:
- Day traders needing quick price reference
- Swing traders monitoring multiple timeframes
- Crypto traders dealing with large price numbers
- Professional chartists wanting clean, branded setups
// ========================================
ZLSMA Trend + Al/Sat Sinyali/@version=6
indicator("ZLSMA Trend + Al/Sat Sinyali", overlay=true, max_labels_count=500)
length = input.int(25, "ZLSMA Periyodu")
src = input.source(close, "Kaynak")
thickness = input.int(4, "Çizgi Kalınlığı")
colorUp = input.color(color.new(color.lime, 0), "Yükselen Renk")
colorDown = input.color(color.new(color.red, 0), "Düşen Renk")
ema1 = ta.ema(src, length)
ema2 = ta.ema(ema1, length)
zlsma = 2 * ema1 - ema2
trendUp = zlsma > zlsma
trendDown = zlsma < zlsma
zlsmaColor = trendUp ? colorUp : colorDown
plot(zlsma, title="ZLSMA", color=zlsmaColor, linewidth=thickness)
buySignal = ta.crossover(close, zlsma)
sellSignal = ta.crossunder(close, zlsma)
plotshape(buySignal, title="Al", location=location.belowbar, color=color.new(color.lime, 0), style=shape.triangleup, size=size.large, text="AL")
plotshape(sellSignal, title="Sat", location=location.abovebar, color=color.new(color.red, 0), style=shape.triangledown, size=size.large, text="SAT")
bgcolor(trendUp ? color.new(color.lime, 90) : color.new(color.red, 90))
Seasonality Calculator Custom Date Range AnalysisThe Seasonality Calculator lets you manually test any seasonal window by choosing a start day/month and end day/month, and then evaluating how that exact period performed historically.
For the selected date range, the script looks back over past years and calculates:
Average return
Hit rate (win rate)
Winning years vs. total years
The results are displayed in a compact on-chart table showing:
Entry date & exit date (calendar days)
Pattern length
Average return & hit rate
Win/trade count
Optionally, the indicator can also draw highlighted boxes for each year of the chosen seasonal window, so you can visually inspect how that specific date range behaved in the past.
You can:
Choose the exact start and end dates (day & month),
Set how many years of history to include,
And filter by simple regimes such as US election cycle years.
All calculations are based on daily data, and the math is consistent with the Seasonality Screener: if you take a pattern from the Screener and enter the same dates into this Calculator, you will get the same historical statistics.
Use this tool to experiment with custom seasonal ideas and to fine-tune windows you discover with the Screener, always in combination with your own analysis and risk management.






















