Ms. PACMAN 27-70Simple EMA ribbon 27-70
For crossover of price plot using Line Indicator Symbol
Enter when price exits the ribbon in your direction for buy vs sell.
Exit when price exits the other side of the ribbon.
If price returns inside the ribbon, stay in your position, because many times it will reverse and stay in your favor.
Can use continuous (just switch positions long or short) and go all session OR as long only or short only.
Indicateurs et stratégies
C: Daily Execution + Targets/DTE + VWAP Self-ContainedWhat This Indicator Does (Group 3 + Group 4)
This script is the execution and planning layer of the trading system.
It does not decide whether you are allowed to trade. That decision is already made upstream by the Monthly (Group 1) and Weekly (Group 2) indicators.
Instead, this indicator answers four practical questions once a trade is permitted:
Which roadmap is active right now?
(Roadmap A or Roadmap B)
Is there a valid entry trigger today?
(And is it confirmed or invalidated?)
If I enter, where is the most logical next target?
(Based on value structure, not guesses)
How much time do I need for the move?
(Translated into ATR units, days, and suggested options DTE)
You should only pay attention to this indicator after:
Monthly Risk is ON
Weekly regime is favorable or acceptable
Group 3: Daily Execution Engine
Purpose
Group 3 controls entries and trade direction.
It is intentionally strict and mechanical so that you are not interpreting candles emotionally.
What it Tracks
Roadmap A (Momentum / Continuation)
Looks for directional acceptance and follow-through
Designed for expansion and escape regimes
Roadmap B (Acceptance / Rotation)
Requires two-close acceptance
Designed for rotational or re-entry conditions
Trigger state
No trigger
Trigger active
Trigger invalidated
Bias resolution
Long
Short
Neutral (stand aside)
At any moment, the script knows:
Which roadmap is live
Whether a trigger exists
Whether that trigger is still valid
This prevents “almost trades” and hindsight entries.
Group 4: Targets + DTE Board
Purpose
Group 4 separates planning from execution.
Once an entry exists (or is simulated), this group answers:
Where should price logically go next?
How far is that in ATR terms?
How much time does that usually require?
Target Selection Logic (in priority order)
Targets are selected automatically based on value structure, not indicators:
Weekly POC
Monthly POC
Weekly HVNs (nearest in direction)
Opposite Weekly Value Edge
Opposite Monthly Value Edge
Optional Monthly Extensions (if enabled)
Only valid and enabled levels are considered.
The script always chooses the nearest valid target in the trade direction.
You can override everything with a manual target if needed.
Entry Reference Logic
The script supports three entry reference modes:
Manual
You type in your actual fill price
Signal bar close
Uses the close of the trigger bar
Next open (simulated)
Approximates realistic fills for signal-based trades
This entry reference is used for:
ATR distance
Days needed
DTE estimation
Time & DTE Estimation
Once an entry and target exist, the script calculates:
ATR units to target
Estimated days needed
Suggested minimum DTE
This does not recommend strikes.
It only answers:
“How much time does this idea realistically need to work?”
That keeps strategy and options selection cleanly separated.
What This Indicator Does Not Do
It does not override Monthly or Weekly permission
It does not force trades
It does not optimize or backtest
It does not predict direction without a trigger
If nothing is valid, it will clearly show no trade.
How to Use This in Your Workflow
Check Group 1 (Monthly)
Risk ON
Location makes sense
Check Group 2 (Weekly)
Regime identified
No conflict with monthly
Only then look at this indicator
Wait for a valid roadmap trigger
Confirm bias and direction
Review the auto target and DTE board
Decide if the trade fits your risk and time constraints
If any upstream condition changes, this indicator naturally goes quiet.
Acrobatic Loto Predictor [Taolue Remix]市場のカオスを、幸運の数字へ。
このインジケーターは、現在のチャートの「価格変動」「時間」「ボラティリティ」を複雑な計算式(カオス力学)に通すことで、 Loto 6 (6/43) および Loto 7 (7/37) の予想数字を算出する実験的なツールです。
単なるランダム生成(乱数)ではありません。RSIやボリンジャーバンドといったテクニカル指標の数値を「乱数の種(シード)」として使用しているため、 「相場の息遣い」がそのまま数字として出力されます。
【主な機能】
1. モード: 設定画面から「Loto 6」と「Loto 7」を切り替え可能です。
2. カオス&テクニカル・ロジック:
- カオス力学: ローレンツ・アトラクタに着想を得た非線形計算。
- テクニカル: RSI(相対力指数)とボリンジャーバンドの位置関係を係数化。
- 概念定数: 黄金比(φ)や特定の数学的定数を隠し味に配合。
3. ストップ(固定)機能: チャートが動くたびに数字は変動しますが、「ここだ!」と思った瞬間にチェックボックスで数字を 完全固定(ロック) できます。
4. リロール(再抽選)機能: 固定した数字が気に入らない場合、リロール値を変更することで、その瞬間のパラレルワールド(別の計算結果)を呼び出せます。
5. ディスコモード: 数字が変動している間は背景色がリズミカルに変化し、固定すると色が落ち着く視覚効果付き。
【使い方】
1. チャートに追加します(ビットコインや為替など、動きのある銘柄推奨)。
2. 設定画面で Loto 6 か Loto 7 を選びます。
3. チャートを眺め、相場の「波」を感じます。
4. 直感的に良いタイミングで設定画面の 「ストップ(数値を固定)」 にチェックを入れます。
5. 表示された数字をメモします。(気に入らなければ「結果のリロール」数値を変更してください)
※免責事項:
このツールはエンターテインメント目的で作成されています。当選を保証するものではありません。宝くじの購入は自己責任で楽しみましょう。
---
Transform Market Chaos into Lucky Numbers.
This indicator is an experimental tool that generates predictions for Loto 6 and Loto 7 by feeding current chart data—price action, time, and volatility—into complex chaotic algorithms.
This is not a simple random number generator. It uses technical indicators like RSI and Bollinger Bands as "seeds" for generation. Essentially, the heartbeat of the market decides your numbers.
1. Mode: Switch between "Loto 6" (pick 6 from 43) and "Loto 7" (pick 7 from 37) in the settings.
2. Chaos & Technical Logic:
- Chaos Dynamics: Non-linear calculations inspired by the Lorentz Attractor.
- Technical Analysis: Weighing factors based on RSI and Bollinger Band positioning.
- Conceptual Constants: Incorporates the Golden Ratio (φ) and other mathematical constants.
3. Freeze/Lock Function: Numbers fluctuate with every tick. Use the "Stop" checkbox to lock the numbers at the exact moment you feel the market energy align.
4. Reroll System: If you lock the numbers but don't like the result, change the "Reroll" value to access a parallel timeline (alternate calculation result) for the same candle.
5. Disco Visuals: Background colors dance rhythmically while spinning and settle down when locked.
1. Add to chart (highly volatile assets like BTC or FX recommended).
2. Select Loto 6 or Loto 7 in the settings.
3. Watch the chart and feel the "wave" of the market.
4. Check the "Stop (Lock Numbers)" box in settings when your intuition strikes.
5. Note down the numbers. (Use the "Reroll" input if you want to reshape your destiny).
This tool is for entertainment purposes only. It does not guarantee any lottery winnings. Please play responsibly.
BTC EMA-200 Z-Score (SDCA)The 200-day EMA z-score measures BTC’s deviation from its long-term trend in a normalized way. It calculates the percentage difference between the current price and the 200-day EMA, then converts this deviation into a z-score using a 250-day rolling mean and standard deviation. A positive score occurs when BTC is below the EMA, signaling undervaluation and a buying opportunity for SDCA. A negative score occurs when BTC is above the EMA, indicating overvaluation and suggesting caution or reduced allocation. This indicator filters out short-term noise, providing a reliable, long-term valuation signal for strategic market entry and exit decisions.
RSquared (log prices)Rolling Trend R² measures the strength of trends using a rolling R² calculation on log prices. Values near 1 indicate a strong, persistent trend, while low values signal choppy or mean-reverting conditions. Includes regime highlighting, reference levels, and an info panel for quick market state identification.
GBPUSD/EURUSD FVG Synchronizationsmt divergence between eurusd and gbpusd. with swing low detection. help traders execute trades with only these pairs
Two MA Crossover with Buy/Sell Labels//@version=5
indicator("Two MA Crossover with Buy/Sell Labels", overlay=true)
// === User Inputs ===
shortPeriod = input.int(10, title="Fast MA Period")
longPeriod = input.int(100, title="Slow MA Period")
maType = input.string("EMA", title="MA Type", options= )
// === Moving Average Function ===
ma(src, length) =>
maType == "EMA" ? ta.ema(src, length) : ta.sma(src, length)
// === Calculate MAs ===
fastMA = ma(close, shortPeriod)
slowMA = ma(close, longPeriod)
// === Plot MAs ===
plot(fastMA, title="Fast MA", linewidth=2, color=color.green)
plot(slowMA, title="Slow MA", linewidth=2, color=color.red)
// === Crossover Conditions ===
buySignal = ta.crossover(fastMA, slowMA)
sellSignal = ta.crossunder(fastMA, slowMA)
// === Buy Label ===
if buySignal
label.new(bar_index, low, "BUY 🚀",
style=label.style_label_up,
textcolor=color.white,
color=color.green)
// === Sell Label ===
if sellSignal
label.new(bar_index, high, "SELL 🔻",
style=label.style_label_down,
textcolor=color.white,
color=color.red)
Timebender - Day SeparatorTimebender — NY Anchored Day Separator
Many traders rely on broker-based day boundaries, which often do not align with New York time — the primary liquidity clock for FX and macro-driven markets. When the trading day is anchored incorrectly, it can distort the reading of weekly structure, session behavior, and intraday narrative.
This script provides a clear and configurable way to anchor trading days to a user-defined timezone and visually separate them on the chart.
What This Script Does
Highlights individual trading days using background shading
Draws vertical separators at the exact start of each shifted trading day
Allows independent toggling of background highlights and separator lines
Supports day-specific coloring so each trading day is immediately recognizable
Enables manual timezone shifting so traders can align charts to New York regardless of broker feed
What Makes It Different
Most day separators rely strictly on exchange time. This script detects calendar transitions from a manually shifted timestamp, allowing traders to define their own day boundary.
This is particularly useful for traders who anchor their analysis to New York time rather than broker session clocks.
Combining optional background shading with precision separators also allows traders to switch between a macro view (highlighted days) and a minimal execution view (lines only) without loading multiple indicators.
How It Works (High-Level)
The script internally offsets the chart’s timestamp by the number of hours specified in the timezone setting. It then detects when a new calendar day begins from that adjusted time and renders the visual separator accordingly.
Because the calculation is based on shifted time rather than exchange time, the indicator maintains consistent day structure across brokers.
How To Use
Set the timezone shift to match the session you anchor your analysis to.
Example: New York is typically UTC-5 or UTC-4 during daylight saving time.
Enable background highlighting for a broader structural view.
Use vertical separators when a cleaner chart is preferred for execution.
Customize colors to match your chart template.
Who This Script Is For
FX traders
Session-based traders
ICT-style market structure traders
Traders using multiple brokers
Anyone who wants consistent day boundaries across charts
Notes
This script is designed as a chart-organization utility. It does not generate trade signals or provide market predictions.
Deep AILibrary "Deeptest"
Comprehensive quantitative backtesting library with 112+ metrics: Sharpe/Sortino ratios, drawdown analysis, Monte Carlo simulation, Walk-Forward Analysis, VaR/CVaR, benchmark comparison, and interactive table rendering for TradingView strategies
@version 1.0.1 (01.01.2026)
============================================================================
CHANGELOG
============================================================================
v1.0.1 (01.01.2026)
- Added textSize parameter to runDeeptest() for controlling table text size
- New values: size.auto, size.small, size.tiny, size.normal, size.large
- Applies to all tables: main, stress test, drawdowns, recoveries, trades
v1.0.0 (31.12.2025)
- Initial release
- 112+ backtesting metrics
- Monte Carlo simulation and Walk-Forward Analysis
- Interactive table rendering with tooltips
============================================================================
TABLE OF CONTENTS
============================================================================
SECTION 1: File Header & Metadata
SECTION 2: Constants & Configuration
SECTION 3: Type Definitions
SECTION 4: Core Calculation Functions - Array Utilities
SECTION 5: Core Calculation Functions - Return Extraction
SECTION 6: Core Calculation Functions - Sharpe & Sortino
SECTION 7: Core Calculation Functions - Performance Metrics
SECTION 8: Core Calculation Functions - Drawdown Analysis
SECTION 9: Core Calculation Functions - Recovery Analysis
SECTION 10: Core Calculation Functions - Trade Analysis
SECTION 11: Core Calculation Functions - Statistical Distribution
SECTION 12: Core Calculation Functions - Risk Metrics
SECTION 13: Core Calculation Functions - Benchmark Comparison
SECTION 14: Core Calculation Functions - Time-Based Metrics
SECTION 15: Core Calculation Functions - Rolling Statistics
SECTION 16: Core Calculation Functions - Strategy Integration
SECTION 17: Core Calculation Functions - Walk Forward Analysis
SECTION 18: Core Calculation Functions - Monte Carlo Simulation
SECTION 19: Core Calculation Functions - Out-of-Sample Analysis
SECTION 20: Formatting Utilities - Value Formatting
SECTION 21: Formatting Utilities - Duration Formatting
SECTION 22: Formatting Utilities - Frequency Formatting
SECTION 23: Formatting Utilities - Date Formatting
SECTION 24: Tooltip Builders - Main Table Metrics
SECTION 25: Tooltip Builders - Complementary Metrics
SECTION 26: Tooltip Builders - Stress Test Metrics
SECTION 27: Tooltip Builders - Period Analysis Cards
SECTION 28: Table Rendering - Structure Helpers
SECTION 29: Table Rendering - Main Deeptest Table
SECTION 30: Table Rendering - Cell Renderers - Complementary Row
SECTION 31: Table Rendering - Stress Test Table
SECTION 32: Table Rendering - Period Analysis Cards
SECTION 33: Main Entry Point
============================================================================
API REFERENCE
============================================================================
Main Export:
------------
runDeeptest() - Complete backtest analysis orchestrator
============================================================================
KEY FEATURES
============================================================================
- Comprehensive backtesting metrics (112+ functions)
- Rolling window analysis with statistical distributions
- Advanced risk metrics (Sharpe, Sortino, Calmar, Martin, VaR, CVaR)
- Drawdown and recovery analysis
- Monte Carlo simulation and Walk-Forward Analysis
- Trade analysis (top/worst trades, consecutive streaks)
- Benchmark comparison (Alpha, Beta, R², Buy & Hold)
- Interactive table rendering with tooltips
============================================================================
USAGE EXAMPLE
============================================================================
╔══════════════════════════════════════════════════════════════════════════════╗
║ PROGRESSIVE USAGE EXAMPLES ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Three examples demonstrating increasing complexity: ║
║ 1. MINIMAL - "Hello World" with basic MA crossover ║
║ 2. BALANCED - Production ready with risk management & filters ║
║ 3. PROFESSIONAL - Full-featured with trailing stops & session filters ║
╚══════════════════════════════════════════════════════════════════════════════╝
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 1: MINIMAL (The "Hello World") ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ The simplest possible integration - just 3 lines to get started: ║
║ 1. Import the library ║
║ 2. Write your strategy logic ║
║ 3. Call runDeeptest() ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
strategy("MA Crossover ", overlay=true)
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Import Deeptest (Direct import - no namespace prefix needed)
// ═══════════════════════════════════════════════════════════════════════════
import Fractalyst/Deeptest/1 as *
// ────────────────────────────────────────────────────────────────────────────
// Strategy Logic: Simple Moving Average Crossover
// ────────────────────────────────────────────────────────────────────────────
fastMA = ta.sma(close, 10) // Fast MA: 10 periods
slowMA = ta.sma(close, 30) // Slow MA: 30 periods
// Plot MAs for visualization
plot(fastMA, "Fast MA", color=color.blue)
plot(slowMA, "Slow MA", color=color.orange)
// Entry: Long when fast MA crosses above slow MA
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
// Exit: Close when fast MA crosses below slow MA
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Run backtest analysis (all parameters use smart defaults)
// ═══════════════════════════════════════════════════════════════════════════
DT.runDeeptest()
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 2: BALANCED (Production Ready) ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Adds essential production features: ║
║ • User-configurable inputs ║
║ • ADX trend filter to avoid choppy markets ║
║ • Stop loss / Take profit for risk management ║
║ • Custom backtest parameters ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
strategy("MA Crossover ", overlay=true)
import Fractalyst/Deeptest/1 as *
// ────────────────────────────────────────────────────────────────────────────
// INPUT PARAMETERS
// ────────────────────────────────────────────────────────────────────────────
fastLen = input.int(10, "Fast MA Period", minval=1)
slowLen = input.int(30, "Slow MA Period", minval=1)
riskPct = input.float(2.0, "Risk %", minval=0.1) / 100
slPct = input.float(5.0, "Stop Loss %", minval=0.1) / 100
tpPct = input.float(10.0, "Take Profit %", minval=0.1) / 100
adxThresh = input.int(20, "ADX Trend Threshold")
// ────────────────────────────────────────────────────────────────────────────
// INDICATORS
// ────────────────────────────────────────────────────────────────────────────
fastMA = ta.sma(close, fastLen)
slowMA = ta.sma(close, slowLen)
adx = ta.adx(14)
= ta.dmi(14, 14)
// ────────────────────────────────────────────────────────────────────────────
// FILTERS
// ────────────────────────────────────────────────────────────────────────────
trendConfirmed = adx > adxThresh and diPlus > diMinus
// ────────────────────────────────────────────────────────────────────────────
// STRATEGY LOGIC
// ────────────────────────────────────────────────────────────────────────────
// Entry: MA crossover + trend confirmation
if ta.crossover(fastMA, slowMA) and trendConfirmed
strategy.entry("Long", strategy.long)
// Exit: MA crossunder
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Risk management: Stop loss and take profit
if strategy.position_size > 0
strategy.exit("RM", "Long",
stop=strategy.position_avg_price * (1 - slPct),
limit=strategy.position_avg_price * (1 + tpPct))
// ═══════════════════════════════════════════════════════════════════════════
// ⮟ Run backtest with custom parameters
// ═══════════════════════════════════════════════════════════════════════════
DT.runDeeptest(
riskPerTrade = 1.0, // ← 1% risk per trade
targetMaxDDPct = 15.0, // ← 15% max drawdown target
showStressTest = true, // ← Enable stress test table
showPeriodCards = true, // ← Enable period cards
wfaWindows = 12, // ← Walk-forward windows
mcSimulations = 1000, // ← Monte Carlo runs
bullColor = color.new(#00b9ff, 0),
bearColor = color.new(#ff0051, 0),
benchmarkSymbol = "SPX", // ← Compare to S&P; 500
periodCardMode = "drawdowns", // ← Show drawdown periods
tradeSortBy = "return" // ← Sort by return %
)
╔══════════════════════════════════════════════════════════════════════════════╗
║ EXAMPLE 3: PROFESSIONAL (Full-Featured) ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Complete professional implementation: ║
║ • Organized input groups for better UX ║
║ • Multiple filters: ADX trend, ATR volatility, Session timing ║
║ • Trailing stop to lock in profits ║
║ • Position highlighting for visual feedback ║
║ • Full parameter customization with inline documentation ║
╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
runDeeptest(targetMaxDDPct, bullColor, bearColor, tableBg, headerBg, borderColor, textPrimary, textMuted, textSize, showComplementaryRow, showStressTestTable, showDrawdownRecoveryCards, showTradeCards)
Parameters:
targetMaxDDPct (float)
bullColor (color)
bearColor (color)
tableBg (color)
headerBg (color)
borderColor (color)
textPrimary (color)
textMuted (color)
textSize (string)
showComplementaryRow (bool)
showStressTestTable (bool)
showDrawdownRecoveryCards (bool)
showTradeCards (bool)
ThresholdConfig
ThresholdConfig - Configuration for metric thresholds and corresponding colors
Fields:
sharpeExc (series float)
sharpeGood (series float)
sharpeOk (series float)
sharpeBear (series color)
sharpeNeutral (series color)
sharpeOrange (series color)
sharpeBull (series color)
ddSevere (series float)
ddMod (series float)
ddMild (series float)
ddSevereColor (series color)
ddModColor (series color)
ddOrange (series color)
ddGoodColor (series color)
rorHigh (series float)
rorMod (series float)
rorLow (series float)
rorHighColor (series color)
rorModColor (series color)
rorOrange (series color)
rorLowColor (series color)
r2Poor (series float)
r2Mod (series float)
r2Good (series float)
r2PoorColor (series color)
r2ModColor (series color)
r2Orange (series color)
r2GoodColor (series color)
kurtHigh (series float)
kurtMod (series float)
kurtOk (series float)
kurtHighColor (series color)
kurtModColor (series color)
kurtOrange (series color)
kurtGoodColor (series color)
skewVNeg (series float)
skewModNeg (series float)
skewPos (series float)
skewVPos (series float)
skewVNegColor (series color)
skewModNegColor (series color)
skewNeutral (series color)
skewPosColor (series color)
payoffPoor (series float)
payoffBE (series float)
payoffGood (series float)
payoffPoorColor (series color)
payoffBEColor (series color)
payoffOrange (series color)
payoffGoodColor (series color)
pfPoor (series float)
pfBE (series float)
pfGood (series float)
pfPoorColor (series color)
pfBEColor (series color)
pfOrange (series color)
pfGoodColor (series color)
ulcerHigh (series float)
ulcerLow (series float)
ulcerHighColor (series color)
ulcerModColor (series color)
ulcerOrange (series color)
ulcerLowColor (series color)
wrLow (series float)
wrOk (series float)
wrHigh (series float)
wrLowColor (series color)
wrOkColor (series color)
wrOrange (series color)
wrHighColor (series color)
cagrPoor (series float)
cagrOk (series float)
cagrGood (series float)
cagrPoorColor (series color)
cagrOkColor (series color)
cagrOrange (series color)
cagrGoodColor (series color)
pInsig (series float)
pMod (series float)
pSig (series float)
pInsigColor (series color)
pModColor (series color)
pOrange (series color)
pSigColor (series color)
calmarPoor (series float)
calmarBE (series float)
calmarGood (series float)
calmarPoorColor (series color)
calmarBEColor (series color)
calmarOrange (series color)
calmarGoodColor (series color)
betaHigh (series float)
betaLow (series float)
betaHighColor (series color)
betaLowColor (series color)
betaGoodColor (series color)
Stats
Stats - Comprehensive backtest statistics container
Fields:
totalTrades (series int)
winTrades (series int)
lossTrades (series int)
evenTrades (series int)
winRate (series float)
lossRate (series float)
avgWinPct (series float)
avgLossPct (series float)
avgTradePct (series float)
profitFactor (series float)
payoffRatio (series float)
expectancy (series float)
grossProfit (series float)
grossLoss (series float)
netProfit (series float)
netProfitPct (series float)
compEffect (series float)
sharpe (series float)
sortino (series float)
calmar (series float)
martin (series float)
maxDrawdown (series float)
maxDrawdownPct (series float)
currentDrawdown (series float)
currentDrawdownPct (series float)
avgDrawdownPct (series float)
maxEquity (series float)
minEquity (series float)
cagr (series float)
monthlyReturn (series float)
maxConsecWins (series int)
maxConsecLosses (series int)
avgTradeDuration (series float)
avgWinDuration (series float)
avgLossDuration (series float)
timeInMarketPct (series float)
tradesPerMonth (series float)
tradesPerYear (series float)
skewness (series float)
kurtosis (series float)
var95 (series float)
cvar95 (series float)
ulcerIndex (series float)
riskOfRuin (series float)
pValue (series float)
zScore (series float)
alpha (series float)
beta (series float)
buyHoldReturn (series float)
equityRSquared (series float)
firstTradeTime (series int)
lastTradeTime (series int)
tradingPeriodDays (series float)
RollingWindowSummary
RollingWindowSummary - Summary of metrics for a single rolling analysis window
Fields:
windowIndex (series int)
startTrade (series int)
endTrade (series int)
effectiveCount (series int)
minValue (series float)
maxValue (series float)
metricValue (series float)
RollingStats
RollingStats - Statistical distribution of rolling window metrics
Fields:
windowSize (series int) : Number of trades in rolling window
expectancyMin (series float) : Minimum rolling expectancy
expectancyMax (series float) : Maximum rolling expectancy
sharpeMin (series float) : Minimum rolling Sharpe
sharpeMax (series float) : Maximum rolling Sharpe
sortinoMin (series float) : Minimum rolling Sortino
sortinoMax (series float) : Maximum rolling Sortino
expectancyWindows (array) : Per-window summaries for expectancy
sharpeWindows (array) : Per-window summaries for Sharpe
sortinoWindows (array) : Per-window summaries for Sortino
expectancyMean (series float) : Mean expectancy across rolling windows
expectancyStdDev (series float) : Standard deviation of expectancy
expectancyPct90 (series float) : 90th percentile expectancy
expectancyPct50 (series float) : 50th percentile expectancy (median)
expectancyPct10 (series float) : 10th percentile expectancy
sharpeMean (series float) : Mean Sharpe across rolling windows
sharpeStdDev (series float) : Standard deviation of Sharpe
sharpePct90 (series float) : 90th percentile Sharpe
sharpePct50 (series float) : 50th percentile Sharpe
sharpePct10 (series float) : 10th percentile Sharpe
sortinoMean (series float) : Mean Sortino across rolling windows
sortinoStdDev (series float) : Standard deviation of Sortino
sortinoPct90 (series float) : 90th percentile Sortino
sortinoPct50 (series float) : 50th percentile Sortino
sortinoPct10 (series float) : 10th percentile Sortino
Liquidity Grab ScannerMarks last week and last 3 days highs and lows.
Can be used for liquidity grabs above or below those levels, I use for it.
Claude AI coded it.
Weekly Tightness Near EMA//@version=6
indicator("Weekly Tightness Near EMA", overlay=true)
// ===========================
// INPUT PARAMETERS
// ===========================
tightness_pct = input.float(3.0, "Tightness % Range", minval=0.1, maxval=10.0)
ema_proximity_pct = input.float(5.0, "EMA Proximity %", minval=0.5, maxval=15.0)
small_candle_pct = input.float(5.0, "Small Candle % (body)", minval=0.5, maxval=10.0)
show_ema10 = input.bool(true, "Show 10 Week EMA")
show_ema20 = input.bool(true, "Show 20 Week EMA")
show_signals = input.bool(true, "Show Tightness Signals")
// ===========================
// GET WEEKLY DATA
// ===========================
weekly_close = request.security(syminfo.tickerid, "W", close, barmerge.gaps_off, barmerge.lookahead_off)
weekly_open = request.security(syminfo.tickerid, "W", open, barmerge.gaps_off, barmerge.lookahead_off)
weekly_high = request.security(syminfo.tickerid, "W", high, barmerge.gaps_off, barmerge.lookahead_off)
weekly_low = request.security(syminfo.tickerid, "W", low, barmerge.gaps_off, barmerge.lookahead_off)
weekly_close_1 = request.security(syminfo.tickerid, "W", close , barmerge.gaps_off, barmerge.lookahead_off)
weekly_open_1 = request.security(syminfo.tickerid, "W", open , barmerge.gaps_off, barmerge.lookahead_off)
weekly_high_1 = request.security(syminfo.tickerid, "W", high , barmerge.gaps_off, barmerge.lookahead_off)
weekly_low_1 = request.security(syminfo.tickerid, "W", low , barmerge.gaps_off, barmerge.lookahead_off)
weekly_close_2 = request.security(syminfo.tickerid, "W", close , barmerge.gaps_off, barmerge.lookahead_off)
weekly_open_2 = request.security(syminfo.tickerid, "W", open , barmerge.gaps_off, barmerge.lookahead_off)
weekly_high_2 = request.security(syminfo.tickerid, "W", high , barmerge.gaps_off, barmerge.lookahead_off)
weekly_low_2 = request.security(syminfo.tickerid, "W", low , barmerge.gaps_off, barmerge.lookahead_off)
// Weekly EMAs
weekly_ema10 = request.security(syminfo.tickerid, "W", ta.ema(close, 10), barmerge.gaps_off, barmerge.lookahead_off)
weekly_ema20 = request.security(syminfo.tickerid, "W", ta.ema(close, 20), barmerge.gaps_off, barmerge.lookahead_off)
// ===========================
// CALCULATE CANDLE SIZE
// ===========================
// Calculate body size (close - open) as percentage of price
candle_body_0 = math.abs(weekly_close - weekly_open)
candle_body_1 = math.abs(weekly_close_1 - weekly_open_1)
candle_body_2 = math.abs(weekly_close_2 - weekly_open_2)
candle_body_pct_0 = (candle_body_0 / weekly_close) * 100
candle_body_pct_1 = (candle_body_1 / weekly_close_1) * 100
candle_body_pct_2 = (candle_body_2 / weekly_close_2) * 100
// Calculate full range (high - low) as percentage
candle_range_0 = weekly_high - weekly_low
candle_range_1 = weekly_high_1 - weekly_low_1
candle_range_2 = weekly_high_2 - weekly_low_2
candle_range_pct_0 = (candle_range_0 / weekly_close) * 100
candle_range_pct_1 = (candle_range_1 / weekly_close_1) * 100
candle_range_pct_2 = (candle_range_2 / weekly_close_2) * 100
// Check if all 3 candles are small
small_candle_0 = candle_body_pct_0 <= small_candle_pct
small_candle_1 = candle_body_pct_1 <= small_candle_pct
small_candle_2 = candle_body_pct_2 <= small_candle_pct
all_candles_small = small_candle_0 and small_candle_1 and small_candle_2
// Average candle body size
avg_candle_body = (candle_body_pct_0 + candle_body_pct_1 + candle_body_pct_2) / 3
avg_candle_range = (candle_range_pct_0 + candle_range_pct_1 + candle_range_pct_2) / 3
// ===========================
// CALCULATE TIGHTNESS
// ===========================
// Find highest and lowest of last 3 weekly closes
highest_close = math.max(weekly_close, weekly_close_1, weekly_close_2)
lowest_close = math.min(weekly_close, weekly_close_1, weekly_close_2)
// Calculate range percentage
close_range_pct = ((highest_close - lowest_close) / lowest_close) * 100
// Check if within tightness range
is_tight = close_range_pct <= tightness_pct
// ===========================
// CHECK PROXIMITY TO EMAs
// ===========================
// Distance from EMAs
dist_from_ema10_pct = math.abs((weekly_close - weekly_ema10) / weekly_ema10) * 100
dist_from_ema20_pct = math.abs((weekly_close - weekly_ema20) / weekly_ema20) * 100
// Near EMA conditions
near_ema10 = dist_from_ema10_pct <= ema_proximity_pct
near_ema20 = dist_from_ema20_pct <= ema_proximity_pct
near_any_ema = near_ema10 or near_ema20
// ===========================
// COMBINED SIGNAL (with small candles filter)
// ===========================
tightness_signal = is_tight and near_any_ema and all_candles_small
// ===========================
// PLOT EMAs
// ===========================
plot(show_ema10 ? weekly_ema10 : na, "10 Week EMA", color=color.new(color.blue, 0), linewidth=2)
plot(show_ema20 ? weekly_ema20 : na, "20 Week EMA", color=color.new(color.orange, 0), linewidth=2)
// ===========================
// PLOT SIGNALS
// ===========================
// Background color when tight and near EMA
bgcolor(show_signals and tightness_signal ? color.new(color.green, 90) : na, title="Tightness Signal")
// Plot signal markers
plotshape(show_signals and tightness_signal and not tightness_signal ,
title="Tightness Start",
location=location.belowbar,
color=color.new(color.green, 0),
style=shape.triangleup,
size=size.small,
text="TIGHT")
// ===========================
// DISPLAY TABLE
// ===========================
var table info_table = table.new(position.top_right, 2, 9,
border_width=1,
border_color=color.gray,
frame_width=1,
frame_color=color.gray)
if barstate.islast
// Header
table.cell(info_table, 0, 0, "Weekly Analysis", bgcolor=color.new(color.gray, 70), text_color=color.white, text_size=size.normal)
table.cell(info_table, 1, 0, "Status", bgcolor=color.new(color.gray, 70), text_color=color.white, text_size=size.normal)
// Average candle body size
candle_color = all_candles_small ? color.new(color.green, 85) : color.new(color.red, 85)
table.cell(info_table, 0, 1, "Avg Candle Body", bgcolor=candle_color, text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 1, str.tostring(avg_candle_body, "#.##") + "%", bgcolor=candle_color, text_color=color.white)
// Small candle threshold
table.cell(info_table, 0, 2, "Small Candle <", bgcolor=color.new(color.gray, 90), text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 2, str.tostring(small_candle_pct, "#.#") + "%", bgcolor=color.new(color.gray, 90), text_color=color.white)
// 3 Week Close Tightness
tight_color = is_tight ? color.new(color.green, 85) : color.new(color.red, 85)
table.cell(info_table, 0, 3, "3W Close Range", bgcolor=tight_color, text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 3, str.tostring(close_range_pct, "#.##") + "%", bgcolor=tight_color, text_color=color.white)
// Tightness threshold
table.cell(info_table, 0, 4, "Threshold", bgcolor=color.new(color.gray, 90), text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 4, "<" + str.tostring(tightness_pct, "#.#") + "%", bgcolor=color.new(color.gray, 90), text_color=color.white)
// Distance from 10W EMA
ema10_color = near_ema10 ? color.new(color.blue, 85) : color.new(color.gray, 85)
table.cell(info_table, 0, 5, "From 10W EMA", bgcolor=ema10_color, text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 5, str.tostring(dist_from_ema10_pct, "#.##") + "%", bgcolor=ema10_color, text_color=color.white)
// Distance from 20W EMA
ema20_color = near_ema20 ? color.new(color.orange, 85) : color.new(color.gray, 85)
table.cell(info_table, 0, 6, "From 20W EMA", bgcolor=ema20_color, text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 6, str.tostring(dist_from_ema20_pct, "#.##") + "%", bgcolor=ema20_color, text_color=color.white)
// Near EMA status
near_ema_color = near_any_ema ? color.new(color.green, 85) : color.new(color.red, 85)
near_ema_text = near_any_ema ? "✓ NEAR" : "✗ Far"
table.cell(info_table, 0, 7, "Near EMA", bgcolor=near_ema_color, text_color=color.white, text_halign=text.align_left)
table.cell(info_table, 1, 7, near_ema_text, bgcolor=near_ema_color, text_color=color.white)
// Combined signal
signal_color = tightness_signal ? color.new(color.lime, 70) : color.new(color.gray, 85)
signal_text = tightness_signal ? "🎯 SETUP!" : "No Setup"
table.cell(info_table, 0, 8, "SIGNAL", bgcolor=signal_color, text_color=color.white, text_halign=text.align_left, text_size=size.large)
table.cell(info_table, 1, 8, signal_text, bgcolor=signal_color, text_color=color.white, text_size=size.large)
// ===========================
// ALERTS
// ===========================
alertcondition(tightness_signal and not tightness_signal ,
title="Tightness Setup Alert",
message="Weekly setup detected: Small candles, tight closes, near EMA!")
S21 SETUP (EMA9/21 + RSI 14)This script is only intended for a specific set up or strategy develop by our trading group. Lightning Strategy Group T3 Sniper has its specific strategy that requires this indicator script.
B-Xtrender MTFA @XL-DurexOriginally Created by @puppytherapy and found at this link: B-Xtrender by Quant Therapy
This version removes everything apart from the histograms and adds multi time frame analysis.
Defaults are 1D, 1W, 1M.
Chart Info & Candle CountdownThis indicator displays essential chart information directly on the chart:
Displays the current date
Displays the current symbol
Displays the current timeframe with a countdown to candle close
The candle close countdown is visually highlighted to improve time awareness:
from 2 minutes before candle close on minute timeframes
from 15 minutes before candle close on higher timeframes
This indicator is designed for informational purposes only and does not generate trading signals.
S21 SETUP! by TophengzkyThis script is intended only for a specific strategy or set up! Only to be use by Lightning Strategy Group T3 Snipers!
It was developed for us to make our trading strategy handy and easily to navigate and execute our set ups!
Dual Range Volume Profile█ OVERVIEW
“Dual Range Volume Profile” is a volume analysis indicator that displays two independent volume profiles simultaneously:
- Main Profile – a profile built from the entire visible chart range
- Pivot Profile – a profile calculated from the most recent significant pivot (swing high / swing low)
This allows the trader to see at the same time:
- where the market accumulated volume in the broader structural context,
- and where price equilibrium is forming within the current move.
The indicator draws a volume-by-price histogram, POC, Value Area (VA), and an information table with key levels. It combines macro and micro context in one tool.
█ CONCEPTS
Volume Profile shows at which price levels the highest trading activity occurred — in other words, where the market actually built positions.
Main Profile
This profile is calculated from the entire visible chart range. It provides a broad context:
- historical market balance
- areas of position building
- levels that often act as price magnets
It represents the structural balance of the market.
Pivot Profile
This profile begins at the most recent confirmed pivot (swing high / swing low). It shows the volume distribution inside the current impulse and helps evaluate:
- where new positions are being built
- whether the move is supported by volume
- where a new balance is forming
It represents the context of the current move.
POC – Point of Control
The price level with the highest volume. It often acts as:
- the center of balance
- a price magnet
- a reaction level during retests
Value Area (VA)
The price range where a defined percentage of total volume occurred. VA represents the area of balance between buyers and sellers.
█ FEATURES
- Two volume profiles working simultaneously (global + pivot-based)
- Separate POC for each profile
- Value Area displayed as a box and VA High / VA Low lines
- Configurable VA percentage
- Automatic pivot detection with “Last PH/PL” label
- Volume gradient from low to high
- Full visual customization and an info table with levels
█ HOW TO USE
The Main Profile helps determine where price stands relative to the broader market balance — whether it trades above, inside, or below value.
The Pivot Profile shows how volume is distributed within the current move and whether the impulse is truly supported by market activity. Retests of the pivot POC often behave as local support or resistance.
█ APPLICATIONS
In practice, the indicator is best used for working with price reaction zones and evaluating move quality.
POC and Value Area boundaries often behave like dynamic support and resistance because they represent price levels where the market spent the most activity and participation. After a strong impulse, price frequently returns to the pivot POC or VA boundaries, where the market decides between continuation or a return to balance.
Value Area can also serve a different role — as a compression zone before a move. When price consolidates inside VA for an extended period, the market is in balance. A breakout beyond VA signals a shift from balance to imbalance (volatility expansion). If the breakout is followed by a retest of the VA boundary from the outside, accompanied by increased volume, this often creates an opportunity to enter in the breakout direction.
Particularly strong zones appear when multiple contexts align: Main POC is close to Pivot POC, both Value Areas overlap, and the level coincides with market structure (swings, OB, FVG, higher timeframe levels, etc.). This combination of structure and two layers of volume creates areas with increased probability of price reaction.
The indicator also helps assess move quality — if price moves aggressively but the Pivot Profile does not build meaningful volume, the move may be weak and prone to pullbacks.
█ NOTES
When the chart is heavily zoomed in, both profiles may appear very similar. This can lead to the false conclusion that a zone is exceptionally strong, while it is only the effect of a narrowed data range. Profiles should always be interpreted from a broader perspective, aligned with your trading horizon.
The indicator is not suitable for markets where volume does not reflect real traded activity (e.g., tick volume, synthetic volume, or aggregated data without true liquidity). The quality of volume data directly affects the quality of the levels.
There are also markets where no real volume data exists at all. In such environments, the indicator cannot function properly, as its calculations depend entirely on meaningful volume information.
Trading Sessions Highs & LowsFull Azia , London and New York Sessions Highs & Lows are shown until triggered.
Supertrend with VWAP FilterThe Logic Breakdown
VWAP Integration: Added a standard VWAP calculation.
Filtering: The Supertrend "Buy" signal only triggers if close > vwap.
Dynamic Coloring: If the Supertrend says "up" but price is below VWAP, the line turns gray.
Candle Highlights: I added logic for Bullish/Bearish Engulfing and Dojis. These will highlight the bar color specifically when they align with your VWAP-filtered trend.
SMA 20 & 5 MagicMoving Average based envelops and bands are quite popular tools in the equity trading universe. One such popular band is 20 SMA High-Low band. In 20 SMA High-Low band generally a BUY is signaled when price breaks above the High of the band, and a SELL when price falls below the Low of the band. However, at times the time-price points to look for trading/ investing opportunities and taking position are not very clear in this generic mode.
This script combines the 20 SMA High-Low band and a 5 SMA line plotted over it, to tackle this limitation. It helps to find more precise trading/ investing opportunities, Entry and Exit time-price points above & below the band, traversing along the 5 SMA line. The price within the band is usually considered as 'no trades' zone.
This set up can be applied on any TF, but generally holds good for swings on daily/ hourly TFs. By tweaking SMA 20 and 5 to SMA 200 and 50 respectively in the settings, it may also help in identifying medium/Long term trends and investment opportunities using daily/ weekly TFs .
Take it as a tool for learning and analysis. Happy trading/ investing.
Daily ATR & Market Cap DisplayDaily ATR & Market Cap Display:
Displays daily ATR percentage with color-coded volatility alerts (🟢 0-4%, 🟡 4-8%, 🔴 8%+) and market cap with size indicators (🔴 <1B, 🟡 1-5B, 🟢 5B+).
Features:
- Daily ATR remains constant across all timeframes
- Customizable position (9 locations + vertical offset)
- Adjustable text size and colors
- Clean, fixed on-screen display
Near 52W High (Within 20%) - ScreenerThis Pine Script indicator is designed specifically for TradingView’s Pine Screener. It identifies stocks whose current closing price is trading within 20% of their 52-week high, helping traders quickly find strong stocks that are consolidating near their long-term highs.
Near 52W High (Within 20%) - ScreenerThis Pine Script indicator is designed specifically for TradingView’s Pine Screener. It identifies stocks whose current closing price is trading within 20% of their 52-week high, helping traders quickly find strong stocks that are consolidating near their long-term highs.






















