MACD (Standard) + ATR BoxJust a MACD with a ATR values box so no need for wasting a standalone indicator just for the ATR value. You can also calculate the ATR stop loss calculation.
Wskaźniki i strategie
System Core B Monthly Value + Weekly RegimeWhat this indicator does
This indicator builds a weekly “regime engine” around a manual monthly value area and then summarizes everything in a small on-chart dashboard.
It answers four questions:
Are we inside monthly value, near an edge, or trading outside it?
Is the weekly action rotating, compressing, or escaping away from value?
How has price moved inside the weekly range vs two weeks ago (up / down / flat)?
Are weekly range and volume “normal”, tight, or quiet relative to recent history?
You provide the monthly VAH / VAL once, and the script monitors how weekly bars behave around that zone.
Core logic
Monthly value area
You manually enter Monthly VAH (upper) and Monthly VAL (lower).
The script checks whether each weekly close is:
Outside above VAH
Outside below VAL
Inside but near VAH
Inside but near VAL
Inside and away from edges
A small “Location” label reports this as:
Outside Above VAH
Outside Below VAL
Inside (Near VAH)
Inside (Near VAL)
Inside Value
The “near” zone width is controlled by a percent buffer of the monthly value width.
Weekly range and volume stats
On the weekly timeframe the script calculates:
RangeRatio (RR) = weekly high–low divided by weekly ATR(14)
VolumeRatio (VR) = weekly volume divided by a volume SMA (configurable length)
It then counts over a recent window:
How many of the last 6 weeks had “normal” RR (between 0.6 and 1.1 × ATR).
How many of the last 4 weeks had tight RR (RR < 0.8).
How many of the last 4 weeks had quiet volume (VR ≤ 1.0).
How many of the last 6 weekly closes were inside monthly value.
These counts drive the regime classification and are also shown in the dashboard.
Regime classification
The regime engine is designed around three states:
Rotating (A – Rotating)
All 6 of the last 6 weekly closes are inside monthly value.
At least 4 of those 6 weeks have normal RR.
→ Typical “range / rotation around value” environment.
Compressing (A – Compressing)
Last 4 weekly closes all inside monthly value.
At least 3 of the last 4 weeks have tight RR.
At least 3 of the last 4 weeks have quiet volume.
→ Volatility contraction and quieter trade inside value.
Escaping (B – Escaping)
At most 3 of the last 6 weekly closes are still inside value.
Last 3 weekly closes are clustered in the top or bottom quartile of their ranges.
At least 1 recent week shows high RR (“impulse” move).
Current weekly close is progressing further in that direction vs two weeks ago.
→ Expansion / trend away from value.
Priority is: Escaping > Compressing > Rotating.
If monthly VAH/VAL are missing, regime is set to MISSING monthly VAH/VAL.
If none of the patterns fit cleanly, regime is labeled MIXED.
A separate “Progress vs 2w ago” tag reports:
Up vs 2w ago
Down vs 2w ago
Flat vs 2w ago
based on the position of the current weekly close within its range compared to two weeks prior.
Visuals
Lines
Optional Monthly VAH and Monthly VAL horizontal lines.
Background shading (optional)
If Shade background by regime is enabled and monthly values are present:
Compressing → blue tint
Escaping → orange tint
Rotating → green tint
Other / mixed → light gray tint
If the shading option is off or monthly VAH/VAL are missing, the background is not modified.
Dashboard table
A compact table (corner is configurable) shows:
Row 0: Weekly Regime – regime label (B Escaping / A Compressing / A Rotating / MIXED / missing)
Row 1: Location – monthly value location text (inside / near edge / outside)
Row 2: Progress – up / down / flat vs two weeks ago
Row 3: Inside (6w) – count of weeks inside value out of last 6
Row 4: RR Normal (6w) – count of “normal RR” weeks in last 6
Row 5: Tight/Quiet (4w) – string summary:
RR tight: X | Vol quiet: Y (counts over last 4 weeks)
Inputs
Monthly VAH / VAL (manual)
Monthly VAH (upper value)
Monthly VAL (lower value)
Show Monthly VAH / VAL (on/off)
Monthly buffer
Near-edge buffer (% of value width) – defines how close to VAH/VAL counts as “near”.
Weekly Regime Engine
Top percentile threshold (0..1) – default 0.75 (top quartile of weekly range)
Bottom percentile threshold (0..1) – default 0.25
Weekly volume SMA length – lookback for VR normalization
Shade background by regime – enable/disable colored background
Dashboard
Show dashboard – show/hide the table
Dashboard corner – Top Left / Top Right / Bottom Left / Bottom Right
How to use it
Set Monthly VAH / VAL for the current contract / product.
Watch the regime label + background color to know if weekly structure is:
Ranging around value
Compressing quietly inside value
Attempting to escape and trend away
Use Location and Inside Count to judge how anchored price still is to the monthly value area.
Use the RR / volume counts and Progress vs 2w ago to decide whether to treat current moves as range trades, breakout attempts, or fading candidates.
This is built to be a weekly “state of the environment” layer you can combine with your more granular entry tools.
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.
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
FVG Detector - With Close Direction & Breakoutdetects fvg. sharp rejection and sweep. developed to help traders achieve success with close direction and breakout
Markets [SolQuant]The Markets indicator displays global trading session times with visual range boxes and highlights market maker activity zones. It maps the three major sessions — New York, London, and Asia — along with specialized zones that have been observed to correlate with specific market behaviors.
█ USAGE
Session Boxes
Colored boxes are drawn for each active trading session, spanning from the session open to the session close. The box height covers the price range traded during that session. Each session uses a distinct color for quick identification:
• New York: The primary session for US equities and crypto volume.
• London: Overlaps with New York for peak liquidity in forex and global markets.
• Asia: Tokyo/Hong Kong session, often setting the tone for the following London session.
Session boxes provide immediate visual context about which global market was active during any given price action.
Market Maker Zones
Two specialized time windows are highlighted:
• Reversal Session: A time window commonly associated with market reversals and directional shifts.
• Gap Session: A time window where gaps and displacement moves frequently occur.
These zones are derived from observed patterns in market maker behavior and are intended as awareness tools rather than predictive signals.
█ DETAILS
Sessions are defined by fixed time ranges in their respective timezones. The indicator uses daylight saving time-aware timezone strings to ensure accuracy year-round. Each session's price range (high/low) is tracked dynamically and the box height updates in real time as the session progresses.
Market maker zones use the same box-drawing mechanism but target narrower time windows. All boxes are automatically removed after a configurable maximum count to prevent chart clutter.
█ SETTINGS
• Show NY / London / Asia: Toggle each session's display.
• Show Reversal Session / Gap Session: Toggle market maker zones.
• Session Colors: Customizable colors for each session and zone.
• Max Boxes: Controls how many historical session boxes are kept on chart.
This indicator displays fixed time-based session zones and does not predict price direction. Market maker zones are based on observed patterns that may not persist. It does not constitute financial advice.
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
Banknifty By PaisaPaniThis indicator displays a DEMO performance snapshot
to show how the PaisaPani approach behaves on BankNifty.
It is a trading system.
• Separate indicator designed specifically for BankNifty
• Intended for the mentioned timeframe only
• Focused on execution clarity, not predictions
🔒 Full access is limited.
⚠ Disclaimer:
For educational and demonstration purposes only.
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.
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.
ddddddrrrrrr//@version=5
indicator("🚀 EventSniper HF v3.0 - 高频方向信号", overlay=true)
// 参数
emaFast = input.int(5, "快速EMA")
emaSlow = input.int(20, "慢速EMA")
rsiLen = input.int(7, "RSI周期")
volRatio = input.float(1.8, "量能放大倍数")
// 指标计算
ema1 = ta.ema(close, emaFast)
ema2 = ta.ema(close, emaSlow)
rsi = ta.rsi(close, rsiLen)
volAvg = ta.sma(volume, 20)
volSpike = volume > volAvg * volRatio
// 高频方向信号(核心逻辑)
longCond = ema1 > ema2 and rsi > 50 and volSpike
shortCond = ema1 < ema2 and rsi < 50 and volSpike
// 信号绘图
plotshape(longCond, title="建议做多", location=location.belowbar, color=color.lime, style=shape.labelup, text="多")
plotshape(shortCond, title="建议做空", location=location.abovebar, color=color.red, style=shape.labeldown, text="空")
// 文本提示
label.new(longCond ? bar_index : na, low,
"📈 建议多头方向", style=label.style_label_up,
color=color.green, textcolor=color.white)
label.new(shortCond ? bar_index : na, high,
"📉 建议空头方向", style=label.style_label_down,
color=color.red, textcolor=color.white)
// 报警条件(用于接入Telegram)
alertcondition(longCond, title="📈 多方向警报", message="🚀 多方向信号触发:{{ticker}}")
alertcondition(shortCond, title="📉 空方向警报", message="🚨 空方向信号触发:{{ticker}}")
TEST Grok 4 AlertesCreate your 4 alerts with these short names: Buy → webhook opening long Sell → webhook opening short Close Long → webhook closing long Close Short → webhook closing short
Crée tes 4 alertes avec ces noms courts :
Buy → webhook ouverture long
Sell → webhook ouverture short
Close Long → webhook fermeture long
Close Short → webhook fermeture short
200 SMA from 1H timeframe &LabelPlots the 200-period Simple Moving Average (SMA) calculated strictly on the 1-hour timeframe, visible and accurate on any chart timeframe (1m, 5m, 15m, 4H, daily, etc.).
• The line appears “stepped” on lower timeframes (normal/expected for higher-TF data).
• Includes a clean, updating label on the right edge showing the current 1H 200 SMA value.
• Optional faint background tint highlights new 1H bars for easy visual reference.
Ideal for: Multi-timeframe analysis, trend filtering, support/resistance on intraday charts, or confirming the broader hourly trend while trading lower timeframes.






















