AltcoinEvreni Entry/TP RR ToolMulti-Entry / Take-Profit Risk-Reward Tool
This indicator is designed to help traders visually plan and manage their trade entries, take-profit targets, stop-loss levels, and risk/reward calculations directly on the chart.
Key Features:
--- Up to 3 customizable entry levels with separate position sizing for each.
--- Up to 5 take-profit (TP) levels, each with individual allocation percentages.
--- Automatic calculation of weighted average entry price.
--- Dynamic risk and potential profit calculation based on your inputs.
--- Visual colored zones for entry, stop-loss, and take-profit areas on the chart.
--- Adjustable leverage and margin for position sizing.
--- Informative floating table displaying position type, entries, stop-loss, risk in $, potential
--- profit in $, and overall RR ratio.
--- Fully customizable appearance (colors, box width, table font size, etc.).
How to Use:
1- Set your trade direction (Long or Short).
2- Enter your planned entry prices, allocation percentages, and stop-loss.
3- Configure your take-profit levels and their respective allocation percentages.
4- Adjust margin, leverage, and visual preferences as desired.
5- The tool will display all relevant zones and statistics, helping you make better risk-managed trading decisions.
Notes:
--- All calculations and drawings update dynamically as you change your parameters.
--- Works on any symbol and timeframe.
--- For educational and planning purposes – always use your own judgment and risk management.
Indicators and strategies
RSI Extreme ATR Projection v6 (Historical)Helps give future predictions of where the extremes in the RSI will be. Perfect for scale trading
Opening Range BreakoutThis script is designed to visually mark the "Opening Range" on your SPX TradingView chart — specifically from 9:30 AM to 9:45 AM ET, which is the first 15 minutes of the U.S. trading session.
It helps traders identify key breakout levels early in the day.
Find Last 30-Min Nifty Closing Price (VWAP-Based)📌 Purpose:
This indicator helps traders find the accurate last 30-minute closing price for Nifty (or any NSE instrument) by calculating the Volume-Weighted Average Price (VWAP) from 3:00 PM to 3:30 PM IST — mimicking the official NSE close logic.
Unlike the simple closing price (last traded tick at 3:30 PM), the official Nifty close is calculated as the weighted average of all trades in the final 30 minutes. This tool replicates that method for traders and analysts using TradingView.
⚙️ How It Works:
Activates from 3:00 PM to 3:30 PM IST each trading day.
Accumulates price × volume and total volume in that window.
Computes and plots the VWAP (Σ(P×V) / ΣV).
VWAP is updated live between 3:00–3:30 PM, and then locked at 3:30 PM.
A red line displays the final VWAP as your closing price reference.
✅ Why You Should Use It:
Get a more accurate closing reference than the 3:30 PM tick.
Critical for options expiry decisions, backtesting, and daily trade reviews.
Ideal for Nifty, BankNifty, FinNifty, and other NSE indices or stocks.
Especially useful for intraday traders, option buyers/sellers, and analysts.
📊 How to Use:
Works best on 5-minute charts or lower for precise readings.
Add the script and monitor after 3:00 PM — final value will display after 3:30 PM.
Supports all NSE instruments with sufficient intraday volume.
🛠️ Built using Pine Script v5
Timezone: Asia/Kolkata (Indian Standard Time)
Trendumkehr-Indikator: RSI / Stoch RSI + Alarme🔔 Alarm Trigger (Trigger)
Type Condition When Useful RSI Long RSI crosses above 30 End of Oversold
RSI Short RSI crosses below 70 End of Overbought Stoch Long %K crosses %D and %K < 20 Dynamic Long Signal Stoch Short %K crosses %D and %K > 80 Dynamic Short Signal
✅ Usage Insert Indicator in TradingView Right-click on Chart or in the Alarm menu '🔔' Select one of the conditions ('RSI Long Signal', etc.) Set the type and tone of the alarm
RSI Zone Highlight + Entry NotesRed bars when RSI ≤ 30, green when RSI ≥ 70; drops “RSI≤30”/“RSI≥70” labels on the entry bar.
Pine v6 • tweak RSI length & thresholds in settings.
Real Time Swing Trap DetectorThe Real Time Swing Trap Detector is a minimalist, pro-grade tool for instantly spotting classic “bull traps” and “bear traps” on any chart.
This indicator identifies swing traps in real time by tracking significant swing highs and lows, then watching for fast, false breakouts (bull traps) and breakdowns (bear traps) within a user-defined window.
How it works:
Detects when price breaks a major swing high/low (using configurable lookback).
If price quickly reclaims the broken level within X bars (trap window), a trap is confirmed and a subtle icon (🐂 for bull, 🐻 for bear) is displayed on the chart—no labels, no clutter.
You can enable/disable alerts for bull/bear traps individually or together, and receive notifications the moment a trap is detected.
Use cases:
Spot and avoid classic market “fakeouts” that trap breakout traders.
Confirm SMC/ICT “Judas swing” setups, or filter for high-probability reversals.
Works on all timeframes and assets: stocks, crypto, forex, indices.
Inputs:
Swing Lookback Bars: How far back to define swing points (default: 50)
Major Swing Filter: Additional filter for only the most significant highs/lows (default: 200)
Trap Bars (Look Ahead): Window in which a trap must be confirmed (default: 10)
Enable Bull/Bear Trap Alerts: Toggle real-time alerts for each trap type.
Visuals:
🐻 icon below bar for bear trap (short squeeze/reversal)
🐂 icon above bar for bull trap (long squeeze/reversal)
How to set up alerts:
Add the indicator to your chart, open TradingView’s Alerts panel, and choose “Bear Trap Alert,” “Bull Trap Alert,” or “Any Trap Alert” for instant notifications.
LCCM 2025⚔️ Six-Finger Phantom Grip – Forex Strategy by Thầy Khắc Quí
Inspired by martial arts, this strategy uses six key "fingers" to enter precise, high-probability trades with minimal risk.
🖐️ The 6 Fingers:
1. Trend Direction – Follow the main trend (H4/D1).
2. Key Price Zones – Identify strong support/resistance or supply/demand zones.
3. Price Action Signals – Enter only with confirmation (pin bar, engulfing, etc.).
4. Lot Size & Risk Control – Smart position sizing; avoid overleveraging.
5. Perfect Timing – Patience to strike only at ideal setups.
6. Trader Psychology – Discipline, no FOMO, treat each trade like a martial arts move.
✅ Features:
No indicators, clean charts.
Focus on market structure and price behavior.
High emphasis on mindset and discipline.
ICT TIME ELEMENTS V2 [KaninFX]The ICT Time Elements indicator is a comprehensive trading tool designed to visualize the most critical market sessions and timeframes according to Inner Circle Trader (ICT) methodology. This indicator helps traders identify high-probability trading opportunities by highlighting key market sessions, killzones, and liquidity periods throughout the trading day.
## Key Features
Complete ICT Time Framework
- **Asian Range**: 8:00 PM - 12:00 AM (NY Time) - Evening consolidation period
- **London Killzone**: 2:00 AM - 5:00 AM (NY Time) - European market opening liquidity
- **NY Killzone**: 7:00 AM - 10:00 AM (NY Time) - US market opening with high volatility
- **Silver Bullet Sessions**:
- London Silver Bullet: 3:00 AM - 4:00 AM
- AM Silver Bullet: 10:00 AM - 11:00 AM
- PM Silver Bullet: 2:00 PM - 3:00 PM
- **Lunch Hours**: 5:00 AM - 7:00 AM & 12:00 PM - 1:00 PM (Lower volatility periods)
- **News Embargo**: 8:30 AM - 9:30 AM (High impact news release window)
- **20-Minute Macros**: :50 to :10 minutes of each hour (Short-term reversal periods)
- **True Day Close**: 4:00 PM - 4:30 PM (Official market close)
### 📊 Smart Information Display
- **Real-time Zone Detection**: Automatically identifies current active session
- **Zone Labels**: Clear labeling at the center of each time period
- **Current Zone Indicator**: Arrow pointer showing the active session
- **Comprehensive Info Table**: Quick reference for all time zones and their schedules
- **Flexible Table Positioning**: Place info table in any corner of your chart
### For ICT Traders
- Identify optimal entry times during killzone sessions
- Recognize silver bullet opportunities for quick scalps
- Avoid trading during lunch hour consolidations
- Prepare for news embargo volatility
### For Session Traders
- Track major market session transitions
- Plan trading strategy around high-liquidity periods
- Understand global market flow and timing
### For Swing Traders
- Identify macro trend continuation points
- Time position entries during optimal sessions
- Understand market structure changes across sessions
The ICT Time Elements indicator transforms complex ICT timing concepts into an easy-to-read visual tool. Whether you're a beginner learning ICT methodology or an experienced trader looking to optimize your timing, this indicator provides the essential market session awareness needed for successful trading.
*Compatible with all TradingView plans and timeframes. Works best on 1-minute to 1-hour charts for optimal session visualization.*
Ultimate Scalping System - Dual ScriptUltimate scalping tool that has multiple different variables to show a long or shot based off my own system on the 5 minute candle chart
DBX PSPKEY MARKET REVERSAL
Find PSP
Alert PSP
Strategy of OscarDBX to found true reversal either on Fx or Indices
MFI Divergence Indicator with EMA 9 & EMA 45EMA 9 cắt xuống EMA 45 trên MFI → dòng tiền ngắn hạn đang yếu dần → cảnh báo phân phối tiềm ẩn
Chandelier Stop + VWAPChandelier Stop + VWAP, combined script with two indicators to get a trend with the chandelier stops
Hybrid Heikin Ashi OverlayHybrid Heikin Ashi Overlay
I personally like Heikin Ashi for its simplicity in showing clean trends. However, it tends to smooth out price action so much that we sometimes miss key signals from the actual candles.
This indicator overlays Heikin Ashi-style background colors while keeping regular candles intact — giving you the best of both worlds:
• Smoother trend visibility
• No loss of execution precision
• Customizable colors & transparency
🔹 No repainting
🔹 No strategy logic — purely visual
🔹 Designed to reduce clutter and help traders stay focused on structure
Created by: @yug_and_her
Vela apertura del mercado (multi-TF)Mark the 10-minute market opening.
Use a multi-timeframe. To use 10-minute or shorter candles,
Volume Spike Alert & OverlayVolume Spike Alert & Overlay
This indicator will display the following as an overlay on your chart:
Current volume
Average Volume
Threshold for Alert
Description:
This indicator will display the current bar volume based on the chart time frame,
display the average volume based on selected conditions,
allow user selectable threshold over (or under) the average volume to trigger an alert.
Options:
Average lookback period
Smoothing type
Alert Threshold %
Enable / Disable Each Value
Change Text Color
Change Background Color
Change Table location
Add/Remove extra row for placement in top corner
Usage Example:
I use this indicator to alert when the current volume exceeds the average volume by a specified percentage to alert to volume spikes.
Set the threshold to 25% in the settings
Create an alert by clicking on the 3 dots on the right of the indicator title on the chart
When the threshold is exceeded the alert will trigger
If you prefer overlay indicators check out my others:
ADR / ATR Overlay
VOL / AVG Overlay
ADR, ATR & VOL Overlay
Timeframe % TrakcerPulls historical closes from nine higher-timeframe look-backs (1 H, 12 H, 1 D, 7 D, 14 D, 1 M, 3 M, 6 M, 1 Y, 3 Y) with request.security().
2. Calculates the percent change between each look-back close and the current price:
(close − close₍look-back₎) / close₍look-back₎ × 100
3. Renders a two-column table in the chart’s top-right corner.
• Left column = timeframe label
• Right column = % move, rounded to two decimals
4. Heat-codes the cells — green if the asset is up, red if it’s down — so you can spot momentum (or pain) instantly.
5. Stays lightweight by updating only on the last bar; no excess runtimes.
X OROverview
Designed to plot hourly opening ranges (ORs) on an intraday chart. It primarily serves as a trading tool for assessing market direction and potential trading opportunities by analyzing price action relative to key OHLC (Open, High, Low, Close) levels within each hourly range.
The code provided is for each hour sessions from 2:00 AM to 3:00 PM for a complete session-based framework. In addition there is the RTH open range
Purpose
The core purpose of this indicator is to:
✅ Define each hourly range (based on the session’s opening bar) by recording the high and low of that range.
✅ Extend this range into the following bars for visual reference — serving as dynamic support and resistance zones.
✅ Monitor price action relative to each hourly OR, helping traders evaluate market direction and structure trades using concepts like:
Breakouts above/below the OR high/low.
Rejections or consolidations within the OR.
Continuation or reversal signals tied to each OR.
Key Features
The script marks the first bar of the session as the OR session start.
During this bar, it initializes:
Opening price
Session high
Session low
These levels form the initial range.
🔹 Dynamic Range Tracking
Throughout the one-minute OR session:
The highest and lowest prices are updated in real time, capturing intra-hour volatility.
A visual background box is drawn to highlight the OR range on the chart.
🔹 Range Extension
The script defines an extended session period after the initial OR (e.g., 2:00 AM-2:45 AM for the 2:00 AM session).
During this extension period:
The box persists on the chart, providing a contextual zone that traders can use as a dynamic support/resistance area.
🔹 Visual Representation
Transparent colored boxes highlight each session’s OR visually on the chart.
These boxes help traders easily identify whether price is trading:
Inside the OR
Breaking above the high (potential bullish continuation)
Breaking below the low (potential bearish continuation)
Application in Trading
🔍 Trading the Opening Range Breakout
Traders often use the OR high and low as breakout triggers. For example:
A price break above the OR high may signal bullish momentum.
A break below the OR low may signal bearish momentum.
⚖️ Support and Resistance
Even if breakouts fail, the OR can act as a pivot zone — offering areas for:
Stop placements
Target levels
Entry confirmations for fade trades or mean reversion strategies.
🕒 Session Awareness
By defining each hour’s OR individually (from 2:00 AM to 3:00 PM), traders can:
Analyze price behavior within each session.
Recognize when liquidity or volatility increases (e.g. around overlapping sessions like London open or New York open).
Summary
This Pine Script indicator provides a powerful framework for visualizing and trading hourly opening ranges. It enhances intraday analysis by:
Structuring price action within hourly boxes.
Highlighting key price levels relative to OHLC concepts.
Helping traders make more informed decisions by assessing price behavior around these critical ranges.
Not-So-Average True Range (nsATR)Not-So-Average True Range (nsATR)
*By Sherlock_MacGyver*
---
Long Story Short
The nsATR is a complete overhaul of traditional ATR analysis. It was designed to solve the fundamental issues with standard ATR, such as lag, lack of contextual awareness, and equal treatment of all volatility events.
Key innovations include:
* A smarter ATR that reacts dynamically when price movement exceeds normal expectations.
* Envelope zones that distinguish between moderate and extreme volatility conditions.
* A long-term ATR baseline that adds historical context to current readings.
* A compression detection system that flags when the market is coiled and ready to break out.
This indicator is designed for traders who want to see volatility the way it actually behaves — contextually, asymmetrically, and with predictive power.
---
What Is This Thing?
Standard ATR (Average True Range) has limitations:
* It smooths too slowly (using Wilder's RMA), which delays detection of meaningful moves.
* It lacks context — no way to know if current volatility is high or low relative to history.
* It treats all volatility equally, regardless of scale or significance.
nsATR** was built from scratch to overcome these weaknesses by applying:
* Amplification of large True Range spikes.
* Visual envelope zones for detecting volatility regimes.
* A long-term context line to anchor current readings.
* Multi-factor compression analysis to anticipate breakouts.
---
Core Features
1. Breach Detection with Amplification
When True Range exceeds a user-defined threshold (e.g., ATR × 1.2), it is amplified using a power function to reflect nonlinear volatility. This amplified value is then smoothed and cascades into future ATR values, affecting the indicator beyond a single bar.
2. Direction Tagging
Volatility spikes are tagged as upward or downward based on basic price momentum (close vs previous close). This provides visual context for how volatility is behaving in real-time.
3. Envelope Zones
Two adaptive envelopes highlight the current volatility regime:
* Stage 1: Moderate volatility (default: ATR × 1.5)
* Stage 2: Extreme volatility (default: ATR × 2.0)
Breaching these zones signals meaningful expansion in volatility.
4. Long-Term Context Baseline
A 200-period simple moving average of the classic ATR establishes whether current readings are above or below long-term volatility expectations.
5. Multi-Signal Compression Detection
Flags potential breakout conditions when:
* ATR is below its long-term baseline
* Price Bollinger Bands are compressed
* RSI Bollinger Bands are also compressed
All three signals must align to plot a "Volatility Confluence Dot" — an early warning of potential expansion.
---
Chart Outputs
In the Indicator Pane:
* Breach Amplified ATR (Orange line)
* Classic ATR baseline (White line)
* Long-Term context baseline (Cyan line)
* Stage 1 and Stage 2 Envelopes (Purple and Yellow lines)
On the Price Chart:
* Triangles for breach direction (green/red)
* Diamonds for compression zones
* Optional background coloring for visual clarity
---
Alerts
Built-in alert conditions:
1. ATR breach detected
2. Stage 1 envelope breached
3. Stage 2 envelope breached
4. Compression zone detected
---
Customization
All components are modular. Traders can adjust:
* Display toggles for each visual layer
* Colors and line widths
* Breach threshold and amplification power
* Envelope sensitivity
* Compression sensitivity and lookback windows
Some options are disabled by default to reduce clutter but can be turned on for more aggressive signal detection.
---
Real-Time Behavior (Non-Repainting Clarification)
The indicator updates in real time on the current bar as new data comes in. This is expected behavior for live trading tools. Once a bar closes, values do not change. In other words, the indicator *does not repaint history* — but the current bar can update dynamically until it closes.
---
Use Cases
* Day traders: Use compression zones to anticipate volatility surges.
* Swing traders: Use envelope breaches for regime awareness.
* System developers: Replace standard ATR in your logic for better responsiveness.
* Risk managers: Use directional volatility signals to better model exposure.
---
About the Developer
Sherlock_MacGyver develops original trading systems that question default assumptions and solve real trader problems.
Daily S&P BreadthS&P breadth
measures stock percentages against their moving averages
5, 20, 50, 200
改良版 TOP/END 検知(シンプル動作確認版)//@version=6
indicator("改良版 TOP/END 検知(シンプル動作確認版)", overlay = true, max_labels_count = 100)
// ──────────────────────────────────────────
// 1. 基本パラメータ(シンプル版)
// ──────────────────────────────────────────
// 基本設定
adxLen = input.int(14, "ADX期間", group="基本設定")
rsiLen = input.int(14, "RSI期間", group="基本設定")
// 天井検知設定
topAdxThreshold = input.int(25, "天井ADX閾値", group="天井検知")
topRsiThreshold = input.int(70, "天井RSI閾値", group="天井検知")
// 強い下落検知設定(精度重視版)
enableStrongDecline = input.bool(true, "強い下落検知", group="強い下落検知")
strongDeclineAdx = input.int(22, "強下落ADX閾値", minval=15, maxval=35, group="強い下落検知")
strongDeclineRsi = input.int(52, "強下落RSI閾値", minval=40, maxval=65, group="強い下落検知")
strongDeclineVolume = input.float(1.3, "強下落出来高倍率", minval=0.8, maxval=2.5, group="強い下落検知")
earlyDetection = input.bool(true, "初動検知モード", tooltip="ONで早期検知、OFFで確実性重視", group="強い下落検知")
minDeclineForSignal = input.float(1.0, "最小価格下落(%)", minval=0.5, maxval=3.0, group="強い下落検知")
// 底検知設定(精度重視版)
bottomRsiThreshold = input.int(32, "底RSI閾値", minval=20, maxval=45, group="底検知")
minDeclineRate = input.float(2.8, "最小下落率(%)", minval=1.5, maxval=8.0, group="底検知")
bounceThreshold = input.float(1.2, "反発検知(%)", minval=0.5, maxval=2.5, group="底検知")
rsiRecoveryStrength = input.int(3, "RSI回復強度", minval=1, maxval=5, group="底検知")
requireVolumeConfirmation = input.bool(true, "出来高確認必須", group="底検知")
// 精度向上設定(新機能)
enableQualityFilter = input.bool(true, "品質フィルタ", tooltip="低品質シグナルを除去", group="精度向上")
minSignalGap = input.int(8, "シグナル間隔(最小足数)", minval=3, maxval=20, group="精度向上")
trendFilter = input.bool(true, "トレンドフィルタ", tooltip="トレンドに逆らうシグナルを除去", group="精度向上")
strengthThreshold = input.float(1.5, "シグナル強度閾値", minval=1.0, maxval=3.0, group="精度向上")
// 調整用設定(精度重視)
sensitivity = input.string("標準", "全体感度", options= , group="調整設定")
confirmationMode = input.bool(true, "確認モード", tooltip="ONで誤検知減少、OFFで早期検知", group="調整設定")
strictMode = input.bool(false, "厳格モード", tooltip="最高精度、シグナル数減少", group="調整設定")
// 表示設定
showTopLabels = input.bool(true, "天井ラベル表示", group="表示設定")
showBottomLabels = input.bool(true, "底ラベル表示", group="表示設定")
showStrongDecline = input.bool(true, "強い下落表示", group="表示設定")
// デバッグ設定
debugMode = input.bool(false, "デバッグモード", group="デバッグ")
// ──────────────────────────────────────────
// 2. インジケータ計算(精度向上版)
// ──────────────────────────────────────────
// ★変数の初期化(エラー回避)
enableOptionStrategy = true
hedgeRatio = 0.3
expectedDeclineTarget = 5.0
optionHoldingPeriod = 14
showOptionSignals = true
// ★ノイズ除去関連変数の初期化(バランス調整)
noiseReductionLevel = "標準"
consecutiveDeclineRequired = 1
minTrendStrength = 1.5
requireSignificantMove = false
// 基本指標
= ta.dmi(14, adxLen)
rsi = ta.rsi(close, rsiLen)
vol_avg = ta.sma(volume, 20)
// 移動平均(精度向上用)
sma20 = ta.sma(close, 20)
sma50 = ta.sma(close, 50)
ema12 = ta.ema(close, 12)
ema26 = ta.ema(close, 26)
// 高値追跡(改良版)
var float lastHigh = na
var int lastHighBar = na
if high > nz(lastHigh, high)
lastHigh := high
lastHighBar := bar_index
// 市場環境判定(新機能)
trendUp = close > sma20 and sma20 > sma50 and ema12 > ema26
trendDown = close < sma20 and sma20 < sma50 and ema12 < ema26
sideways = not trendUp and not trendDown
// ボラティリティ測定
atr14 = ta.atr(14)
atr20 = ta.atr(20)
highVolatility = atr14 > atr20 * 1.3
lowVolatility = atr14 < atr20 * 0.7
// 価格位置判定
pricePosition = (close - ta.lowest(low, 20)) / (ta.highest(high, 20) - ta.lowest(low, 20))
nearHigh = pricePosition > 0.8
nearLow = pricePosition < 0.2
// ──────────────────────────────────────────
// 3. 精密な天井検知
// ──────────────────────────────────────────
// 感度調整(厳格モード対応)
sensitivityMultiplier = strictMode ? 1.3 : sensitivity == "高" ? 0.8 : sensitivity == "標準" ? 1.0 : 1.2
// 天井条件(精度重視)
basicTopCondition = adx >= topAdxThreshold * sensitivityMultiplier and dip >= topAdxThreshold * sensitivityMultiplier and rsi >= topRsiThreshold
// 価格確認(厳格化)
priceHigh = high >= ta.highest(high, 8) * 0.995
hasDeclined = close < close and close < close
significantDecline = (high - close) / high > 0.015
// 品質フィルタ(新機能)
qualityFilter = true
if enableQualityFilter
// RSIダイバージェンス確認
rsiDivergence = rsi < rsi and high >= high
// 出来高確認
volumeOk = na(volume) ? true : volume > vol_avg * 0.8
// トレンド確認
trendOk = not trendFilter or (trendUp or sideways)
qualityFilter := (rsiDivergence or significantDecline) and volumeOk and trendOk
// 最終天井シグナル(精度重視)
topCondition = basicTopCondition and priceHigh and hasDeclined and qualityFilter
topSignal = topCondition
// ──────────────────────────────────────────
// 4. 強い下落検知(ノイズ除去強化版)
// ──────────────────────────────────────────
// ノイズ除去レベルに応じた調整
noiseMultiplier = noiseReductionLevel == "弱" ? 0.8 : noiseReductionLevel == "標準" ? 1.0 : noiseReductionLevel == "強" ? 1.3 : 1.6
// シグナル強度計算(改良版)
calculateSignalStrength() =>
strength = 0.0
// ADX強度(より厳格)
if adx >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier
strength += (adx / 40.0) * 1.5
// DI-優勢度(より重要視)
if dim > dip and dim >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier * 0.9
strength += ((dim - dip) / 30.0) * 2.0
// RSI位置(より厳格)
if rsi < strongDeclineRsi * noiseMultiplier
strength += ((strongDeclineRsi - rsi) / 30.0) * 1.5
// 出来高強度(重要度向上)
if not na(volume) and volume > vol_avg * strongDeclineVolume * noiseMultiplier
strength += ((volume / vol_avg - 1.0) * 2.0)
// 価格下落強度(最重要)
priceDeclinePercent = (close - close) / close * 100
if priceDeclinePercent >= minDeclineForSignal * noiseMultiplier
strength += (priceDeclinePercent / 3.0) * 2.5
// 連続下落ボーナス
consecutiveDeclines = 0
for i = 0 to consecutiveDeclineRequired - 1
if close < close
consecutiveDeclines += 1
else
break
if consecutiveDeclines >= consecutiveDeclineRequired
strength += consecutiveDeclines * 0.8
// トレンド強度ボーナス
if dim > dip * 1.3 and adx > 20
strength += minTrendStrength * 0.5
strength
// 強い下落条件(大幅強化)
strongDeclineCondition = false
if enableStrongDecline
// 基本条件(厳格化)
adxCondition = adx >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier
dimCondition = dim >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier * 0.8 and dim > dip
rsiCondition = rsi < strongDeclineRsi * noiseMultiplier
volumeCondition = na(volume) ? false : volume > vol_avg * strongDeclineVolume * noiseMultiplier
// 価格下落確認(厳格化)
priceDeclinePercent = (close - close) / close * 100
priceDeclineCondition = priceDeclinePercent >= minDeclineForSignal * noiseMultiplier
// 連続下落確認
consecutiveDeclines = 0
for i = 0 to consecutiveDeclineRequired - 1
if close < close
consecutiveDeclines += 1
else
break
consecutiveCondition = consecutiveDeclines >= consecutiveDeclineRequired
// シグナル強度確認(厳格化)
signalStrength = calculateSignalStrength()
strengthCondition = signalStrength >= strengthThreshold * noiseMultiplier
// 重要な動きのみ検知
significantMoveCondition = true
if requireSignificantMove
// より大きな動きのみを重要とみなす
atrRatio = (high - low) / ta.atr(14)
priceImpact = priceDeclinePercent >= minDeclineForSignal * 1.5
volumeImpact = na(volume) ? false : volume > vol_avg * 1.8
significantMoveCondition := (atrRatio > 1.2) and (priceImpact or volumeImpact)
// トレンドフィルタ(厳格化)
trendCondition = not trendFilter or (trendDown or (dim > dip * 1.2 and adx > 18))
// すべての条件をAND結合(バランス調整)
if earlyDetection
// 早期検知:重要な下落を見逃さないよう条件緩和
basicCondition = (adxCondition or adx > 18) and dimCondition and rsiCondition
priceCondition = priceDeclineCondition or close < close * 0.995
consecutiveOk = consecutiveCondition or consecutiveDeclines >= 1 // 最低1足下落があればOK
strongDeclineCondition := basicCondition and (priceCondition or consecutiveOk) and strengthCondition and trendCondition
else
// 確実性重視:それでも少し緩和
basicCondition = adxCondition and dimCondition and rsiCondition and (volumeCondition or significantMoveCondition)
priceCondition = priceDeclineCondition and close < open
strongDeclineCondition := basicCondition and priceCondition and consecutiveCondition and strengthCondition and trendCondition
// 確認モード(バランス調整)
strongDeclineSignal = false
if confirmationMode
// 確認モード:2本での確認(3本から2本に緩和)
var int strongDeclineCount = 0
var float cumulativeStrength = 0.0
currentStrength = calculateSignalStrength()
if strongDeclineCondition
strongDeclineCount += 1
cumulativeStrength += currentStrength
else
strongDeclineCount := 0
cumulativeStrength := 0.0
// 確認の条件を緩和
confirmationThreshold = strictMode ? 2 : 1 // 厳格モードでも2本、通常は1本
highStrengthThreshold = strengthThreshold * 2.0
ultraHighStrengthThreshold = strengthThreshold * 3.0 // 4.0から3.0に緩和
strongDeclineSignal := (strongDeclineCount >= confirmationThreshold) or (strongDeclineCount >= 1 and currentStrength >= ultraHighStrengthThreshold)
else
// 通常モード:即座に反応
strongDeclineSignal := strongDeclineCondition
// ──────────────────────────────────────────
// 5. 底検知(精度重視版)
// ──────────────────────────────────────────
// 下落率計算(改良版)
declineFromHigh = nz(lastHigh) > 0 ? (nz(lastHigh) - low) / nz(lastHigh) * 100 : 0
// 時間経過チェック(高値からの経過時間)
barsFromHigh = nz(lastHighBar) > 0 ? bar_index - nz(lastHighBar) : 999
timeFilter = barsFromHigh >= 5 // 高値から最低5本経過
// 底検知条件(精度重視)
// 基本条件(厳格化)
basicBottomCondition = rsi <= bottomRsiThreshold * sensitivityMultiplier and declineFromHigh >= minDeclineRate and timeFilter
// 反発検知(改良版)
priceBounce = close > close * (1 + bounceThreshold/100)
strongBounce = close > low * (1 + bounceThreshold*1.5/100) and close > open * 1.005
// RSI回復検知(強度調整可能)
rsiRecoveryCondition = false
rsiRecoveryCount = 0
for i = 1 to rsiRecoveryStrength
if rsi > rsi
rsiRecoveryCount += 1
rsiRecoveryCondition := rsiRecoveryCount >= math.ceil(rsiRecoveryStrength * 0.6)
// 出来高分析(精度向上)
volumeAnalysis = true
if requireVolumeConfirmation
// 出来高枯渇確認
volumeDrying = na(volume) ? true : volume < vol_avg * 0.6
// 反発時の出来高増加
volumeIncrease = na(volume) ? true : volume > vol_avg * 1.1
volumeAnalysis := volumeDrying or (priceBounce and volumeIncrease)
// 価格安定確認(改良版)
priceStabilizing = math.abs(close - close ) / close < 0.015
lowTesting = low <= ta.lowest(low, 5) * 1.002 // 安値テスト
// ADX収束確認(トレンド終了の兆候)
adxDeclining = adx < adx and adx < adx
// 最終底シグナル(複数パターン - 精度重視)
// パターン1: 標準的な底(厳格化)
standardBottomCondition = basicBottomCondition and (priceBounce or strongBounce) and rsiRecoveryCondition and volumeAnalysis
standardBottom = standardBottomCondition
// パターン2: 強い反発底(条件追加)
strongBottomCondition = rsi <= bottomRsiThreshold * sensitivityMultiplier + 8 and strongBounce and rsiRecoveryCondition and volumeAnalysis and adxDeclining
strongBottom = strongBottomCondition
// パターン3: 大底パターン(精密化)
dryingBottomCondition = declineFromHigh >= minDeclineRate * 1.8 and volumeAnalysis and rsiRecoveryCondition and (priceStabilizing or lowTesting) and barsFromHigh >= 10
dryingBottom = dryingBottomCondition
// 品質フィルタ(底用)
bottomQualityFilter = true
if enableQualityFilter
// 位置確認(安値圏であること)
positionOk = nearLow or pricePosition < 0.3
// RSI売られすぎ確認
rsiOversoldOk = rsi <= 45
// トレンド確認
trendOk = not trendFilter or (trendDown or sideways or not trendUp)
bottomQualityFilter := positionOk and rsiOversoldOk and trendOk
// 最終判定(品質フィルタ適用)
bottomSignal = (standardBottom or strongBottom or dryingBottom) and bottomQualityFilter
// ──────────────────────────────────────────
// 6. シグナル管理(ノイズ除去強化版)
// ──────────────────────────────────────────
var int lastTopBar = na
var int lastBottomBar = na
var int lastStrongDeclineBar = na
// 動的間隔調整(ノイズ除去強化)
baseDynamicGap = minSignalGap * noiseMultiplier // ノイズレベルに応じて間隔調整
dynamicGap = baseDynamicGap
if highVolatility
dynamicGap := math.min(baseDynamicGap, math.max(baseDynamicGap - 3, 8)) // 高ボラでも最小8足は確保
else if lowVolatility
dynamicGap := baseDynamicGap + 5 // 低ボラ時は更に間隔延長
// 厳格な間隔チェック
topAllowed = na(lastTopBar) or bar_index - lastTopBar >= dynamicGap + 5
bottomAllowed = na(lastBottomBar) or bar_index - lastBottomBar >= dynamicGap + 2
strongDeclineAllowed = na(lastStrongDeclineBar) or bar_index - lastStrongDeclineBar >= math.max(dynamicGap, 10)
// 基本シグナル(競合チェック前)
basicFinalTopSignal = topSignal and topAllowed
basicFinalStrongDeclineSignal = strongDeclineSignal and strongDeclineAllowed
basicFinalBottomSignal = bottomSignal and bottomAllowed
// 競合シグナル排除(強化版)
// 天井と強い下落の適切な間隔確保
topConflict = basicFinalStrongDeclineSignal and not na(lastStrongDeclineBar) and bar_index - lastStrongDeclineBar <= 5
strongDeclineConflict = basicFinalTopSignal and not na(lastTopBar) and bar_index - lastTopBar <= 5
// 最終シグナル(競合排除 + 品質確認)
finalTopSignal = basicFinalTopSignal and not topConflict
finalStrongDeclineSignal = basicFinalStrongDeclineSignal and not strongDeclineConflict
finalBottomSignal = basicFinalBottomSignal
// 厳格モードでの追加フィルタ(大幅強化)
if strictMode
// 厳格モード:更に厳しい条件
topStrengthOk = adx >= topAdxThreshold * 1.3 and rsi >= topRsiThreshold + 8
declineStrengthOk = calculateSignalStrength() >= strengthThreshold * 1.5
bottomStrengthOk = declineFromHigh >= minDeclineRate * 1.3 and rsi <= bottomRsiThreshold - 5
finalTopSignal := finalTopSignal and topStrengthOk
finalStrongDeclineSignal := finalStrongDeclineSignal and declineStrengthOk
finalBottomSignal := finalBottomSignal and bottomStrengthOk
// 最終品質チェック(ノイズ除去の最後の砦)
if requireSignificantMove and finalStrongDeclineSignal
// 本当に重要な動きかをチェック
recentVolatility = ta.stdev(ta.change(close), 10)
currentMove = math.abs(ta.change(close))
isSignificant = currentMove > recentVolatility * 1.5
finalStrongDeclineSignal := finalStrongDeclineSignal and isSignificant
// バー番号更新
if finalTopSignal
lastTopBar := bar_index
if finalBottomSignal
lastBottomBar := bar_index
if finalStrongDeclineSignal
lastStrongDeclineBar := bar_index
// ──────────────────────────────────────────
// 7. ラベル表示(改良版)
// ──────────────────────────────────────────
labelOffset = ta.atr(14) * 1.5
// 天井ラベル
if showTopLabels and finalTopSignal
label.new(bar_index, high + labelOffset, "TOP", style=label.style_label_down, color=color.red, textcolor=color.white, size=size.normal)
// 強い下落ラベル(詳細情報付き)
if showStrongDecline and finalStrongDeclineSignal
// ラベルテキストを状況に応じて変更
labelText = earlyDetection ? "初動" : "強下落"
labelColor = earlyDetection ? color.orange : color.maroon
// 確認モードの場合は追加情報
if confirmationMode
labelText := labelText + "確認"
label.new(bar_index, high + labelOffset * 0.7, labelText, style=label.style_label_down, color=labelColor, textcolor=color.white, size=size.normal)
// 底ラベル(パターン別表示)
if showBottomLabels and finalBottomSignal
// 底のパターンを判定してラベル変更
endLabelText = "END"
endLabelColor = color.green
if strongBottom
endLabelText := "強反発"
endLabelColor := color.lime
else if dryingBottom
endLabelText := "大底"
endLabelColor := color.purple
label.new(bar_index, low - labelOffset, endLabelText, style=label.style_label_up, color=endLabelColor, textcolor=color.white, size=size.normal)
// ──────────────────────────────────────────
// 8. デバッグ表示(改良版)
// ──────────────────────────────────────────
// デバッグ条件を事前定義
showTopCondition = debugMode and basicTopCondition
showStrongDeclineCondition = debugMode and strongDeclineCondition
showBasicBottomCondition = debugMode and basicBottomCondition
// 強度とフィルタ状況
showStrengthOk = debugMode and calculateSignalStrength() >= strengthThreshold
showStrengthValue = debugMode and calculateSignalStrength() > 0
// 主要デバッグ情報
plotchar(showTopCondition, "TopCondition", "T", location.top, color.yellow)
plotchar(showStrongDeclineCondition, "StrongDecline", "D", location.top, color.red)
plotchar(showBasicBottomCondition, "BasicBottom", "B", location.bottom, color.blue)
// 強度マーカー(重要)- 説明付き
plotchar(showStrengthOk, "StrengthOk", "!", location.top, color.orange) // シグナル強度が閾値以上
// 最終シグナル確認マーカー(最重要)
plotchar(debugMode and finalStrongDeclineSignal, "FinalDecline", "F", location.abovebar, color.red) // 最終的にシグナル発生
plotchar(debugMode and finalBottomSignal, "FinalBottom", "E", location.belowbar, color.green)
// ★フィルタリング状況の詳細表示(新機能)
showFilterBlocked = debugMode and strongDeclineCondition and not finalStrongDeclineSignal
plotchar(showFilterBlocked, "FilterBlocked", "X", location.top, color.gray) // 条件は満たすがフィルタで除去
// ★各条件の個別チェック(新機能)
showAdxOk = debugMode and adx >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier
showDimOk = debugMode and dim >= strongDeclineAdx * sensitivityMultiplier * noiseMultiplier * 0.8 and dim > dip
showRsiOk = debugMode and rsi < strongDeclineRsi * noiseMultiplier
showVolumeOk = debugMode and (na(volume) ? false : volume > vol_avg * strongDeclineVolume * noiseMultiplier)
plotchar(showAdxOk, "ADX_OK", "A", location.bottom, color.blue)
plotchar(showDimOk, "DIM_OK", "M", location.bottom, color.orange)
plotchar(showRsiOk, "RSI_OK", "R", location.bottom, color.purple)
plotchar(showVolumeOk, "VOL_OK", "V", location.bottom, color.teal)
// 背景色でトレンド表示(簡素化)
trendBg = debugMode ? (trendUp ? color.new(color.green, 97) : trendDown ? color.new(color.red, 97) : na) : na
bgcolor(trendBg, title="トレンド")
// ──────────────────────────────────────────
// 9. アラート(ノイズ除去強化版)
// ──────────────────────────────────────────
if finalTopSignal
// 天井の品質情報を含む
qualityInfo = enableQualityFilter ? " (品質フィルタ適用)" : ""
strengthInfo = strictMode ? " " : ""
alertMsg = "🔴 精密天井検知" + strengthInfo + qualityInfo + ": ADX=" + str.tostring(adx, "#.#") + " RSI=" + str.tostring(rsi, "#.#") + " DI+=" + str.tostring(dip, "#.#")
alert(alertMsg, alert.freq_once_per_bar)
if finalStrongDeclineSignal
// 基本アラート情報
alertType = earlyDetection ? "🟠 クラッシュ初動検知" : "🔻 強い下落"
confirmInfo = confirmationMode ? " (確認済み)" : ""
strengthValue = calculateSignalStrength()
strengthInfo = strictMode ? " 強度:" + str.tostring(strengthValue, "#.##") : ""
baseAlert = alertType + strengthInfo + confirmInfo + ": ADX=" + str.tostring(adx, "#.#") + " DI-=" + str.tostring(dim, "#.#") + " RSI=" + str.tostring(rsi, "#.#")
// ★オプション戦略アラート(条件簡素化)
if showOptionSignals // enableOptionStrategyを削除
// シグナル強度に基づくリスク評価
signalStrength = calculateSignalStrength()
// リスクレベル別推奨アクション(閾値緩和)
putAction = ""
riskLvl = "低"
if signalStrength >= strengthThreshold * 1.8
putAction := "【PUT積極推奨】"
riskLvl := "高"
else if signalStrength >= strengthThreshold * 1.3
putAction := "【PUT検討推奨】"
riskLvl := "中"
else if signalStrength >= strengthThreshold * 0.8
putAction := "【PUT軽量推奨】"
riskLvl := "低"
// ヘッジ戦略情報
hedgeInfo = " | ヘッジ比率:" + str.tostring(hedgeRatio * 100, "#") + "%"
profitTarget = " | 想定下落:" + str.tostring(expectedDeclineTarget, "#.#") + "%"
holdingPeriod = " | 推奨期間:" + str.tostring(optionHoldingPeriod) + "日"
optionAlert = putAction + hedgeInfo + profitTarget + holdingPeriod
// 統合アラート
fullAlert = baseAlert + " " + optionAlert
alert(fullAlert, alert.freq_once_per_bar)
else
alert(baseAlert, alert.freq_once_per_bar)
if finalBottomSignal
// 底のパターン別メッセージ
bottomType = "🟢 底検知"
if strongBottomCondition
bottomType := "🟢 強反発底"
else if dryingBottomCondition
bottomType := "🟣 大底"
qualityInfo = enableQualityFilter ? " (品質確認済み)" : ""
timeInfo = " 高値から" + str.tostring(barsFromHigh) + "本経過"
strengthInfo = strictMode ? " " : ""
baseBottomAlert = bottomType + strengthInfo + qualityInfo + timeInfo + ": RSI=" + str.tostring(rsi, "#.#") + " 下落率=" + str.tostring(declineFromHigh, "#.#") + "%"
// ★オプション利確アラート(条件簡素化)
if showOptionSignals and not na(lastStrongDeclineBar) // enableOptionStrategyを削除
barsFromDecline = bar_index - lastStrongDeclineBar
if barsFromDecline <= math.max(optionHoldingPeriod, 30) // 期間延長
actualDecline = declineFromHigh
profitRatio = actualDecline / expectedDeclineTarget * 100
optionExitInfo = ""
if actualDecline >= expectedDeclineTarget * 0.5 // 0.7から0.5に緩和
optionExitInfo := " 【PUT利確推奨】達成度:" + str.tostring(profitRatio, "#") + "% | 経過:" + str.tostring(barsFromDecline) + "日"
else if actualDecline >= expectedDeclineTarget * 0.3 // 30%達成でも表示
optionExitInfo := " 【PUT利確検討】達成度:" + str.tostring(profitRatio, "#") + "% | 経過:" + str.tostring(barsFromDecline) + "日"
if optionExitInfo != ""
fullBottomAlert = baseBottomAlert + optionExitInfo
alert(fullBottomAlert, alert.freq_once_per_bar)
else
alert(baseBottomAlert, alert.freq_once_per_bar)
else
alert(baseBottomAlert, alert.freq_once_per_bar)
else
alert(baseBottomAlert, alert.freq_once_per_bar)