Daily Performance Analysis [Mr_Rakun]The Daily Performance Analysis indicator is a comprehensive trading performance tracker that analyzes your strategy's success rate and profitability across different days of the week and month. This powerful tool provides detailed statistics to help traders identify patterns in their trading performance and optimize their strategies accordingly.
Weekly Performance Analysis:
Tracks wins/losses for each day of the week (Monday through Sunday)
Calculates net profit/loss for each trading day
Shows profit factor (gross profit ÷ gross loss) for each day
Displays win rate percentage for each day
Monthly Performance Analysis:
Monitors performance for each day of the month (1-31)
Provides the same detailed metrics as weekly analysis
Helps identify monthly patterns and trends
Add to Your Strategy:
Copy the performance analysis code and integrate it into your existing Pine Script strategy
Optimize Strategy: Use insights to refine entry/exit timing or avoid trading on poor-performing days
Pattern Recognition: Identify which days of the week/month work best for your strategy
Risk Management: Avoid trading on historically poor-performing days
Strategy Optimization: Fine-tune your approach based on empirical data
Performance Tracking: Monitor long-term trends in your trading success
Data-Driven Decisions: Make informed adjustments to your trading schedule
Penunjuk dan strategi
EMA10/14/20 Trend Alignment (1st Signal Only)// ╔══════════════════════════════════════════════╗
// ║ M1 Starter Entry 10/14/20 (TH/EN) ║
// ╚══════════════════════════════════════════════╝
//
// 📌 ภาษาไทย:
// ระบบนี้ใช้ EMA 10/14/20 สำหรับจับจุดเข้าไม้ต้นเทรนด์ใน Timeframe M1
// - ออกสัญญาณ Buy เมื่อ EMA เรียงตัว 10 > 14 > 20 และแท่งเทียนยืนเหนือเส้น (โดยไม่แนบเส้นเกินไป)
// - ออกสัญญาณ Sell เมื่อ EMA เรียง 10 < 14 < 20 และแท่งอยู่ใต้เส้นทั้งหมด
// - มีการตรวจสอบระยะห่างระหว่างเส้น เพื่อหลีกเลี่ยงจุดหลอกตอน EMA ชิดกัน
// - สัญญาณออกเฉพาะ “แท่งแรก” หลังเข้าเงื่อนไขเท่านั้น
//
// 📌 English:
// This script detects early trend entries using EMA 10/14/20 on M1 timeframe.
// - Buy signal: When EMA10 > EMA14 > EMA20, and the candle closes above all EMAs
// - Sell signal: When EMA10 < EMA14 < EMA20, and the candle closes below all EMAs
// - Minimum distance between EMAs required to avoid fake signals in flat zones
// - Signals are shown only on the **first candle** that meets all conditions
//
// 🛠 เหมาะกับการใช้คู่กับระบบ MTF หรือแนวรับต้านด้วย
// Created by: คุณซี 💚
Slope Based Divergences of Wavelet - (Multi-Length, Dual Price)
1. Summary
This is not a typical divergence indicator. Instead of comparing simple peaks and troughs in price and an oscillator, the Slope-Based Divergence Engine performs a far more rigorous analysis by measuring the rate of change (slope) itself.
It identifies high-probability divergence opportunities by detecting moments when price is accelerating strongly in one direction while the underlying momentum, measured by a sophisticated Scientific Wavelet Oscillator, is accelerating in the opposite direction. By requiring confirmation from two different price sources (high and low) and across multiple timeframes, it aims to filter out noise and pinpoint only the most potent moments of market exhaustion.
2. The Core Innovation: Why Slope?
Traditional divergence indicators look at levels (e.g., price made a higher high, RSI made a lower high). This script looks at momentum's momentum.
Traditional Method: "Price went up, but momentum went down."
This Script's Method: "Price is accelerating upwards faster than ever, but momentum is decelerating faster than ever."
By focusing on the slope, the indicator identifies points of maximum stress and disagreement in the market, which often precede sharp reversals.
3. Key Components & Logic
The script's power comes from its multi-layered filtering system:
Scientific Wavelet Oscillator: The indicator's engine is a custom oscillator built using a Haar Wavelet Transform. Unlike standard oscillators (like RSI or Stochastics) that use a single period, this one analyzes the price across multiple different time scales (or "octaves") simultaneously. It then fuses this information into a single, robust momentum reading that is normalized using a statistical Z-score.
Multi-Length Average Slope: The script doesn't just calculate a single slope. It calculates the slope across a range of lookback periods (e.g., from 1 to 30 bars) and then averages them. This creates a much smoother and more reliable measure of the trend's current velocity, filtering out the noise from any single period.
Dual Price Confirmation: To qualify a price trend, the script requires that the slope of two separate price sources (by default, high and low) are both in agreement. For a bearish divergence, the slopes of both the session high and low must be accelerating upwards aggressively. This ensures the entire price bar is participating in the move and avoids false signals from wicks or narrow ranges.
Multi-Timeframe Percent Rank: The script uses percentrank to normalize the calculated slopes, putting them on a scale of 0 to 100. This allows it to identify statistically extreme readings. A divergence is only confirmed if it meets the criteria on both a Long-Term (LL) and Short-Term (LS) lookback. This ensures the signal is not just a momentary fluke but is a valid point of exhaustion in both the immediate and broader context.
4. How to Interpret the Signals
The indicator plots simple labels on the chart when all conditions are met:
Green "Bull" Label (Bullish Divergence): Appears when:
The slopes of both high and low are accelerating downwards (in the bottom 8% of their historical readings for both long and short lookbacks).
Simultaneously, the slope of the wavelet oscillator is accelerating upwards (in the top 92% of its historical readings).
Meaning: Price is in a state of free-fall, but the underlying momentum is aggressively turning up. This signals that selling pressure is likely exhausted.
Red "Bear" Label (Bearish Divergence): Appears when:
The slopes of both high and low are accelerating upwards (in the top 92% of their historical readings).
Simultaneously, the slope of the wavelet oscillator is accelerating downwards (in the bottom 8% of its historical readings).
Meaning: Price is in a state of extreme ascent (a "blow-off top"), but the underlying momentum is collapsing. This signals that buying pressure is likely exhausted.
5. How to Use in Trading
Reversal Signals: The labels should be treated as high-probability signals that a trend is exhausted and a reversal or significant pullback is imminent.
Confirmation Tool: Do not use the labels as standalone entry signals. Always seek confirmation from other forms of analysis, such as a break of a trendline, a key support/resistance level holding, or a classic candlestick reversal pattern.
Exit Signals: A bearish divergence label can serve as a powerful signal to take profit on long positions, and a bullish label can be a signal to cover shorts.
aiTrendview-OPTION-KING + OI Summary Pro📊 aiTrendview OPTION TRADING SYSTEM - Complete Analysis Guide
🎯 System Overview
The aiTrendview Option Trading System is a comprehensive, institutional-grade trading dashboard that combines Supertrend signals, volume analysis, options flow data, and risk management into a unified trading interface. It's designed to provide traders with complete market intelligence for making high-probability, risk-managed trades.
________________________________________
🎛️ INPUT PARAMETERS & CONFIGURATION
Supertrend Settings
• ATR Period (6): Shorter period = more sensitive signals
• ATR Multiplier (10.0): Higher value = fewer but stronger signals
• Purpose: Filters market noise and identifies trend changes
• Trading Benefit: Reduces false signals while capturing major moves
Risk Management Parameters
• Stoploss % (20%): Maximum risk per trade
• Target 1 % (10%): First profit target - quick scalp
• Target 2 % (20%): Second target - trend continuation
• Target 3 % (30%): Final target - maximum profit potential
• Risk-Reward Calculation: Automatic 1:1.5 minimum ratio
Table Customization
• Position: 6 locations (Top/Bottom + Left/Center/Right)
• Size: Small/Normal/Large for different screen setups
• Show/Hide: Toggle table visibility
• Purpose: Optimal screen real estate usage without blocking price action
Options Flow Simulation
• OI Current Hour (500): Simulated current hour Open Interest
• OI Previous Hour (480): Previous hour OI for trend analysis
• ATM Offset (50): Strike price rounding (50-point intervals)
• Purpose: Tracks institutional money flow and positioning
________________________________________
📊 COMPREHENSIVE DASHBOARD SECTIONS
Section 1: TRADING SIGNALS
This is the core decision-making section providing complete trade setup information.
Signal Generation
• Buy Signal: Price crosses above Supertrend + volume confirmation
• Sell Signal: Price crosses below Supertrend + volume confirmation
• Wait Signal: No clear trend direction or conflicting signals
• Color Coding: Green (Buy), Red (Sell), Gray (Wait)
Complete Trade Setup
• Entry Price: Exact entry level based on signal
• Stoploss: Pre-calculated risk management level
• Target 1 (10%): Quick profit booking level
• Target 2 (20%): Trend continuation target
• Target 3 (30%): Maximum profit potential
• R:R Ratio: Risk-to-reward calculation (minimum 1:1.5)
Momentum Confirmation
• Accumulate: RSI < 30 (oversold, buying opportunity)
• Distribution: RSI > 70 (overbought, selling pressure)
• Neutral: RSI 30-70 (balanced conditions)
________________________________________
Section 2: VOLUME ANALYSIS
Critical for confirming signal strength and institutional participation.
Volume Metrics
• Current Volume: Real-time trading activity
• Volume MA (20-period): Average volume baseline
• Volume Ratio: Current vs. average (1.5x+ = high activity)
• Volume Progress: Daily volume completion percentage
• Color Coding: Blue (high), Gray (normal), Red (low)
Volume Interpretation
• > 2.0x Ratio: Institutional participation, strong signals
• 1.5-2.0x Ratio: Above average activity, good confirmation
• 1.0-1.5x Ratio: Normal activity, standard signals
• < 1.0x Ratio: Low participation, weak signals
Live Profit Tracking
• Real-time P&L: Current position profit/loss
• Color Coding: Green (profit), Red (loss), Black (breakeven)
• Percentage Display: Easy risk assessment
________________________________________
Section 3: OPTIONS & MARKET DATA
Advanced options flow analysis for institutional insight.
ATM Strike Analysis
• ATM Strike: At-the-money option strike (rounded to nearest 50)
• Purpose: Primary battleground for bulls vs. bears
• Significance: Highest gamma and most liquid options
Put/Call Volume Analysis
• Put Volume: Bearish positioning volume
• Call Volume: Bullish positioning volume
• Color Coding: Red (puts), Green (calls)
• Interpretation: Directional bias of smart money
PCR (Put Call Ratio)
• Calculation: Put Volume ÷ Call Volume
• Bullish: PCR < 0.8 (more calls than puts)
• Bearish: PCR > 1.2 (more puts than calls)
• Neutral: PCR 0.8-1.2 (balanced positioning)
• Contrarian Indicator: Extreme readings often reverse
OI Trend Analysis (Advanced Smart Money Tracking)
The system analyzes Open Interest changes vs. price movement:
• Long Buildup: ↑OI + ↑Price (Bulls adding positions)
• Short Buildup: ↑OI + ↓Price (Bears adding positions)
• Long Unwinding: ↓OI + ↓Price (Bulls exiting)
• Short Covering: ↓OI + ↑Price (Bears covering)
• Long Accumulation: ↑OI + Flat Price (Institutional accumulation)
• Bearish Weakness: ↓OI + Flat Price (Losing interest)
________________________________________
Section 4: MARKET CONTEXT
Additional confirmation indicators for complete market picture.
PDC (Previous Day Close) Analysis
• Bullish: Current price > Previous day high
• Bearish: Current price < Previous day low
• Neutral: Price within previous day range
• Significance: Breakout/breakdown confirmation
LTP (Last Traded Price)
• Real-time Price: Current market price
• Reference Point: For all calculations and targets
________________________________________
🎯 ACHIEVING RISK-OPTIMIZED TRADING
High Probability Setup Identification
Perfect Buy Setup (90%+ Success Rate)
1. Signal: Buy signal generated
2. Volume: Ratio > 1.5x (institutional participation)
3. Momentum: RSI in accumulation zone (< 40)
4. Options Flow: PCR < 0.8 (bullish positioning)
5. OI Trend: Long Buildup or Short Covering
6. PDC: Price > Previous day high
7. R:R Ratio: Minimum 1:2
Perfect Sell Setup (90%+ Success Rate)
1. Signal: Sell signal generated
2. Volume: Ratio > 1.5x (institutional participation)
3. Momentum: RSI in distribution zone (> 60)
4. Options Flow: PCR > 1.2 (bearish positioning)
5. OI Trend: Short Buildup or Long Unwinding
6. PDC: Price < Previous day low
7. R:R Ratio: Minimum 1:2
Risk Management Protocol
Position Sizing
• High Confidence (6+ confirmations): 2% risk per trade
• Medium Confidence (4-5 confirmations): 1% risk per trade
• Low Confidence (< 4 confirmations): Avoid or 0.5% risk
Entry Rules
• Never enter without Supertrend signal
• Wait for volume confirmation (>1.2x ratio)
• Check options flow alignment
• Ensure R:R ratio > 1:1.5
Exit Strategy
• Target 1 (10%): Book 1/3 position (covers commissions)
• Target 2 (20%): Book 1/3 position (secures profit)
• Target 3 (30%): Let remainder run with trailing stop
• Stoploss: Hard stop at 20% loss (non-negotiable)
________________________________________
📊 ADVANCED INTERPRETATION GUIDE
Volume Analysis Mastery
• Volume Spike + Buy Signal: High probability long setup
• Volume Decline + Sell Signal: Trend exhaustion, reversal likely
• High Volume + Neutral Signal: Wait for direction
• Low Volume + Any Signal: Weak setup, reduce size
Options Flow Intelligence
• PCR Divergence: When PCR contradicts price action (reversal setup)
• OI Buildup Confirmation: Aligns with Supertrend direction
• ATM Strike Defense: Price holding above/below ATM = strong level
Multi-Timeframe Confirmation
• 15-min Supertrend: Entry timing
• 1-hour Volume: Trend strength
• Daily PDC: Breakout confirmation
• Options Flow: Institutional positioning
________________________________________
🛡️ RISK-FREE TRADING METHODOLOGY
The 6-Point Confirmation System
Only trade when ALL 6 conditions align:
1. ✅ Supertrend Signal: Clear buy/sell signal
2. ✅ Volume Confirmation: Ratio > 1.5x
3. ✅ Momentum Alignment: RSI in favorable zone
4. ✅ Options Flow: PCR supporting direction
5. ✅ OI Trend: Institutional money aligned
6. ✅ Risk-Reward: Minimum 1:2 ratio
Position Management Rules
• Scale Out: Take profits at predetermined levels
• Trail Stops: Move stops to breakeven after Target 1
• Risk Limits: Never risk more than 2% per trade
• Daily Limits: Stop trading after 3 consecutive losses
Market Condition Adaptation
• Trending Markets: Use all 3 targets, trail stops
• Range Markets: Take profits at Target 1-2
• High Volatility: Reduce position size by 50%
• Low Volatility: Increase position size (within limits)
________________________________________
📈 PERFORMANCE OPTIMIZATION
Win Rate Enhancement
• Wait for 5+ confirmations: 80%+ win rate
• Use volume confirmation: Eliminates 60% of false signals
• Respect OI trends: Institutional money rarely wrong
• Follow options flow: Smart money positioning
Risk Reduction Techniques
• Pre-defined stops: No emotional decisions
• Position sizing: Mathematical risk management
• Market context: Don't fight the trend
• Time-based exits: Close before major events
Profit Maximization
• Scale out gradually: Capture trend moves
• Trail stops effectively: Let winners run
• Re-enter on pullbacks: Multiple entries in trends
• Compound gains: Reinvest profits systematically
________________________________________
🎯 ALERT SYSTEM INTEGRATION
Automated Alerts
• Buy/Sell Signals: Instant notification of Supertrend crosses
• Volume Spikes: When ratio exceeds 2x
• Profit Targets: 5% and 10% profit notifications
• Risk Management: Stop loss approach warnings
Mobile Integration
• Push Notifications: Never miss a setup
• Email Alerts: Backup notification system
• SMS Options: Critical signal delivery
• Discord/Telegram: Community sharing
________________________________________
💡 PROFESSIONAL TRADING INSIGHTS
Market Maker Psychology
• OI Buildup: Shows where institutions are positioned
• Volume Spikes: Institutional order flow
• PCR Extremes: Contrarian opportunities
• ATM Defense: Key support/resistance levels
Timing Optimization
• Best Setup Times: 10:00-11:30 AM and 2:30-3:15 PM
• Avoid: First 15 minutes and last 15 minutes
• Event Risk: Close positions before major announcements
• Weekend Risk: Avoid Friday afternoon entries
Advanced Strategies
• Fade False Breakouts: When volume doesn't confirm
• Ride Institutional Waves: Follow OI trends
• Contrarian Plays: Extreme PCR readings
• Momentum Continuation: Strong volume + trend alignment
________________________________________
The aiTrendview Option Trading System transforms complex market analysis into actionable trading decisions through systematic risk management, institutional flow analysis, and high-probability signal generation. By following the 6-point confirmation system and strict risk management rules, traders can achieve consistent profitability while minimizing drawdowns.
🔔 NIFTY 100+ Points Early Move Signal (1H)//@version=5
indicator("🔔 NIFTY 100+ Points Early Move Signal (1H)", overlay=true)
// === Inputs === //
squeezePeriod = input.int(20, title="Price Squeeze Lookback")
rangeTrigger = input.float(100.0, title="Target Move (in Points)")
rsiLength = input.int(14, title="RSI Length")
macdFast = input.int(12)
macdSlow = input.int(26)
macdSignal = input.int(9)
volMultiplier = input.float(1.5, title="Volume Spike Multiplier")
// === RSI & MACD === //
rsi = ta.rsi(close, rsiLength)
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdBullish = macdLine > signalLine
macdBearish = macdLine < signalLine
// === Price Compression === //
hh = ta.highest(high, squeezePeriod)
ll = ta.lowest(low, squeezePeriod)
compressionRange = hh - ll
tightCompression = compressionRange < (rangeTrigger * 0.6) // Pre-expansion
// === Volume Spike === //
avgVol = ta.sma(volume, 20)
volSpike = volume > avgVol * volMultiplier
// === Early Signal Logic === //
bullSetup = tightCompression and rsi > 50 and macdBullish and volSpike
bearSetup = tightCompression and rsi < 50 and macdBearish and volSpike
// === Plotting Signals === //
plotshape(bullSetup, title="Bullish Setup", location=location.belowbar, color=color.green, style=shape.labelup, text="100↑")
plotshape(bearSetup, title="Bearish Setup", location=location.abovebar, color=color.red, style=shape.labeldown, text="100↓")
bgcolor(bullSetup ? color.new(color.green, 85) : na)
bgcolor(bearSetup ? color.new(color.red, 85) : na)
// === Alerts === //
alertcondition(bullSetup, title="Bullish 100pt Setup", message="🚀 NIFTY: 100+ point UP move likely!")
alertcondition(bearSetup, title="Bearish 100pt Setup", message="🔻 NIFTY: 100+ point DOWN move likely!")
Multi-Timeframe Resonance v2.0📌 Multi-Timeframe Resonance System — Identify trend, range, and turning points at a glance
✨ Core Advantages:
🔹 Multi-timeframe resonance analysis: Detects trend direction and range across timeframes. Helps identify M tops, W bottoms, consolidation turning points, and trend switches.
🔹 Clear phase visualization: Highlights trend momentum (green) and consolidation zones (red).
🔹 Universally compatible: Works on stocks/ETFs, futures/commodities, forex, gold, crypto — parameter tuning is the only requirement.
🎯 Target Users:
✅ Traders needing fast structure analysis
✅ Trend-followers, swing traders, or range-arbitrageurs
✅ Multi-timeframe analysts & volume researchers
✅ Quant teams seeking stable signal output
📈 Market Structure Evolution Sequence:
**Same-Bear → Small Box Bull → Medium Box Bull → Large Box Bull → Same-Bull → Small Box Bear → Medium Box Bear → Large Box Bear → Same-Bear**
- “Same-Bear”/“Same-Bull”: full agreement among timeframes,strongest trend stages.
- “Small/Medium/Large Box”: represent increasing-level consolidations indicating trend emergence or turn.
🔍 By identifying the current structure phase, traders can determine if:
- The market is in the **early trend stage** (Same-Bull/Same-Bear)
- Or in a **trend shift period** (Bear→Bull or Bull→Bear)
- Or still **oscillating** (structures switching)
⚠️ **Practical Note:**
Although structure usually follows the sequence above, in strong or volatile moves it may:
- **Skip steps** (e.g., Same-Bear → Large Box Bull)
- **Switch rapidly** within a few candles
Traders should use volume, candle patterns, and higher-timeframe trends to confirm valid structure changes or avoid false breakouts.
📌 Execution Logic:
This indicator applies **multi-timeframe resonance** to capture **trend pullbacks**:
- Identifies trend direction via higher timeframes
- Uses pullback in shorter timeframe to signal entry
- Executes trend-following trades at pullback points
- Protects with structured stop-loss based on higher timeframe structure
🔒 This is a protected script. For access details, please see the Author’s Instructions.
📌 多周期共振识别系统 — 趋势、震荡与拐点,一目了然
✨ 核心优势:
🔹 多周期共振分析:同时检测多个周期的趋势方向与震荡结构,辅助识别 M 顶 / W 底 / 震荡拐点 / 趋势转换等关键信号。
🔹 趋势与震荡清晰可视:自动高亮趋势推进(绿色)与震荡盘整(红色)区域,一眼看清市场节奏。
🔹 全品种通用:适配股票 / ETF、期货 / 商品、外汇 / 黄金、加密货币等市场,仅需轻微参数微调。
🎯 适用人群:
✅ 需要快速识别图表结构的交易者
✅ 趋势跟随者、波段捕捉者、震荡套利者
✅ 热衷于多周期分析与量能行为研究的交易者
✅ 追求稳定信号输出的量化策略团队
📈 市场结构演变路径:
同空 → 小箱多 → 中箱多 → 大箱多 → 同多 → 小箱空 → 中箱空 → 大箱空 → 同空
“同空” / “同多”:表示多周期趋势完全一致,代表趋势最强阶段
“小箱 / 中箱 / 大箱”:代表不同级别的震荡结构,结构逐步递进,表示趋势正在酝酿或转向
🔍 通过识别当前所处的结构阶段,交易者可以判断:
当前是否处于趋势初期阶段(如同空 / 同多)
是否处于趋势转换区间(如由空转多或由多转空)
或仍处于震荡反复区间(结构频繁切换)
⚠️ 实战提醒:
虽然市场结构通常遵循上述顺序演化,但在强趋势或剧烈波动行情下,可能出现以下情况:
跳跃演化(如从“同空”直接进入“大箱多”阶段)
快速切换(几根K线内连续跳过多个结构)
因此,交易者应结合量能、K线形态及更高周期趋势,判断结构变化是否“有效”或为“假突破”。
📌 执行逻辑:
本指标通过多周期趋势共振确认,捕捉趋势中的回踩机会:
利用高阶周期判断趋势方向
在低阶周期的回踩位置作为进场信号
顺势交易,捕捉主趋势中的低吸 / 高抛机会
止损位置依据上位周期结构确认,明确清晰
🔒 本脚本为受控授权版本,如需获取使用权限,请参阅“作者说明”。
3 EMA Signal with Cleaned Dual Entry Logic3-EMA Trend Following Indicator with Buy/Sell Signals
EMA1 = Slow EMA (default 100)
EMA2 = Fast EMA (default 10)
EMA3 = Medium EMA (default 20)
Trend is bullish when EMA2 and EMA3 are above EMA1
Buy when EMA2 crosses above EMA3 in bullish trend
Sell when EMA2 crosses below EMA3 in bearish trend
Entry and exit points are plotted on chart
Multi ZigZag DR Advanced Elliott Wave - DR BASL📊 Multi ZigZag DR – Advanced Elliott Wave Detection by DR BASL 🧠
"ZigZag DR BASL - Elliott Wave" is a high-performance indicator designed to automatically detect Elliott Impulse Waves (0 → 1 → 2) using a multi-ZigZag approach with advanced ATR filtering.
🔍 Core Features:
✅ Detects impulse waves across 4 custom ZigZag lengths.
✅ Draws Entry, Stop Loss, and Take Profit (TP1–TP4) levels.
✅ Filters out market noise using ATR-based movement threshold.
✅ Fully customizable: colors, styles, wave structure, and display settings.
✅ Visual trend coloring (Bullish / Bearish) for directional clarity.
✅ Built-in alerts to notify when a new valid impulse wave is formed.
✅ Optional Pivot Statistics Table for wave validation and analysis.
🧠 Ideal For:
Elliott Wave traders looking for precise and automated detection.
Swing and structure-based traders using wave confluence.
Traders who prefer multi-layered ZigZag logic for confidence.
Users seeking visual clarity for entries, targets, and market context.
💡 Developed By:
📌 DR BASL – Designed with precision and flexibility in mind, coded in Pine Script v5, with modular logic and optimization for large-scale structures.
aiTrendview.com Option Calculator📊 aiTrendview Option Calculator - Complete Feature Guide
🎯 Overview
The aiTrendview Option Calculator is a comprehensive, professional-grade options trading dashboard that integrates live market data with advanced Black-Scholes pricing models and intelligent strategy recommendations. It transforms complex options analysis into an intuitive, visual interface for both novice and professional traders.
________________________________________
🎛️ Dashboard Settings & Customization
________________________________________
📋 Option Inputs - The Foundation
Strike Price (105 in example)
• Function: The contract's exercise price
• Analysis Impact: Determines moneyness (ITM/OTM status)
• Risk Assessment: Affects delta, probability of profit, and breakeven calculations
• Strategy Selection: Critical for spread strategies and risk/reward optimization
Days to Expiry (30 in example)
• Function: Time until option expiration
• Analysis Impact: Drives time decay (theta) calculations
• Risk Assessment: More days = higher time value but slower decay
• Strategy Selection: Short-term strategies favor <30 days, long-term >45 days
Risk Free Rate (5% in example)
• Function: Current treasury rate for theoretical pricing
• Analysis Impact: Affects all Greeks calculations and fair value pricing
• Risk Assessment: Higher rates increase call values, decrease put values
• Strategy Selection: Impacts carry strategies and early exercise decisions
Implied Volatility (25% in example)
• Function: Market's expectation of future price movement
• Analysis Impact: Primary driver of option premium
• Risk Assessment: High IV = expensive options, low IV = cheap options
• Strategy Selection: Determines whether to buy or sell premium
Option Type (Call/Put)
• Function: Directional bias selection
• Analysis Impact: Reverses delta sign and profit zones
• Risk Assessment: Calls profit from upward moves, puts from downward moves
• Strategy Selection: Foundation for all directional and neutral strategies
________________________________________
📊 Live Market Data Integration
Real-Time Price Feed
• Current Underlying Price: Live market price with percentage change
• Volume Analysis: Current volume vs. 20-day average (shows as multiplier like "1.5x")
• Price Momentum: Tracks intraday price movements
• Volatility Assessment: Uses VIX data or ATR-based calculations
________________________________________
🔢 The Greeks - Risk Metrics
Delta (Price Sensitivity)
• Range: -1.00 to +1.00
• Call Delta: 0 to +1 (positive exposure)
• Put Delta: -1 to 0 (negative exposure)
• Trading Use: Hedge ratio, directional exposure measurement
• Progress Bar: Visual representation of sensitivity strength
Gamma (Delta Acceleration)
• Function: Rate of delta change
• Peak: Highest at-the-money
• Trading Use: Risk management for large moves
• Display: Multiplied by 1000 for readability
Theta (Time Decay)
• Function: Daily premium erosion
• Always Negative: For long positions
• Trading Use: Time-based strategy selection
• Critical: Accelerates in final 30 days
Vega (Volatility Sensitivity)
• Function: Premium change per 1% IV change
• Trading Use: Volatility play strategies
• Risk Management: IV crush protection
• Strategy Selection: Buy low IV, sell high IV
Rho (Interest Rate Sensitivity)
• Function: Premium change per 1% rate change
• Less Critical: For short-term options
• Important: For LEAPS and rate-sensitive underlyings
________________________________________
📈 Market Analysis Section
Sentiment Analysis
• Bullish: PCR < 0.8 (more calls than puts)
• Bearish: PCR > 1.2 (more puts than calls)
• Neutral: PCR 0.8-1.2 (balanced activity)
• Calculation: Based on volume ratio and RSI momentum
Volume Analysis
• Current vs. Average: Spots unusual activity
• Ratio Display: Shows volume multiplier (e.g., "2.3x normal")
• Trading Signal: High volume confirms moves, low volume suggests consolidation
Risk Level Assessment
• Low: IV < 25% (cheap options)
• Medium: IV 25-40% (fairly valued)
• High: IV > 40% (expensive options)
• Color Coded: Green/Yellow/Red for quick identification
________________________________________
⚡ Strategy Recommendation Engine
Intelligent Analysis
The calculator analyzes 6 core strategies based on current market conditions:
1. Long Call: Best for bullish sentiment + low IV
2. Short Put: Best for bullish sentiment + high IV
3. Long Put: Best for bearish sentiment + low IV
4. Bull Call Spread: Best for moderate bullish moves
5. Long Straddle: Best for high volatility expected + low IV
6. Iron Butterfly: Best for neutral sentiment + high IV + low expected move
Scoring System
• Confidence Score: 0-100% based on market conditions
• Color Coding: Green (80%+), Yellow (60-80%), Red (<60%)
• Dynamic Updates: Recalculates with every price change
________________________________________
📊 Progress Bar Visualizations
Delta Strength: Visual representation of directional exposure
Time Decay: Days remaining until expiration
IV Level: Current implied volatility relative to extremes
Volume Activity: Current volume vs. historical average
Profit Probability: Calculated odds of profitable outcome
________________________________________
🎯 How to Achieve Risk-Optimized Trading
Step 1: Market Analysis
1. Check Sentiment: Is market bullish, bearish, or neutral?
2. Assess IV Level: Are options cheap, fair, or expensive?
3. Volume Confirmation: Is there institutional interest?
4. Time Frame: How many days until expiration?
Step 2: Strategy Selection
The calculator automatically recommends the highest probability strategy based on:
• Current market sentiment
• IV environment
• Expected move percentage
• Time to expiration
• Risk/reward optimization
Step 3: Risk Management Setup
For Long Strategies (Buying Options)
• Best When: IV rank is low (green), high probability score
• Risk Control: Maximum loss is premium paid
• Time Management: Avoid last 2 weeks before expiration
• Profit Taking: Close at 50% profit or 25% time decay
For Short Strategies (Selling Options)
• Best When: IV rank is high (red), neutral sentiment
• Risk Control: Use defined risk spreads
• Time Advantage: Target last 45 days
• Profit Taking: Close at 50% max profit
For Neutral Strategies
• Best When: Low expected move + high IV
• Risk Management: Iron butterflies and condors
• Time Decay: Benefits from theta decay
• Adjustment: Have roll/adjust plan ready
Step 4: Execution Guidelines
High Confidence Trades (80%+ Score)
• Position Size: Standard risk allocation
• Entry: Immediate execution
• Management: Hold to target or 21 DTE
Medium Confidence Trades (60-80% Score)
• Position Size: Reduced allocation
• Entry: Wait for better setup or confirmation
• Management: Tighter profit/loss targets
Low Confidence Trades (<60% Score)
• Action: Avoid or wait for better conditions
• Alternative: Consider opposite strategy
• Patience: Wait for higher probability setup
________________________________________
🔍 Real-Time Risk Monitoring
Live Greeks Tracking
• Delta Neutral: Maintain overall portfolio delta near zero
• Gamma Risk: Monitor acceleration risk on large moves
• Theta Decay: Track daily time value erosion
• Vega Exposure: Hedge volatility risk when needed
Probability Metrics
• Profit Probability: Statistical odds of profitable outcome
• Expected Move: Price range for 68% probability
• Breakeven Analysis: Exact price needed for profitability
• Time Value: Separation of intrinsic vs. extrinsic value
________________________________________
💡 Professional Trading Tips
Market Environment Adaptation
• Low IV Environment: Buy straddles, strangles, long options
• High IV Environment: Sell premium, iron condors, credit spreads
• Trending Markets: Directional strategies with trend
• Range-Bound Markets: Neutral strategies, short premium
Risk Management Rules
1. Never risk more than 2% of capital per trade
2. Close losing trades at 2x premium received (short) or 50% loss (long)
3. Take profits at 50% of maximum potential
4. Avoid earnings announcements unless specifically trading volatility
5. Have exit plan before entry
________________________________________
🎯 Achieving "Risk-Free" Trading
While no trading is truly risk-free, the calculator helps minimize risk through:
High Probability Setups
• Only trade strategies with 70%+ confidence scores
• Confirm with multiple indicators (sentiment, IV, volume)
• Use proper position sizing
Statistical Edge
• Mean reversion strategies in extreme IV environments
• Time decay advantages in short premium strategies
• Probability-based position sizing
Risk Mitigation
• Defined risk strategies only
• Proper diversification across time and strikes
• Systematic profit taking and loss cutting
• Continuous monitoring and adjustment
________________________________________
📊 Dashboard Interpretation Guide
Green Signals (Go)
• High strategy confidence score
• Favorable IV environment for strategy
• Strong volume confirmation
• Clear directional bias
Yellow Signals (Caution)
• Medium confidence scores
• Mixed market signals
• Average volume activity
• Reduce position size
Red Signals (Stop)
• Low confidence scores
• Unfavorable conditions
• Low volume/poor liquidity
• Wait for better setup
________________________________________
The aiTrendview Option Calculator transforms complex options analysis into actionable trading intelligence, helping traders make informed decisions based on mathematical models, live market data, and statistical probabilities rather than emotions or guesswork.
Reversal Point Dynamics⇋ Reversal Point Dynamics (RPD)
This is not an indicator; it is a complete system for deconstructing the mechanics of a market reversal. Reversal Point Dynamics (RPD) moves far beyond simplistic pattern recognition, venturing into a deep analysis of the underlying forces that cause trends to exhaust, pause, and turn. It is engineered from the ground up to identify high-probability reversal points by quantifying the confluence of market dynamics in real-time.
Where other tools provide a static signal, RPD delivers a dynamic probability. It understands that a true market turning point is not a single event, but a cascade of failing momentum, structural breakdown, and a shift in market order. RPD's core engine meticulously analyzes each of these dynamic components—the market's underlying state, its velocity and acceleration, its degree of chaos (entropy), and its structural framework. These forces are synthesized into a single, unified Probability Score, offering you an unprecedented, transparent view into the conviction behind every potential reversal.
This is not a "black box" system. It is an open-architecture engine designed to empower the discerning trader. Featuring real-time signal projection, an integrated Fibonacci R2R Target Engine, and a comprehensive dashboard that acts as your Dynamics Control Center , RPD gives you a complete, holistic view of the market's state.
The Theoretical Core: Deconstructing Market Dynamics
RPD's analytical power is born from the intelligent synthesis of multiple, distinct theoretical models. Each pillar of the engine analyzes a different facet of market behavior. The convergence of these analyses—the "Singularity" event referenced in the dashboard—is what generates the final, high-conviction probability score.
1. Pillar One: Quantum State Analysis (QSA)
This is the foundational analysis of the market's current state within its recent context. Instead of treating price as a random walk, QSA quantizes it into a finite number of discrete "states."
Formulaic Concept: The engine establishes a price range using the highest high and lowest low over the Adaptive Analysis Period. This range is then divided into a user-defined number of Analysis Levels. The current price is mapped to one of these states (e.g., in a 9-level system, State 0 is the absolute low, and State 8 is the absolute high).
Analytical Edge: This acts as a powerful foundational filter. The engine will only begin searching for reversal signals when the market has reached a statistically stretched, extreme state (e.g., State 0 or 8). The Edge Sensitivity input allows you to control exactly how close to this extreme edge the price must be, ensuring you are trading from points of maximum potential exhaustion.
2. Pillar Two: Price State Roc (PSR) - The Dynamics of Momentum
This pillar analyzes the kinetic forces of the market: its velocity and acceleration. It understands that it’s not just where the price is, but how it got there that matters.
Formulaic Concept: The psr function calculates two derivatives of price.
Velocity: (price - price ). This measures the speed and direction of the current move.
Acceleration: (velocity - velocity ). This measures the rate of change in that speed. A negative acceleration (deceleration) during a strong rally is a critical pre-reversal warning, indicating momentum is fading even as price may be pushing higher.
Analytical Edge: The engine specifically hunts for exhaustion patterns where momentum is clearly decelerating as price reaches an extreme state. This is the mechanical signature of a weakening trend.
3. Pillar Three: Market Entropy Analysis - The Dynamics of Order & Chaos
This is RPD's chaos filter, a concept borrowed from information theory. Entropy measures the degree of randomness or disorder in the market's price action.
Formulaic Concept: The calculateEntropy function analyzes recent price changes. A market moving directionally and smoothly has low entropy (high order). A market chopping back and forth without direction has high entropy (high chaos). The value is normalized between 0 and 1.
Analytical Edge: The most reliable trades occur in low-entropy, ordered environments. RPD uses the Entropy Threshold to disqualify signals that attempt to form in chaotic, unpredictable conditions, providing a powerful shield against whipsaw markets.
4. Pillar Four: The Synthesis Engine & Probability Calculation
This is where all the dynamic forces converge. The final probability score is a weighted calculation that heavily rewards confluence.
Formulaic Concept: The calculateProbability function intelligently assembles the final score:
A Base Score is established from trend strength and entropy.
An Entropy Score adds points for low entropy (order) and subtracts for high entropy (chaos).
A significant Divergence Bonus is awarded for a classic momentum divergence.
RSI & Volume Bonuses are added if momentum oscillators are in extreme territory or a volume spike confirms institutional interest.
MTF & Adaptive Bonuses add further weight for alignment with higher timeframe structure.
Analytical Edge: A signal backed by multiple dynamic forces (e.g., extreme state + decelerating momentum + low entropy + volume spike) will receive an exponentially higher probability score. This is the very essence of analyzing reversal point dynamics.
The Command Center: Mastering the Inputs
Every input is a precise lever of control, allowing you to fine-tune the RPD engine to your exact trading style, market, and timeframe.
🧠 Core Algorithm
Predictive Mode (Early Detection):
What It Is: Enables the engine to search for potential reversals on the current, unclosed bar.
How It Works: Analyzes intra-bar acceleration and state to identify developing exhaustion. These signals are marked with a ' ? ' and are tentative.
How To Use It: Enable for scalping or very aggressive day trading to get the earliest possible indication. Disable for swing trading or a more conservative approach that waits for full bar confirmation.
Live Signal Mode (Current Bar):
What It Is: A highly aggressive mode that plots tentative signals with a ' ! ' on the live bar based on projected price and momentum. These signals repaint intra-bar.
How It Works: Uses a linear regression projection of the close to anticipate a reversal.
How To Use It: For advanced users who use intra-bar dynamics for execution and understand the nature of repainting signals.
Adaptive Analysis Period:
What It Is: The main lookback period for the QSA, PSR, and Entropy calculations. This is the engine's "memory."
How It Works: A shorter period makes the engine highly sensitive to local price swings. A longer period makes it focus only on major, significant market structure.
How To Use It: Scalping (1-5m): 15-25. Day Trading (15m-1H): 25-40. Swing Trading (4H+): 40-60.
Fractal Strength (Bars):
What It Is: Defines the strength of the pivot detection used for confirming reversal events.
How It Works: A value of '2' requires a candle's high/low to be more extreme than the two bars to its left and right.
How To Use It: '2' is a robust standard. Increase to '3' for an even stricter definition of a structural pivot, which will result in fewer signals.
MTF Multiplier:
What It Is: Integrates pivot data from a higher timeframe for confluence.
How It Works: A multiplier of '4' on a 15-minute chart will pull pivot data from the 1-hour chart (15 * 4 = 60m).
How To Use It: Set to a multiple that corresponds to your preferred higher timeframe for contextual analysis.
🎯 Signal Settings
Min Probability %:
What It Is: Your master quality filter. A signal is only plotted if its score exceeds this threshold.
How It Works: Directly filters the output of the final probability calculation.
How To Use It: High-Quality (80-95): For A+ setups only. Balanced (65-75): For day trading. Aggressive (50-60): For scalping.
Min Signal Distance (Bars):
What It Is: A noise filter that prevents signals from clustering in choppy conditions.
How It Works: Enforces a "cooldown" period of N bars after a signal.
How To Use It: Increase in ranging markets to focus on major swings. Decrease on lower timeframes.
Entropy Threshold:
What It Is: Your "chaos shield." Sets the maximum allowable market randomness for a signal.
How It Works: If calculated entropy is above this value, the signal is invalidated.
How To Use It: Lower values (0.1-0.5): Extremely strict. Higher values (0.7-1.0): More lenient. 0.85 is a good balance.
Adaptive Entropy & Aggressive Mode:
What It Is: Toggles for dynamically adjusting the engine's core parameters.
How It Works: Adaptive Entropy can slightly lower the required probability in strong trends. Aggressive Mode uses more lenient settings across the board.
How To Use It: Keep Adaptive on. Use Aggressive Mode sparingly, primarily for scalping highly volatile assets.
📊 State Analysis
Analysis Levels:
What It Is: The number of discrete "states" for the QSA.
How It Works: More levels create a finer-grained analysis of price location.
How To Use It: 6-7 levels are ideal. Increasing to 9 can provide more precision on very volatile assets.
Edge Sensitivity:
What It Is: Defines how close to the absolute top/bottom of the range price must be.
How It Works: '0' means price must be in the absolute highest/lowest state. '3' allows a signal within the top/bottom 3 states.
How To Use It: '3' provides a good balance. Lower it to '1' or '0' if you only want to trade extreme exhaustion.
The Dashboard: Your Dynamics Control Center
The dashboard provides a transparent, real-time view into the engine's brain. Use it to understand the context behind every signal and to gauge the current market environment at a glance.
🎯 UNIFIED PROB SCORE
TOTAL SCORE: The highest probability score (either Peak or Valley) the engine is currently calculating. This is your main at-a-glance conviction metric. The "Singularity" header refers to the event where market dynamics align—the event RPD is built to detect.
Quality: A human-readable interpretation of the Total Score. "EXCEPTIONAL" (🌟) is a rare, A+ confluence event. "STRONG" (💪) is a high-quality, tradable setup.
📊 ORDER FLOW & COMPONENT ANALYSIS
Volume Spike: Shows if the current volume is significantly higher than average (YES/NO). A 'YES' adds major confirmation.
Peak/Valley Conf: This breaks down the probability score into its directional components, showing you the separate confidence levels for a potential top (Peak) versus a bottom (Valley).
🌌 MARKET STRUCTURE
HTF Trend: Shows the direction of the underlying trend based on a Supertrend calculation.
Entropy: The current market chaos reading. "🔥 LOW" is an ideal, ordered state for trading. "😴 HIGH" is a warning of choppy, unpredictable conditions.
🔮 FIB & R2R ZONE (Large Dashboard)
This section gives you the status of the Fibonacci Target Engine. It shows if an Active Channel (entry zone) or Stop Zone (invalidation zone) is active and displays the precise price levels for the static entry, target, and stop calculated at the time of the signal.
🛡️ FILTERS & PREDICTIVES (Large Dashboard)
This panel provides a status check on all the bonus filters. It shows the current RSI Status, whether a Divergence is present, and if a Live Pending signal is forming.
The Visual Interface: A Symphony of Data
Every visual element is designed for instant, intuitive interpretation of market dynamics.
Signal Markers: These are the primary outputs of the engine.
▼/▲ b: A fully confirmed signal that has passed all filters.
? b: A tentative signal generated in Predictive Mode, indicating developing dynamics.
◈ b: This diamond icon replaces the standard triangle when the signal is confirmed by a strong momentum divergence, highlighting it as a superior setup where dynamics are misaligned with price.
Harmonic Wave: The flowing, colored wave around the price.
What It Represents: The market's "flow dynamic" and volatility.
How to Interpret It: Expanding waves show increasing volatility. The color is tied to the "Quantum Color" in your theme, representing the underlying energy field of the market.
Entropy Particles: The small dots appearing above/below price.
What They Represent: A direct visualization of the "order dynamic."
How to Interpret Them: Their presence signifies a low-entropy, ordered state ideal for trading. Their color indicates the direction of momentum (PSR velocity). Their absence means the market is too chaotic (high entropy).
The Fibonacci Target Engine: The dynamic R2R system appearing post-signal.
Static Fib Levels: Colored horizontal lines representing the market's "structural dynamic."
The Green "Active Channel" Box: Your zone of consideration. An area to manage a potential entry.
Development Philosophy
Reversal Point Dynamics was engineered to answer a fundamental question: can we objectively measure the forces behind a market turn? It is a synthesis of concepts from market microstructure, statistics, and information theory. The objective was never to create a "perfect" system, but to build a robust decision-support tool that provides a measurable, statistical edge by focusing on the principle of confluence.
By demanding that multiple, independent market dynamics align simultaneously, RPD filters out the vast majority of market noise. It is designed for the trader who thinks in terms of probability and risk management, not in terms of certainties. It is a tool to help you discount the obvious and bet on the unexpected alignment of market forces.
"Markets are constantly in a state of uncertainty and flux and money is made by discounting the obvious and betting on the unexpected."
— George Soros
Trade with insight. Trade with anticipation.
— Dskyz, for DAFE Trading Systems
PosSys Reversal Points AdvisorOffering you the ability to quantify microstructure with no repaints, no lagging and no delay; Track and trade any and every reversal before it's obvious.
Use the PosSys™ Advisor to assist with entries, reentries, stoploss placement, confirmation, bias or confluence as needed, regardless of your trading style or execution method.
Access here⬇️
qssystems.tech
Want to backtest signals first? Use free version here ⬇️
Kripto Pro Alert BuySellThe Kripto Pro Alert BuySell is a multi-filtered, hybrid Buy/Sell signal indicator for crypto futures traders who demand no-nonsense signals and next-level visual analytics.
Features:
SSL Hybrid System with user-selectable signal mode: pure SSL, SSL+QQE+WAE, or SSL+SuperTrend
Advanced Trend Filtering: SuperTrend & HULL, ADX sideways filter, BB-squeeze filter
Integrated ATR Bands for dynamic volatility adaption
QQE Mod & Waddah Attar Explosion: Volatility and momentum confirmation
Dynamic Support/Resistance Detection (auto-drawn SR zones & pivots)
Comprehensive On-Chart Table: Real-time checklist of ALL filter & signal status for surgical decision making
One-click Alerts: Plug-and-play alert system for all major buy/sell and filter events
MTF EMA, MACD, PSAR, CCI, Stochastic, RSI: Layered confirmation, no more false hope!
Optimal Timeframe:
4H (240 min) delivers the highest-quality, noise-filtered signals for major altcoins and BTC/ETH.
Lower timeframes (1H) possible but increased whipsaws – use at your own risk!
Best Practices:
Always wait for candle CLOSE before acting on any signal (no FOMO entries).
Pair with strict risk management: Set SL below last swing or ATR, no “hopium” holding.
For automation: Use the integrated alertconditions for TradingView webhook/bot connections.
Sideways & Volatility Filter: Signals are automatically suppressed during BB Squeeze or low ADX (chop zone) to prevent overtrading.
Disclaimer:
This indicator is NOT financial advice. Test thoroughly with your risk parameters. No guarantee of future profits – only edge.
Developed by Kripto Pro – All Rights Reserved. For feedback, improvements or collabs: @KriptoPro0 on X (Twitter) | Telegram
PosSys Reversal Points (Delayed Version)**Disclaimer: There is a roughly 10-signal delay on all assets and timeframes; The delayed version is intended for historical testing only. **
Offering you the ability to quantify microstructure with no repaints, no lagging and no delay; Track and trade any and every reversal before it's obvious.
Use the PosSys™ Advisor to assist with entries, reentries, stoploss placement, confirmation, bias or confluence as needed, regardless of your trading style or execution method.
Access the paid version here ⬇️
qssystems.tech
Watch Demos here ⬇️
www.youtube.com
Vortex Indicator with HistogramThis is a simple script showing a standard Vortex Indicator along with a histogram that displays the difference between the Vortex lines.
ICT TOOLS//@version=5
indicator("ICT TOOLS", overlay=true, max_lines_count=500, max_labels_count=5, max_boxes_count=500)
// General Settings Inputs
TZI = input.string (defval="UTC -4", title="Timezone Selection", options= , tooltip="Select the Timezone. ( Shifts Chart Elements )", group="Global Settings")
Timezone = TZI == "UTC -10" ? "GMT-10:00" : TZI == "UTC -7" ? "GMT-07:00" : TZI == "UTC -6" ? "GMT-06:00" : TZI == "UTC -5" ? "GMT-05:00" : TZI == "UTC -4" ? "GMT-04:00" : TZI == "UTC -3" ? "GMT-03:00" : TZI == "UTC +0" ? "GMT+00:00" : TZI == "UTC +1" ? "GMT+01:00" : TZI == "UTC +2" ? "GMT+02:00" : TZI == "UTC +3" ? "GMT+03:00" : TZI == "UTC +3:30" ? "GMT+03:30" : TZI == "UTC +4" ? "GMT+04:00" : TZI == "UTC +5" ? "GMT+05:00" : TZI == "UTC +5:30" ? "GMT+05:30" : TZI == "UTC +6" ? "GMT+06:00" : TZI == "UTC +7" ? "GMT+07:00" : TZI == "UTC +8" ? "GMT+08:00" : TZI == "UTC +9" ? "GMT+09:00" : TZI == "UTC +9:30" ? "GMT+09:30" : TZI == "UTC +10" ? "GMT+10:00" : TZI == "UTC +10:30" ? "GMT+10:30" : TZI == "UTC +11" ? "GMT+11:00" : TZI == "UTC +13" ? "GMT+13:00" : "GMT+13:45"
inputMaxInterval = input.int (31, title="Hide Indicator Above Specified Minutes", tooltip="Above 30Min, Chart Will Become Messy & Unreadable", group="Global Settings")
// Session options
ShowTSO = input.bool (true, title="Show Today's Session Only", group="Session Options", tooltip="Hide Historical Sessions")
ShowTWO = input.bool (true, title="Show Current Week's Sessions Only", group="Session Options", tooltip="Show All Sessions from the current week")
SL4W = input.bool (true, title="Show Last 4 Week Sessions", group="Session Options", tooltip="Show All Sessions from Last Four Weeks Should Disable Current Week Session to Work")
ShowSFill = input.bool (false, title="Show Session Highlighting", group="Session Options", tooltip="Highlights Session from Top of the Chart to Bottom")
//----------------------------------------------
// Historical Lines
ShowMOPL = input.bool (title="Midnight Historical Price Lines", defval=false, group="Historical Lines", tooltip="Shows Historical Midnight Price Lines")
MOLHist = input.bool (title="Midnight Historical Vertical Lines", defval=true, group="Historical Lines", tooltip="Shows Historical Midnight Vertical Lines")
ShowPrev = input.bool (false, title="Misc. Historical Price Lines", group="Historical Lines", tooltip="Makes Chart Cluttered, Use For Backtesting Only")
//----------------------------------------------
// Session Bool
ShowLondon = input.bool (false, "", inline="LONDON", group="Sessions", tooltip="01:00 to 05:00")
ShowNY = input.bool (false, "", inline="NY", group="Sessions", tooltip="07:00 to 10:00")
ShowLC = input.bool (false, "", inline="LC", group="Sessions", tooltip="10:00 to 12:00")
ShowPM = input.bool (false, "",inline="PM", group="Sessions", tooltip="13:00 to 16:00")
ShowAsian = input.bool (false, "",inline="ASIA2", group="Sessions", tooltip="20:00 to 00:00")
ShowFreeSesh = input.bool (false, "",inline="FREE", group="Sessions", tooltip="Custom Session")
// Session Strings
txt2 = input.string ("LONDON", title="", inline="LONDON", group="Sessions")
txt3 = input.string ("NEW YORK", title="", inline="NY", group="Sessions")
txt4 = input.string ("LDN CLOSE", title="", inline="LC", group="Sessions")
txt5 = input.string ("AFTERNOON", title="", inline="PM", group="Sessions")
txt6 = input.string ("ASIA", title="", inline="ASIA2", group="Sessions")
txt9 = input.string ("FREE SESH", title="", inline="FREE", group="Sessions")
// CBDR = input.session ('1400-2000:1234567', "", inline="CBDR", group="Sessions")
// ASIA = input.session ('2000-0000:1234567', "", inline="ASIA", group="Sessions")
// Session Times
LDNsesh = input.session ('0200-0500:1234567', "", inline="LONDON", group="Sessions")
NYsesh = input.session ('0700-1000:1234567', "", inline="NY", group="Sessions")
LCsesh = input.session ('1000-1200:1234567', "", inline="LC", group="Sessions")
PMsesh = input.session ('1300-1600:1234567', "", inline="PM", group="Sessions")
ASIA2sesh = input.session ('2000-2359:1234567', "", inline="ASIA2", group="Sessions")
FreeSesh = input.session ('0000-0000:1234567', "", inline="FREE", group="Sessions")
// Session Color
LSFC = input.color (color.new(#787b86, 90), "", inline="LONDON", group="Sessions")
NYSFC = input.color (color.new(#787b86, 90), "",inline="NY", group="Sessions")
LCSFC = input.color (color.new(#787b86, 90), "",inline="LC", group="Sessions")
PMSFC = input.color (color.new(#787b86, 90), "",inline="PM", group="Sessions")
ASFC = input.color (color.new(#787b86, 90), "",inline="ASIA2", group="Sessions")
FSFC = input.color (color.new(#787b86, 90), "",inline="FREE", group="Sessions")
//----------------------------------------------
// Vertical Line Bool
ShowMOP = input.bool (title="", defval=true, inline="MOP", group="Vertical Lines", tooltip="00:00 AM")
txt12 = input.string ("MIDNIGHT", title="", inline="MOP", group="Vertical Lines")
ShowLOP = input.bool (title="", defval=false, inline="LOP", group="Vertical Lines", tooltip="03:00 AM")
txt14 = input.string ("LONDON", title="", inline="LOP", group="Vertical Lines")
ShowNYOP = input.bool (title="", defval=true, inline="NYOP", group="Vertical Lines", tooltip="08:30 AM")
txt15 = input.string ("NEW YORK", title="", inline="NYOP", group="Vertical Lines")
ShowEOP = input.bool (title="", defval=false, inline="EOP", group="Vertical Lines", tooltip="09:30 AM")
txt16 = input.string ("EQUITIES", title="", inline="EOP", group="Vertical Lines")
// Vertical Line Color
MOPColor = input.color (color.new(#787b86, 0), "", inline="MOP", group="Vertical Lines")
LOPColor = input.color (color.rgb(0,128,128,60), "", inline="LOP", group="Vertical Lines")
NYOPColor = input.color (color.rgb(0,128,128,60), "", inline="NYOP", group="Vertical Lines")
EOPColor = input.color (color.rgb(0,128,128,60), "", inline="EOP", group="Vertical Lines")
// Vertical LineStyle
Midnight_Open_LS = input.string ("Dotted", "", options= , inline="MOP", group="Vertical Lines")
london_Open_LS = input.string ("Solid", "", options= , inline="LOP", group="Vertical Lines")
NY_Open_LS = input.string ("Solid", "", options= , inline="NYOP", group="Vertical Lines")
Equities_Open_LS = input.string ("Solid", "", options= , inline="EOP", group="Vertical Lines")
// Vertical LineWidth
Midnight_Open_LW = input.string ("1px", "", options= , inline="MOP", group="Vertical Lines")
London_Open_LW = input.string ("1px", "", options= , inline="LOP", group="Vertical Lines")
NY_Open_LW = input.string ("1px", "", options= , inline="NYOP", group="Vertical Lines")
Equities_Open_LW = input.string ("1px", "", options= , inline="EOP", group="Vertical Lines")
//----------------------------------------------
// Opening Price Bool
ShowMOPP = input.bool (title="", defval=true, inline="MOPP", group="Opening Price Lines", tooltip="00:00 AM")
txt13 = input.string ("MIDNIGHT", title="", inline="MOPP", group="Opening Price Lines")
ShowNYOPP = input.bool (title="", defval=false, inline="NYOPP", group="Opening Price Lines", tooltip="08:30 AM")
txt17 = input.string ("NEW YORK", title="", inline="NYOPP", group="Opening Price Lines")
ShowEOPP = input.bool (title="", defval=false, inline="EOPP", group="Opening Price Lines", tooltip="09:30 AM")
txt18 = input.string ("EQUITIES", title="", inline="EOPP", group="Opening Price Lines")
ShowAFTPP = input.bool (title="", defval=false, inline="AFTOPP", group="Opening Price Lines", tooltip="01:30 PM")
txt1330 = input.string ("AFTERNOON", title="", inline="AFTOPP", group="Opening Price Lines")
// Opening Price Color
MOPColP = input.color (color.new(#787b86, 0), "", inline="MOPP", group="Opening Price Lines")
NYOPColP = input.color (color.new(#787b86, 0), "", inline="NYOPP", group="Opening Price Lines")
EOPColP = input.color (color.new(#787b86, 0), "", inline="EOPP", group="Opening Price Lines")
AFTOPColP = input.color (color.new(#787b86, 0), "", inline="AFTOPP", group="Opening Price Lines")
// Opening Price LineStyle
MOPLS = input.string ("Dotted", "", options= , inline="MOPP", group="Opening Price Lines")
NYOPLS = input.string ("Dotted", "", options= , inline="NYOPP", group="Opening Price Lines")
EOPLS = input.string ("Dotted", "", options= , inline="EOPP", group="Opening Price Lines")
AFTOPLS = input.string ("Dotted", "", options= , inline="AFTOPP", group="Opening Price Lines")
// Opening Price LineWidth
i_MOPLW = input.string ("1px", "", options= , inline="MOPP", group="Opening Price Lines")
i_NYOPLW = input.string ("1px", "", options= , inline="NYOPP", group="Opening Price Lines")
i_EOPLW = input.string ("1px", "", options= , inline="EOPP", group="Opening Price Lines")
i_AFTOPLW = input.string ("1px", "", options= , inline="AFTOPP", group="Opening Price Lines")
//----------------------------------------------
// W&M Bool
ShowWeekOpen = input.bool (defval=false, title="", tooltip="Draw Weekly Open Price Line", group="HTF Opening Price Lines", inline="WO")
showMonthOpen = input.bool (defval=false, title="", tooltip="Draw Monthly Open Price Line", group="HTF Opening Price Lines", inline="MO")
// W&M String
txt19 = input.string ("WEEKLY", title="", inline="WO", group="HTF Opening Price Lines")
txt20 = input.string ("MONTHLY", title="", inline="MO", group="HTF Opening Price Lines")
// W&M Color
i_WeekOpenCol = input.color (title="", defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="WO")
i_MonthOpenCol = input.color (title="", tooltip="", defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="MO")
// W&M LineStyle
WOLS = input.string ("Dotted", "", options= , inline="WO", group="HTF Opening Price Lines")
MOLS = input.string ("Dotted", "", options= , inline="MO", group="HTF Opening Price Lines")
// W&M LineWidth
i_WOPLW = input.string ("1px", "", options= , inline="WO", group="HTF Opening Price Lines")
i_MONPLW = input.string ("1px", "", options= , inline="MO", group="HTF Opening Price Lines")
//----------------------------------------------
// CBDR, ASIA & FLOUT
ShowCBDR = input.bool (true, "", inline='CBDR', group="CBDR, ASIA & FLOUT")
ShowASIA = input.bool (true, "", inline='ASIA', group="CBDR, ASIA & FLOUT")
ShowFLOUT = input.bool (false, "", inline='FLOUT', group="CBDR, ASIA & FLOUT")
// Strings
txt0 = input.string ("CBDR", title="", inline="CBDR", group="CBDR, ASIA & FLOUT", tooltip="16:00 to 20:00 SD Increments of 1")
txt1 = input.string ("ASIA", title="", inline="ASIA", group="CBDR, ASIA & FLOUT", tooltip="20:00 to 00:00 SD Increments of 1")
txt7 = input.string ("FLOUT", title="", inline="FLOUT", group="CBDR, ASIA & FLOUT", tooltip="16:00 to 00:00 SD Increments of 0.5")
// Color
CBDRBoxCol = input.color (color.new(#787b86, 0),"", inline='CBDR', group="CBDR, ASIA & FLOUT")
ASIABoxCol = input.color (color.new(#787b86, 0), "", inline='ASIA', group="CBDR, ASIA & FLOUT")
FLOUTBoxCol = input.color (color.new(#787b86, 0),"", inline='FLOUT', group="CBDR, ASIA & FLOUT")
// Extras
box_text_cbdr = input.bool (true, "Show Text", inline="CBDR", group="CBDR, ASIA & FLOUT")
box_text_cbdr_col = input.color (color.new(color.gray, 80), "", inline="CBDR", group="CBDR, ASIA & FLOUT")
bool_cbdr_dev = input.bool (true, "SD", inline="CBDR", group="CBDR, ASIA & FLOUT")
box_text_asia = input.bool (true, "Show Text", inline="ASIA", group="CBDR, ASIA & FLOUT")
box_text_asia_col = input.color (color.new(color.gray, 80), "", inline="ASIA", group="CBDR, ASIA & FLOUT")
bool_asia_dev = input.bool (true, "SD", inline="ASIA", group="CBDR, ASIA & FLOUT")
box_text_flout = input.bool (true, "Show Text", inline="FLOUT", group="CBDR, ASIA & FLOUT")
box_text_flout_col = input.color (color.new(color.gray, 80), "", inline="FLOUT", group="CBDR, ASIA & FLOUT")
bool_flout_dev = input.bool (true, "SD", inline="FLOUT", group="CBDR, ASIA & FLOUT")
// Table
// SD Lines
ShowDevLN = input.bool (title="", defval=true, inline="DEVLN", group="Standard Deviation", tooltip="Deviation Lines")
DEVLNTXT = input.string ("SD LINES", title="", inline="DEVLN", group="Standard Deviation")
DevLNCol = input.color (color.new(#787b86, 0), "", inline="DEVLN", group="Standard Deviation")
DEVLS = input.string ("Solid", "", options= , inline="DEVLN", group="Standard Deviation")
i_DEVLW = input.string ("1px", "", options= , inline="DEVLN", group="Standard Deviation")
DEVLSS = DEVLS=="Solid" ? line.style_solid : DEVLS == "Dotted" ? line.style_dotted : line.style_dashed
DEVLW = i_DEVLW=="1px" ? 1 : i_DEVLW == "2px" ? 2 : i_DEVLW == "3px" ? 3 : i_DEVLW == "4px" ? 4 : 5
ShowDev = input.bool (false, '', inline="DEV", group="Standard Deviation")
txt8 = input.string ("SD COUNT", title="", inline="DEV", group="Standard Deviation")
SDCountCol = input.color (color.new(#787b86, 0), "", inline="DEV", group="Standard Deviation")
DevInput = input.string ("2 SD", "", options= , inline="DEV", group="Standard Deviation")
DevDirection = input.string ("Both", "", options= , inline="DEV", group="Standard Deviation", tooltip="SD Count, NULL, SD Count, SD Direction")
DevCount = DevInput == "1 SD" ? 1 : DevInput == "2 SD" ? 2 : DevInput == "3 SD" ? 3 : 4
Auto_Select = input.bool (false, "", group="Standard Deviation", inline="AUTOSD", tooltip="Auto SD Selection | Charter Content, Range Table Might Bug Out On Mondays" )
txtSD = input.string ("AUTO SD", "", group="Standard Deviation", inline="AUTOSD")
Tab1txtCol = input.color (color.new(#808080, 0), "", inline='AUTOSD', group="Standard Deviation")
TabOptionShow = input.string ("Show Table", "", options= , inline="AUTOSD", group="Standard Deviation")
Stats = TabOptionShow == "Show Table" ? true : false
TabOption1 = input.string ("Top Right", "", options= , inline="AUTOSD", group="Standard Deviation")
tabinp1 = TabOption1 == "Top Left" ? position.top_left : TabOption1 == "Top Center" ? position.top_center : TabOption1 == "Top Right" ? position.top_right : TabOption1 == "Middle Left" ? position.middle_left : TabOption1 == "Middle Right" ? position.middle_right : TabOption1 == "Bottom Left" ? position.bottom_left : TabOption1 == "Bottom Center" ? position.bottom_center : position.bottom_right
L_Prof = true
CellBG = color.new(#131722, 100)
//----------------------------------------------
// Day Of Week & Labels
// Label Settings Inputs
ShowLabel = input.bool (true, title="", inline="Glabel", group="Day Of Week & Labels")
txt21 = input.string ("LABEL", title="", inline="Glabel", group="Day Of Week & Labels")
LabelColor = input.color (color.rgb(0,0,0,100), "", inline="Glabel", group="Day Of Week & Labels")
LabelSizeInput = input.string ("Normal", "", options= , inline="Glabel", group="Day Of Week & Labels")
Terminusinp = input.string ("Terminus @ Current Time +1hr", "", options = , inline="Glabel", group="Day Of Week & Labels", tooltip="Select Label Size & Color & Terminus Historical Price Lines needs to be toggled off for using Terminus")
ShowLabelText = input.bool (true, title="", inline="label", group="Day Of Week & Labels")
txt22 = input.string ("LABEL TEXT", title="", inline="label", group="Day Of Week & Labels")
LabelTextColor = input.color (color.new(#787b86, 0), title="", inline="label", group="Day Of Week & Labels")
LabelTextOptioninput = input.string ("Time", "", options= , inline="label", group="Day Of Week & Labels", tooltip="Choose Between Descriptive Text as Label or Time Show/Hide Prices on Labels")
ShowPricesBool = input.string ("Hide Prices", title="", options= , group="Day Of Week & Labels", inline="label")
ShowPrices = ShowPricesBool == "Show Prices" ? true : false
showDOW = input.bool (true, title="", inline="DOW", group="Day Of Week & Labels")
txt24 = input.string ("DAY OF WEEK", title="", inline="DOW", group="Day Of Week & Labels")
i_DOWCol = input.color (color.new(#787b86, 0), title="", inline="DOW", group="Day Of Week & Labels")
DOWTime = input.int (defval = 12, title="", inline="DOW", group="Day Of Week & Labels")
DOWLoc_inpt = input.string ("Bottom", "", options = , inline="DOW", group="Day Of Week & Labels", tooltip="DOW Color, Time Alignment, Vertical Location")
DOWLoc = DOWLoc_inpt == "Bottom" ? location.bottom : location.top
//----------------------------------------------
BIAS_M_Bool = input.bool (false, "", group="BIAS & NOTES PRECONFIG", inline="stats")
txt100 = input.string ("BIAS", title="", inline="stats", group="BIAS & NOTES PRECONFIG")
TableBG2 = color.new(#131722, 100)
Tab2txtCol = input.color (color.new(#787b86, 0), "", inline='stats', group="BIAS & NOTES PRECONFIG")
TabOption2 = input.string ("Bottom Right", "", options= , inline="stats", group="BIAS & NOTES PRECONFIG")
tabinp2 = TabOption2 == "Top Left" ? position.top_left : TabOption2 == "Top Center" ? position.top_center : TabOption2 == "Top Right" ? position.top_right : TabOption2 == "Middle Left" ? position.middle_left : TabOption2 == "Middle Right" ? position.middle_right : TabOption2 == "Bottom Left" ? position.bottom_left : TabOption2 == "Bottom Center" ? position.bottom_center : position.bottom_right
notesbool = false
NOTES_M_Bool = input.bool (true, "", group="BIAS & NOTES PRECONFIG", inline="stats2")
txt101 = input.string ("NOTES", title="", inline="stats2", group="BIAS & NOTES PRECONFIG")
Tab3txtCol = input.color (color.new(#787b86, 0), "", inline='stats2', group="BIAS & NOTES PRECONFIG")
TabOption3 = input.string ("Top Center", "", options= , inline="stats2", group="BIAS & NOTES PRECONFIG")
tabinp3 = TabOption3 == "Top Left" ? position.top_left : TabOption3 == "Top Center" ? position.top_center : TabOption3 == "Top Right" ? position.top_right : TabOption3 == "Middle Left" ? position.middle_left : TabOption3 == "Middle Right" ? position.middle_right : TabOption3 == "Bottom Left" ? position.bottom_left : TabOption3 == "Bottom Center" ? position.bottom_center : position.bottom_right
BIASbool1 = input.bool (true, '', inline="BIAS1", group="BIAS & NOTES")
txt52 = input.string ("DXY ", title="", inline="BIAS1", group="BIAS & NOTES")
BIASOption1 = input.string ("Unclear", options= , title="", inline="BIAS1", group="BIAS & NOTES")
BIASbool2 = input.bool (true, '', inline="BIAS2", group="BIAS & NOTES")
txt53 = input.string ("SPX ", title="", inline="BIAS2", group="BIAS & NOTES")
BIASOption2 = input.string ("Unclear", options= , title="", inline="BIAS2", group="BIAS & NOTES")
BIASbool3 = input.bool (true, '', inline="BIAS3", group="BIAS & NOTES")
txt54 = input.string ("DOW ", title="", inline="BIAS3", group="BIAS & NOTES")
BIASOption3 = input.string ("Unclear", options= , title="", inline="BIAS3", group="BIAS & NOTES")
BIASbool4 = input.bool (true, '', inline="BIAS4", group="BIAS & NOTES")
txt55 = input.string ("NAS ", title="", inline="BIAS4", group="BIAS & NOTES")
BIASOption4 = input.string ("Unclear", options= , title="", inline="BIAS4", group="BIAS & NOTES")
notes = input.text_area ("@smc_trading_br", "Notes", group = "BIAS & NOTES")
//--------------------END OF INPUTS--------------------//
// Pre-Def
DOM = (timeframe.multiplier <= inputMaxInterval) and (timeframe.isintraday)
newDay = ta.change(dayofweek)
newWeek = ta.change(weekofyear)
newMonth = ta.change(time("M"))
transparentcol = color.rgb(255,255,255,100)
LSVLC = color.rgb(255,255,255,100)
NYSVLC = color.rgb(255,255,255,100)
PMSVLC = color.rgb(255,255,255,100)
ASVLC = color.rgb(255,255,255,100)
LSVLS = "dotted"
NYSVLS = "dotted"
PMSVLS = "dotted"
ASVLS = "dotted"
// Functions
isToday = false
if year(timenow) == year(time) and month(timenow) == month(time) and dayofmonth(timenow) == dayofmonth(time)
isToday := true
// Current Week
thisweek = year(timenow) == year(time) and weekofyear(timenow) == weekofyear(time)
LastOneWeek = year(timenow) == year(time) and weekofyear(timenow-604800000) == weekofyear(time)
LastTwoWeek = year(timenow) == year(time) and weekofyear(timenow-1209600000) == weekofyear(time)
LastThreeWeek = year(timenow) == year(time) and weekofyear(timenow-1814400000) == weekofyear(time)
LastFourWeek = year(timenow) == year(time) and weekofyear(timenow-2419200000) == weekofyear(time)
Last4Weeks = false
if thisweek == true or LastOneWeek == true or LastTwoWeek == true or LastThreeWeek == true or LastFourWeek == true
Last4Weeks := true
// Function to draw Vertical Lines
vline(Start, Color, linestyle, LineWidth) =>
line.new(x1=Start, y1=low - ta.tr, x2=Start, y2=high + ta.tr, xloc=xloc.bar_time, extend=extend.both, color=Color, style=linestyle, width=LineWidth)
// Function to convert forex pips into whole numbers
atr = ta.atr(14)
toWhole(number) =>
if syminfo.type == "forex" // This method only works on forex pairs
_return = atr < 1.0 ? (number / syminfo.mintick) / 10 : number
_return := atr >= 1.0 and atr < 100.0 and syminfo.currency == "JPY" ? _return * 100 : _return
else
number
// Function for determining the Start of a Session (taken from the Pinescript manual: www.tradingview.com )
SessionBegins(sess) =>
t = time("", sess , Timezone)
DOM and (not barstate.isfirst) and na(t ) and not na(t)
// BarIn Session
BarInSession(sess) =>
time(timeframe.period, sess, Timezone) != 0
// Label Type Logic
var SFistrue = true
if LabelTextOptioninput == "Time"
SFistrue := true
else
SFistrue := false
// Session String to int
SeshStartHour(Session) =>
math.round(str.tonumber(str.substring(Session,0,2)))
SeshStartMins(Session) =>
math.round(str.tonumber(str.substring(Session,2,4)))
SeshEndHour(Session) =>
math.round(str.tonumber(str.substring(Session,5,7)))
SeshEndMins(Session) =>
math.round(str.tonumber(str.substring(Session,7,9)))
// Time periods
CBDR = "1600-2000:1234567"
ASIA = "2000-0000:1234567"
FLOUT = "1600-0000:1234567"
midsesh = "0000-1600:1234567"
cbdrOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(CBDR), SeshStartMins(CBDR), 00)
cbdrEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(CBDR), SeshEndMins(CBDR), 00)
asiaOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(ASIA), SeshStartMins(ASIA), 00)
asiaEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(ASIA), SeshEndMins(ASIA), 00)+86400000
floutOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(FLOUT), SeshStartMins(FLOUT), 00)
floutEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(FLOUT), SeshEndMins(FLOUT), 00)+86400000
CBDRTime = time (timeframe.period, CBDR, Timezone)
ASIATime = time (timeframe.period, ASIA, Timezone)
FLOUTTime = time (timeframe.period, FLOUT, Timezone)
LabelOnlyToday = true
// Time Periods
LondonStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(LDNsesh), SeshStartMins(LDNsesh), 00)
LondonEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(LDNsesh), SeshEndMins(LDNsesh), 00)
NYStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(NYsesh), SeshStartMins(NYsesh), 00)
NYEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(NYsesh), SeshEndMins(NYsesh), 00)
LCStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(LCsesh), SeshStartMins(LCsesh), 00)
LCEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(LCsesh), SeshEndMins(LCsesh), 00)
PMStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(PMsesh), SeshStartMins(PMsesh), 00)
PMEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(PMsesh), SeshEndMins(PMsesh), 00)
AsianStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(ASIA2sesh), SeshStartMins(ASIA2sesh), 00)
AsianEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(ASIA2sesh), SeshEndMins(ASIA2sesh), 00)
FreeStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(FreeSesh), SeshStartMins(FreeSesh), 00)
FreeEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(FreeSesh), SeshEndMins(FreeSesh), 00)
MidnightOpenTime = timestamp(Timezone, year, month, dayofmonth, 0, 0, 00)
CLEANUPTIME = timestamp(Timezone, year, month, dayofmonth, 0, 0, 00) - 16200000
LondonOpenTime = timestamp(Timezone, year, month, dayofmonth, 3, 0, 00)
NYOpenTime = timestamp(Timezone, year, month, dayofmonth, 8, 30, 00)
EquitiesOpenTime = timestamp(Timezone, year, month, dayofmonth, 9, 30, 00)
AfternoonOpenTime = timestamp(Timezone, year, month, dayofmonth, 13, 30, 00)
tMidnight = time("1", "0000-0001:1234567", Timezone)
// Cleanup - Remove old drawing objects
Cleanup(days) =>
// Delete old drawing objects
// One day is 86400000 milliseconds
removal_timestamp = (CLEANUPTIME) - (days * 86400000) // Remove every drawing object older than the start of the Today's Midnight
a_allLines = line.all
a_allLabels = label.all
a_allboxes = box.all
// Remove old lines
if array.size(a_allLines) > 0
for i = 0 to array.size(a_allLines) - 1
line_x2 = line.get_x2(array.get(a_allLines, i))
if line_x2 < (removal_timestamp)
line.delete(array.get(a_allLines, i))
// Remove old labels
if array.size(a_allLabels) > 0
for i = 0 to array.size(a_allLabels) - 1
label_x = label.get_x(array.get(a_allLabels, i))
if label_x < removal_timestamp
label.delete(array.get(a_allLabels, i))
// Remove old boxes
if array.size(a_allboxes) > 0
for i = 0 to array.size(a_allboxes) - 1
box_x = box.get_right(array.get(a_allboxes, i))
if box_x < (removal_timestamp - 86400000)
box.delete(array.get(a_allboxes, i))
// End of Cleanup function
// Terminus Function
Terminus(Terminus_Inp)=>
if Terminus_Inp == "Terminus @ Current Time"
_return = timenow
else if Terminus_Inp == "Terminus @ Current Time +15min"
_return = timenow + 900000
else if Terminus_Inp == "Terminus @ Current Time +30min"
_return = timenow + 1800000
else if Terminus_Inp == "Terminus @ Current Time +45min"
_return = timenow + 2700000
else if Terminus_Inp == "Terminus @ Current Time +1hr"
_return = timenow + 3600000
else if Terminus_Inp == "Terminus @ Current Time +2hr"
_return = timenow + 7200000
else
_return = timenow + 10800000
// Linestyle Function
MNOPLS = Midnight_Open_LS=="Solid" ? line.style_solid : Midnight_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
LNOPLS = london_Open_LS=="Solid" ? line.style_solid : london_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
NWYOPLS = NY_Open_LS=="Solid" ? line.style_solid : NY_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
EQOPLS = Equities_Open_LS=="Solid" ? line.style_solid : Equities_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
MOPLSS = MOPLS=="Solid" ? line.style_solid : MOPLS == "Dotted" ? line.style_dotted : line.style_dashed
NYOPLSS = NYOPLS=="Solid" ? line.style_solid : NYOPLS == "Dotted" ? line.style_dotted : line.style_dashed
EOPLSS = EOPLS=="Solid" ? line.style_solid : EOPLS == "Dotted" ? line.style_dotted : line.style_dashed
AFTOPLSS = AFTOPLS=="Solid" ? line.style_solid : AFTOPLS == "Dotted" ? line.style_dotted : line.style_dashed
WeekOpenLS = WOLS=="Solid" ? line.style_solid : WOLS == "Dotted" ? line.style_dotted : line.style_dashed
MonthOpenLS = MOLS=="Solid" ? line.style_solid : MOLS == "Dotted" ? line.style_dotted : line.style_dashed
// Linewidth Function
MOPLW = Midnight_Open_LW=="1px" ? 1 : Midnight_Open_LW == "2px" ? 2 : Midnight_Open_LW == "3px" ? 3 : Midnight_Open_LW == "4px" ? 4 : 5
LOPLW = London_Open_LW=="1px" ? 1 : London_Open_LW == "2px" ? 2 : London_Open_LW == "3px" ? 3 : London_Open_LW == "4px" ? 4 : 5
NYOPLW = NY_Open_LW=="1px" ? 1 : NY_Open_LW == "2px" ? 2 : NY_Open_LW == "3px" ? 3 : NY_Open_LW == "4px" ? 4 : 5
EOPLW = Equities_Open_LW=="1px" ? 1 : Equities_Open_LW == "2px" ? 2 : Equities_Open_LW == "3px" ? 3 : Equities_Open_LW == "4px" ? 4 : 5
MOPPLW = i_MOPLW=="1px" ? 1 : i_MOPLW == "2px" ? 2 : i_MOPLW == "3px" ? 3 : i_MOPLW == "4px" ? 4 : 5
NYOPPLW = i_NYOPLW=="1px" ? 1 : i_NYOPLW == "2px" ? 2 : i_NYOPLW == "3px" ? 3 : i_NYOPLW == "4px" ? 4 : 5
EOPPLW = i_EOPLW=="1px" ? 1 : i_EOPLW == "2px" ? 2 : i_EOPLW == "3px" ? 3 : i_EOPLW == "4px" ? 4 : 5
AFTOPLW = i_AFTOPLW=="1px" ? 1 : i_AFTOPLW == "2px" ? 2 : i_AFTOPLW == "3px" ? 3 : i_AFTOPLW == "4px" ? 4 : 5
WEEKOPPLW = i_WOPLW=="1px" ? 1 : i_WOPLW == "2px" ? 2 : i_WOPLW == "3px" ? 3 : i_WOPLW == "4px" ? 4 : 5
MONTHOPPLW = i_MONPLW=="1px" ? 1 : i_MONPLW == "2px" ? 2 : i_MONPLW == "3px" ? 3 : i_MONPLW == "4px" ? 4 : 5
// Label Size Function
LabelSize =LabelSizeInput=="Auto" ? size.auto : LabelSizeInput=="Tiny" ? size.tiny : LabelSizeInput=="Small" ? size.small : LabelSizeInput=="Normal" ? size.normal : LabelSizeInput=="Large" ? size.large : size.huge
// Creating Variables
var London_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LSVLC, width=1)
var London_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LSVLC, width=1)
var LondonFill = linefill.new(London_Start_Vline, London_End_Vline, LSFC)
var NY_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var NY_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var NYFill = linefill.new(NY_Start_Vline, NY_End_Vline, NYSFC)
var LC_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var LC_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var LCFill = linefill.new(LC_Start_Vline, LC_End_Vline, LCSFC)
var PM_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=PMSVLC, width=1)
var PM_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=PMSVLC, width=1)
var PMFill = linefill.new(PM_Start_Vline, PM_End_Vline, PMSFC)
var Asian_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var Asian_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var AsianFill = linefill.new(Asian_Start_Vline, Asian_End_Vline, ASFC)
var Free_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var Free_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var FreeFill = linefill.new(Free_Start_Vline, Free_End_Vline, FSFC)
var Midnight_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=MOPColor, width=1)
var London_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LOPColor, width=1)
var NY_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYOPColor, width=1)
var Equities_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=EOPColor, width=1)
// When a New Day Starts, Start Drawing all lines
if newDay and dayofweek != dayofweek.sunday
// London Session
if (ShowLondon and DOM)
if ShowTSO
line.delete(London_Start_Vline )
line.delete(London_End_Vline )
linefill.delete(LondonFill )
London_Start_Vline := vline(LondonStartTime,transparentcol, line.style_solid, 1)
London_End_Vline := vline(LondonEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
LondonFill := linefill.new(London_Start_Vline, London_End_Vline, LSFC)
// New York Session
if (ShowNY and DOM)
if ShowTSO
line.delete(NY_Start_Vline )
line.delete(NY_End_Vline )
linefill.delete(NYFill )
NY_Start_Vline := vline(NYStartTime, transparentcol, line.style_solid, 1)
NY_End_Vline := vline(NYEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
NYFill := linefill.new(NY_Start_Vline, NY_End_Vline, NYSFC)
// London Close
if (ShowLC and DOM)
if ShowTSO
line.delete(LC_End_Vline )
linefill.delete(LCFill )
LC_Start_Vline := vline(LCStartTime, transparentcol, line.style_solid, 1)
LC_End_Vline := vline(LCEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
LCFill := linefill.new(LC_Start_Vline, LC_End_Vline, LCSFC)
// PM Session
if (ShowPM and DOM)
if ShowTSO
line.delete(PM_Start_Vline )
line.delete(PM_End_Vline )
linefill.delete(PMFill )
PM_Start_Vline := vline(PMStartTime, transparentcol, line.style_solid, 1)
PM_End_Vline := vline(PMEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
PMFill := linefill.new(PM_Start_Vline, PM_End_Vline, PMSFC)
// Asian Session
if (ShowAsian and DOM)
if ShowTSO
line.delete(Asian_Start_Vline )
line.delete(Asian_End_Vline )
linefill.delete(AsianFill )
Asian_Start_Vline := vline(AsianStartTime, transparentcol, line.style_solid, 1)
Asian_End_Vline := vline(AsianEndTime, transparentcol, line.style_solid, 1)
// if dayofweek == dayofweek.friday
// // line.delete(Asian_Start_Vline)
// // line.delete(Asian_End_Vline)
// Asian_Start_Vline := vline(MidnightOpenTime+244800000, transparentcol, line.style_solid, 1)
// Asian_End_Vline := vline(MidnightOpenTime+259200000, transparentcol, line.style_solid, 1)
if ShowSFill
AsianFill := linefill.new(Asian_Start_Vline, Asian_End_Vline, ASFC)
// Free Session
if (ShowFreeSesh and DOM)
if ShowTSO
line.delete(Free_Start_Vline )
line.delete(Free_End_Vline )
linefill.delete(FreeFill )
Free_Start_Vline := vline(FreeStartTime, transparentcol, line.style_solid, 1)
Free_End_Vline := vline(FreeEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
FreeFill := linefill.new(Free_Start_Vline, Free_End_Vline, FSFC)
// Midnight Opening Price
if (ShowMOP and DOM)
if MOLHist == false
line.delete(Midnight_Open )
Midnight_Open := vline(MidnightOpenTime, MOPColor, MNOPLS, MOPLW)
// London Opening Price
if (ShowLOP and DOM)
if ShowTSO
line.delete(London_Open )
London_Open := vline(LondonOpenTime, LOPColor, LNOPLS, LOPLW)
// New York Opening Price
if (ShowNYOP and DOM)
if ShowTSO
line.delete(NY_Open )
NY_Open := vline(NYOpenTime, NYOPColor, NWYOPLS, NYOPLW)
// Equities Opening Price
if (ShowEOP and DOM)
if ShowTSO
line.delete(Equities_Open )
Equities_Open := vline(EquitiesOpenTime, EOPColor, EQOPLS, EOPLW)
// Variables
var label MOPLB = na
var line MOPLN = na
var label NYOPLB = na
var line NYOPLN = na
var label EOPLB = na
var line EOPLN = na
var line AFTLN = na
var label AFTLB = na
// New York Midnight Open Price line
var openMidnight = 0.0
if tMidnight
if not tMidnight
openMidnight := open
else
openMidnight := math.max(open, openMidnight)
if (ShowMOPP and (openMidnight != openMidnight ) and DOM and barstate.isconfirmed)
label.delete(MOPLB )
if ShowMOPL == false
line.delete(MOPLN )
MOPLN := line.new(x1=tMidnight, y1=openMidnight, x2=tMidnight+86400000, xloc=xloc.bar_time, y2=openMidnight, color=MOPColP, style=MOPLSS, width=MOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(MOPLN, tMidnight+259200000)
if ShowLabel
MOPLB := label.new(x=tMidnight+86400000, y=openMidnight, xloc=xloc.bar_time, color=LabelColor, textcolor=MOPColP, style=label.style_label_left, size=LabelSize, tooltip="Midnight Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(MOPLB, tMidnight+259200000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(MOPLB, " 00:00 | " + str.tostring(open))
else
label.set_text(MOPLB, " 00:00 ")
label.set_tooltip(MOPLB, "Midnight Opening Price")
else
if ShowPrices == true
label.set_text(MOPLB, " Midnight Opening Price | " + str.tostring(open))
else
label.set_text(MOPLB, " Midnight Opening Price ")
label.set_tooltip(MOPLB, "")
label.set_textcolor(MOPLB, LabelTextColor)
label.set_size(MOPLB,LabelSize)
if time > PMEndTime and time < (MidnightOpenTime + 86400000)
line.delete(MOPLN )
if Terminusinp != "Terminus @ Next Midnight" and ShowMOPL == false
line.set_x2(MOPLN, Terminus(Terminusinp))
label.set_x(MOPLB, Terminus(Terminusinp))
// New York Opening Price Line
if (ShowNYOPP and (time == NYOpenTime) and DOM)
label.delete(NYOPLB )
if ShowPrev == false
line.delete(NYOPLN )
NYOPLN := line.new(x1=NYOpenTime, y1=open, x2=NYOpenTime+55800000, xloc=xloc.bar_time, y2=open, color=NYOPColP, style=NYOPLSS, width=NYOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(NYOPLN, NYOpenTime+228600000)
if ShowLabel
NYOPLB := label.new(x=NYOpenTime+55800000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=NYOPColP, style=label.style_label_left, size=LabelSize, tooltip="New York Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(NYOPLB, NYOpenTime+228600000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(NYOPLB, " 08:30 | " + str.tostring(open))
else
label.set_text(NYOPLB, " 08:30 ")
label.set_tooltip(NYOPLB, "New York Opening Price")
else
if ShowPrices == true
label.set_text(NYOPLB, " New York Opening Price | " + str.tostring(open))
else
label.set_text(NYOPLB, " New York Opening Price ")
label.set_tooltip(NYOPLB, "")
label.set_textcolor(NYOPLB, LabelTextColor)
label.set_size(NYOPLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(NYOPLN, Terminus(Terminusinp))
label.set_x(NYOPLB, Terminus(Terminusinp))
// Equities Opening Price Line
if (ShowEOPP and (time == EquitiesOpenTime) and DOM)
label.delete(EOPLB )
if ShowPrev == false
line.delete(EOPLN )
EOPLN := line.new(x1=EquitiesOpenTime, y1=open, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=open, color=EOPColP, style=EOPLSS, width=EOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(EOPLN, EquitiesOpenTime+225000000)
if ShowLabel
EOPLB := label.new(x=EquitiesOpenTime+52200000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=EOPColP, style=label.style_label_left, size=LabelSize, tooltip="Equities Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(EOPLB, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(EOPLB, " 09:30 | " + str.tostring(open))
else
label.set_text(EOPLB, " 09:30 ")
label.set_tooltip(EOPLB, "Equities Opening Price")
else
if ShowPrices == true
label.set_text(EOPLB, " Equities Opening Price | " + str.tostring(open))
else
label.set_text(EOPLB, " Equities Opening Price ")
label.set_tooltip(EOPLB, "")
label.set_textcolor(EOPLB, LabelTextColor)
label.set_size(EOPLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(EOPLN, Terminus(Terminusinp))
label.set_x(EOPLB, Terminus(Terminusinp))
// Afternoon Opening Price Line
if (ShowAFTPP and (time == AfternoonOpenTime) and DOM)
label.delete(AFTLB )
if ShowPrev == false
line.delete(AFTLN )
AFTLN := line.new(x1=AfternoonOpenTime, y1=open, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=open, color=AFTOPColP, style=AFTOPLSS, width=AFTOPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(AFTLN, EquitiesOpenTime+225000000)
if ShowLabel
AFTLB := label.new(x=EquitiesOpenTime+52200000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=AFTOPColP, style=label.style_label_left, size=LabelSize, tooltip="Equities Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(AFTLB, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(AFTLB, " 01:30 | " + str.tostring(open))
else
label.set_text(AFTLB, " 01:30 ")
label.set_tooltip(AFTLB, " Afternoon Opening Price")
else
if ShowPrices == true
label.set_text(AFTLB, " Afternoon Opening Price | " + str.tostring(open))
else
label.set_text(AFTLB, " Afternoon Opening Price ")
label.set_tooltip(AFTLB, "")
label.set_textcolor(AFTLB, LabelTextColor)
label.set_size(AFTLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(AFTLN, Terminus(Terminusinp))
label.set_x(AFTLB, Terminus(Terminusinp))
// HTF Variables
var Weekly_open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=i_WeekOpenCol, style=WeekOpenLS, width=1)
var Weekly_openlbl = label.new(x=na, y=na, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize)
var WeeklyOpenTime = time
var Monthly_open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=i_MonthOpenCol, style=MonthOpenLS, width=1)
var Monthly_openlbl = label.new(x=na, y=na, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize)
var MonthlyOpenTime = time
// Get HTF Price levels
WeeklyOpen = request.security(syminfo.tickerid, "W", open, lookahead = barmerge.lookahead_on)
MonthlyOpen = request.security(syminfo.tickerid, "M", open, lookahead = barmerge.lookahead_on)
// Weekly Open
if newWeek
WeeklyOpenTime := time
if ShowWeekOpen and newDay and Last4Weeks
label.delete(Weekly_openlbl )
line.delete(Weekly_open )
// if ShowPrev == false
// line.delete(Weekly_open )
Weekly_open:= line.new(x1=WeeklyOpenTime-25200000, y1=WeeklyOpen, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=WeeklyOpen, color=i_WeekOpenCol, style=WeekOpenLS, width=WEEKOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(Weekly_open, EquitiesOpenTime+225000000)
if ShowLabel
Weekly_openlbl := label.new(x=EquitiesOpenTime+52200000, y=WeeklyOpen, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize, tooltip="Weekly Open: " + str.tostring(WeeklyOpen))
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(Weekly_openlbl, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(Weekly_openlbl," W.O. | " + str.tostring(WeeklyOpen))
else
label.set_text(Weekly_openlbl," W.O. ")
label.set_tooltip(Weekly_openlbl, " Weekly Opening Price ")
else
if ShowPrices == true
label.set_text(Weekly_openlbl," Weekly Open | " + str.tostring(WeeklyOpen))
else
label.set_text(Weekly_openlbl," Weekly Open ")
label.set_tooltip(Weekly_openlbl, "")
label.set_textcolor(Weekly_openlbl, LabelTextColor)
label.set_size(Weekly_openlbl, LabelSize)
if timeframe.multiplier > 60
line.set_x2(Weekly_open, AsianEndTime + 232000000)
label.set_x(Weekly_openlbl, AsianEndTime + 232000000)
if timeframe.period == "D"
line.set_x2(Weekly_open, AsianEndTime + 832000000)
label.set_x(Weekly_openlbl, AsianEndTime + 832000000)
if timeframe.period == "M"
line.delete(Weekly_open)
label.delete(Weekly_openlbl)
if Terminusinp != "Terminus @ Next Midnight" and DOM
line.set_x2(Weekly_open, Terminus(Terminusinp))
label.set_x(Weekly_openlbl, Terminus(Terminusinp))
// Monthly Open
if newMonth
MonthlyOpenTime := time
if showMonthOpen and newDay
line.delete(Monthly_open )
label.delete(Monthly_openlbl )
Monthly_open:= line.new(x1=MonthlyOpenTime, y1=MonthlyOpen, x2=AsianEndTime, xloc=xloc.bar_time, y2=MonthlyOpen, color=i_MonthOpenCol, style=MonthOpenLS, width=MONTHOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(Monthly_open, EquitiesOpenTime+225000000)
if ShowLabel
Monthly_openlbl := label.new(x=AsianEndTime, y=MonthlyOpen, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize, tooltip="Monthly Open: " + str.tostring(MonthlyOpen))
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(Monthly_openlbl, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(Monthly_openlbl," M.O. | " + str.tostring(MonthlyOpen))
else
label.set_text(Monthly_openlbl," M.O. ")
label.set_tooltip(Monthly_openlbl, " Monthly Opening Price ")
else
if ShowPrices == true
label.set_text(Monthly_openlbl, " Monthly Open | " + str.tostring(MonthlyOpen))
else
label.set_text(Monthly_openlbl, " Monthly Open ")
label.set_tooltip(Monthly_openlbl, "")
label.set_textcolor(Monthly_openlbl, LabelTextColor)
label.set_size(Monthly_openlbl, LabelSize)
if timeframe.multiplier > 60
line.set_x2(Monthly_open, AsianEndTime + 232000000)
label.set_x(Monthly_openlbl, AsianEndTime + 232000000)
if timeframe.period == "D"
line.set_x2(Monthly_open, AsianEndTime + 832000000)
label.set_x(Monthly_openlbl, AsianEndTime + 832000000)
if timeframe.period == "W"
line.set_x2(Monthly_open, AsianEndTime + 2592000000)
label.set_x(Monthly_openlbl, AsianEndTime + 2592000000)
if timeframe.period == "M"
line.delete(Monthly_open)
label.delete(Monthly_openlbl)
if Terminusinp != "Terminus @ Next Midnight" and DOM
line.set_x2(Monthly_open, Terminus(Terminusinp))
label.set_x(Monthly_openlbl, Terminus(Terminusinp))
// CBDR Stuff
var float cbdr_hi = na
var float cbdr_lo = na
var float cbdr_diff = na
var box cbdrbox = na
var line cbdr_hi_line = na
var line cbdr_lo_line = na
var line dev01negline = na
var line dev02negline = na
var line dev03negline = na
var line dev04negline = na
var line dev01posline = na
var line dev02posline = na
var line dev03posline = na
var line dev04posline = na
if SessionBegins(CBDR) and DOM
cbdr_hi := high
cbdr_lo := low
cbdr_diff := cbdr_hi - cbdr_lo
if ShowTSO
box.delete(cbdrbox )
line.delete(dev01posline )
line.delete(dev01negline )
line.delete(dev02posline )
line.delete(dev02negline )
line.delete(dev03posline )
line.delete(dev03negline )
line.delete(dev04posline )
line.delete(dev04negline )
if ShowCBDR
cbdrbox := box.new(cbdrOpenTime, cbdr_hi, cbdrEndTime, cbdr_lo, color.new(CBDRBoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(CBDRBoxCol,90), txt0, size.auto, color.new(box_text_cbdr_col,80), text_wrap=text.wrap_auto)
if dayofweek == dayofweek.friday
box.set_right(cbdrbox, cbdrOpenTime+187200000)
line.set_x2(cbdr_hi_line, cbdrOpenTime+187200000)
line.set_x2(cbdr_lo_line, cbdrOpenTime+187200000)
if box_text_cbdr == false
box.set_text(cbdrbox, "")
if ShowDev and ShowCBDR and bool_cbdr_dev
for i = 1 to DevCount by 1
if i == 1
dev01posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_hi + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev01posline, cbdrOpenTime+187200000)
line.set_x2(dev01negline, cbdrOpenTime+187200000)
if i == 2
dev02posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev02posline, cbdrOpenTime+187200000)
line.set_x2(dev02negline, cbdrOpenTime+187200000)
if i == 3
dev03posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev03posline, cbdrOpenTime+187200000)
line.set_x2(dev03negline, cbdrOpenTime+187200000)
if i == 4
dev04posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev04posline, cbdrOpenTime+187200000)
line.set_x2(dev04negline, cbdrOpenTime+187200000)
else if CBDRTime
cbdr_hi := math.max(high, cbdr_hi)
cbdr_lo := math.min(low, cbdr_lo)
cbdr_diff := cbdr_hi - cbdr_lo
for i = 1 to DevCount by 1
if i == 1 and ShowDev
line.set_y1(dev01posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev01posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev01negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev01negline, cbdr_lo - cbdr_diff * i)
if i == 2 and ShowDev
line.set_y1(dev02posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev02posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev02negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev02negline, cbdr_lo - cbdr_diff * i)
if i == 3 and ShowDev
line.set_y1(dev03posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev03posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev03negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev03negline, cbdr_lo - cbdr_diff * i)
if i == 4 and ShowDev
line.set_y1(dev04posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev04posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev04negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev04negline, cbdr_lo - cbdr_diff * i)
if (cbdr_hi > cbdr_hi )
if ShowCBDR
box.set_top(cbdrbox, cbdr_hi)
if (cbdr_lo < cbdr_lo )
if ShowCBDR
box.set_bottom(cbdrbox, cbdr_lo)
if DevDirection == "Upside Only"
line.delete(dev01negline)
line.delete(dev02negline)
line.delete(dev03negline)
line.delete(dev04negline)
else if DevDirection == "Downside Only"
line.delete(dev01posline)
line.delete(dev02posline)
line.delete(dev03posline)
line.delete(dev04posline)
// ASIA Stuff
var float asia_hi = na
var float asia_lo = na
var float asia_diff = na
var box asia_box = na
var line asia_hi_line = na
var line asia_lo_line = na
var line dev01negline_asia = na
var line dev02negline_asia = na
var line dev03negline_asia = na
var line dev04negline_asia = na
var line dev01posline_asia = na
var line dev02posline_asia = na
var line dev03posline_asia = na
var line dev04posline_asia = na
if SessionBegins(ASIA) and DOM
asia_hi := high
asia_lo := low
asia_diff := asia_hi - asia_lo
if ShowTSO
box.delete(asia_box )
line.delete(dev01posline_asia )
line.delete(dev01negline_asia )
line.delete(dev02posline_asia )
line.delete(dev02negline_asia )
line.delete(dev03posline_asia )
line.delete(dev03negline_asia )
line.delete(dev04posline_asia )
line.delete(dev04negline_asia )
if ShowASIA
asia_box := box.new(asiaOpenTime, asia_hi, asiaEndTime, asia_lo, color.new(ASIABoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(ASIABoxCol,90), txt1, size.auto, color.new(box_text_asia_col,80), text_wrap=text.wrap_auto)
if box_text_asia == false
box.set_text(asia_box, "")
if ShowDev and ShowASIA and bool_asia_dev
for i = 1 to DevCount by 1
if i == 1
dev01posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_hi + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 2
dev02posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 3
dev03posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 4
dev04posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
else if ASIATime
asia_hi := math.max(high, asia_hi)
asia_lo := math.min(low, asia_lo)
asia_diff := asia_hi - asia_lo
for i = 1 to DevCount by 1
if i == 1 and ShowDev
line.set_y1(dev01posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev01posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev01negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev01negline_asia, asia_lo - asia_diff * i)
if i == 2 and ShowDev
line.set_y1(dev02posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev02posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev02negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev02negline_asia, asia_lo - asia_diff * i)
if i == 3 and ShowDev
line.set_y1(dev03posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev03posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev03negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev03negline_asia, asia_lo - asia_diff * i)
if i == 4 and ShowDev
line.set_y1(dev04posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev04posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev04negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev04negline_asia, asia_lo - asia_diff * i)
if (asia_hi > asia_hi )
box.set_top(asia_box, asia_hi)
if (asia_lo < asia_lo )
box.set_bottom(asia_box, asia_lo)
if DevDirection == "Upside Only"
line.delete(dev01negline_asia)
line.delete(dev02negline_asia)
line.delete(dev03negline_asia)
line.delete(dev04negline_asia)
else if DevDirection == "Downside Only"
line.delete(dev01posline_asia)
line.delete(dev02posline_asia)
line.delete(dev03posline_asia)
line.delete(dev04posline_asia)
// FLOUT Stuff
var float flout_hi = na
var float flout_lo = na
var float flout_diff = na
var box floutbox = na
var line flout_hi_line = na
var line flout_lo_line = na
var line dev01negline_flout = na
var line dev02negline_flout = na
var line dev03negline_flout = na
var line dev04negline_flout = na
var line dev01posline_flout = na
var line dev02posline_flout = na
var line dev03posline_flout = na
var line dev04posline_flout = na
if SessionBegins(FLOUT) and DOM
flout_hi := high
flout_lo := low
flout_diff := flout_hi - flout_lo
if ShowTSO
box.delete(floutbox )
line.delete(dev01posline_flout )
line.delete(dev01negline_flout )
line.delete(dev02posline_flout )
line.delete(dev02negline_flout )
line.delete(dev03posline_flout )
line.delete(dev03negline_flout )
line.delete(dev04posline_flout )
line.delete(dev04negline_flout )
if ShowFLOUT
floutbox := box.new(floutOpenTime, flout_hi, floutEndTime, flout_lo, color.new(FLOUTBoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(FLOUTBoxCol,90), txt7, size.auto, color.new(box_text_flout_col,80), text_wrap=text.wrap_auto)
if dayofweek == dayofweek.friday
box.set_right(floutbox, floutOpenTime+201600000)
line.set_x2(flout_hi_line, floutOpenTime+201600000)
line.set_x2(flout_lo_line, floutOpenTime+201600000)
if box_text_cbdr == false
box.set_text(floutbox, "")
if ShowDev and ShowFLOUT and bool_flout_dev
for i = 0.5 to DevCount by 0.5
if i == 0.5
dev01posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_hi + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev01posline_flout, floutOpenTime+201600000)
line.set_x2(dev01negline_flout, floutOpenTime+201600000)
if i == 1
dev02posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev02posline_flout, floutOpenTime+201600000)
line.set_x2(dev02negline_flout, floutOpenTime+201600000)
if i == 1.5
dev03posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev03posline_flout, floutOpenTime+201600000)
line.set_x2(dev03negline_flout, floutOpenTime+201600000)
if i == 2
dev04posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev04posline_flout, floutOpenTime+201600000)
line.set_x2(dev04negline_flout, floutOpenTime+201600000)
else if FLOUTTime
flout_hi := math.max(high, flout_hi)
flout_lo := math.min(low, flout_lo)
flout_diff := flout_hi - flout_lo
for i = 0.5 to DevCount by 0.5
if i == 0.5 and ShowDev
line.set_y1(dev01posline_flout, flout_hi + flout_diff * i)
line.set_y2(dev01posline_flout, flout_hi + flout_diff * i)
line.set_y1(dev01negline_flout, flout_lo - flout_diff * i)
line.set_y2(dev01negline_flout, flout_lo - flout_diff * i)
if i == 1 and ShowDev
line.set_y1(dev02posline_flout, flout_hi + flout_diff * i)
line.set_y
Momentum and Momentum ChangeThis is a simple script, showing a line for the 14-day momentum (changes in price) along with a histogram that displays the change in momentum (an indicator of price acceleration).
Quarterly Earnings
Easy to access fundamentals of a company on the chart.
EPS and Sales data of post quarters
Multi-Timeframe Resonance v2.0📌 Multi-Timeframe Resonance System — Identify trend, range, and turning points at a glance
✨ Core Advantages:
🔹 Multi-timeframe resonance analysis: Detects trend direction and range across timeframes. Helps identify M tops, W bottoms, consolidation turning points, and trend switches.
🔹 Clear phase visualization: Highlights trend momentum (green) and consolidation zones (red).
🔹 Universally compatible: Works on stocks/ETFs, futures/commodities, forex, gold, crypto — parameter tuning is the only requirement.
🎯 Target Users:
✅ Traders needing fast structure analysis
✅ Trend-followers, swing traders, or range-arbitrageurs
✅ Multi-timeframe analysts & volume researchers
✅ Quant teams seeking stable signal output
📈 Market Structure Evolution Sequence:
**Same-Bear → Small Box Bull → Medium Box Bull → Large Box Bull → Same-Bull → Small Box Bear → Medium Box Bear → Large Box Bear → Same-Bear**
- “Same-Bear”/“Same-Bull”: full agreement among timeframes,strongest trend stages.
- “Small/Medium/Large Box”: represent increasing-level consolidations indicating trend emergence or turn.
🔍 By identifying the current structure phase, traders can determine if:
- The market is in the **early trend stage** (Same-Bull/Same-Bear)
- Or in a **trend shift period** (Bear→Bull or Bull→Bear)
- Or still **oscillating** (structures switching)
⚠️ **Practical Note:**
Although structure usually follows the sequence above, in strong or volatile moves it may:
- **Skip steps** (e.g., Same-Bear → Large Box Bull)
- **Switch rapidly** within a few candles
Traders should use volume, candle patterns, and higher-timeframe trends to confirm valid structure changes or avoid false breakouts.
📌 Execution Logic:
This indicator applies **multi-timeframe resonance** to capture **trend pullbacks**:
- Identifies trend direction via higher timeframes
- Uses pullback in shorter timeframe to signal entry
- Executes trend-following trades at pullback points
- Protects with structured stop-loss based on higher timeframe structure
🔒 This is a protected script. For access details, please see the Author’s Instructions.
📌 多周期共振识别系统 — 趋势、震荡与拐点,一目了然
✨ 核心优势:
🔹 多周期共振分析:同时检测多个周期的趋势方向与震荡结构,辅助识别 M 顶 / W 底 / 震荡拐点 / 趋势转换等关键信号。
🔹 趋势与震荡清晰可视:自动高亮趋势推进(绿色)与震荡盘整(红色)区域,一眼看清市场节奏。
🔹 全品种通用:适配股票 / ETF、期货 / 商品、外汇 / 黄金、加密货币等市场,仅需轻微参数微调。
🎯 适用人群:
✅ 需要快速识别图表结构的交易者
✅ 趋势跟随者、波段捕捉者、震荡套利者
✅ 热衷于多周期分析与量能行为研究的交易者
✅ 追求稳定信号输出的量化策略团队
📈 市场结构演变路径:
同空 → 小箱多 → 中箱多 → 大箱多 → 同多 → 小箱空 → 中箱空 → 大箱空 → 同空
“同空” / “同多”:表示多周期趋势完全一致,代表趋势最强阶段
“小箱 / 中箱 / 大箱”:代表不同级别的震荡结构,结构逐步递进,表示趋势正在酝酿或转向
🔍 通过识别当前所处的结构阶段,交易者可以判断:
当前是否处于趋势初期阶段(如同空 / 同多)
是否处于趋势转换区间(如由空转多或由多转空)
或仍处于震荡反复区间(结构频繁切换)
⚠️ 实战提醒:
虽然市场结构通常遵循上述顺序演化,但在强趋势或剧烈波动行情下,可能出现以下情况:
跳跃演化(如从“同空”直接进入“大箱多”阶段)
快速切换(几根K线内连续跳过多个结构)
因此,交易者应结合量能、K线形态及更高周期趋势,判断结构变化是否“有效”或为“假突破”。
📌 执行逻辑:
本指标通过多周期趋势共振确认,捕捉趋势中的回踩机会:
利用高阶周期判断趋势方向
在低阶周期的回踩位置作为进场信号
顺势交易,捕捉主趋势中的低吸 / 高抛机会
止损位置依据上位周期结构确认,明确清晰
🔒 本脚本为受控授权版本,如需获取使用权限,请参阅“作者说明”。
trade bằng mông xu hướng//@description=This TradingView indicator is designed to detect key price structure levels by identifying swing highs and lows on the chart. It automatically labels these points and draws trend zones (ranges) based on confirmed breakouts. The indicator helps traders visualize market structure shifts, determine trend direction (uptrend, downtrend, or neutral), and make more informed trading decisions. It includes customizable settings such as lookback period, label visibility, and zone colors, and supports multi-timeframe analysis for greater flexibility.
Triple CCI Multi-TimeframeIts simple 3 cci with 3 periods and 3 time frames all original settings just for those people who love to work with cci
Universal Trend Predictor//@version=5
indicator("Universal Trend Predictor", overlay=true, max_labels_count=500)
// === INPUTS ===
len_trend = input.int(50, "Trend Length (regression)", minval=10, maxval=200)
len_mom = input.int(14, "Momentum Length", minval=5, maxval=50)
len_vol = input.int(20, "Volume SMA Length", minval=5, maxval=100)
correlation_weight = input.float(0.5, "Correlation Weight (0-1)", minval=0, maxval=1)
// === TREND LINE (Linear Regression) ===
reg = ta.linreg(close, len_trend, 0)
reg_slope = ta.linreg(close, len_trend, 0) - ta.linreg(close, len_trend, 1)
// === MOMENTUM ===
mom = ta.mom(close, len_mom)
// === VOLUME ===
vol_sma = ta.sma(volume, len_vol)
vol_factor = volume / vol_sma
// === CORRELATION ASSETS ===
spx = request.security("SPX", timeframe.period, close)
dxy = request.security("DXY", timeframe.period, close)
xau = request.security("XAUUSD", timeframe.period, close)
// === CORRELATION LOGIC ===
spx_mom = ta.mom(spx, len_mom)
dxy_mom = ta.mom(dxy, len_mom)
xau_mom = ta.mom(xau, len_mom)
// Корреляция: усиливаем сигнал, если BTC и SPX растут, ослабляем если DXY растет
correlation_score = 0.0
correlation_score := (mom > 0 and spx_mom > 0 ? 1 : 0) - (mom > 0 and dxy_mom > 0 ? 1 : 0) + (mom > 0 and xau_mom > 0 ? 0.5 : 0)
correlation_score := correlation_score * correlation_weight
// === SIGNAL LOGIC ===
trend_up = reg_slope > 0
trend_down = reg_slope < 0
strong_mom = math.abs(mom) > ta.stdev(close, len_mom) * 0.5
high_vol = vol_factor > 1
buy_signal = trend_up and mom > 0 and strong_mom and high_vol and correlation_score >= 0
sell_signal = trend_down and mom < 0 and strong_mom and high_vol and correlation_score <= 0
// === ПАРАМЕТРЫ ДЛЯ ПРОГНОЗА ===
months_forward = 3
bars_per_month = timeframe.isintraday ? math.round(30 * 24 * 60 / timeframe.multiplier) :
timeframe.isdaily ? 30 :
timeframe.isweekly ? 4 :
30
bars_forward = math.min(months_forward * bars_per_month, 500) // TradingView лимит
// === ОГРАНИЧЕНИЕ ЧАСТОТЫ СИГНАЛОВ ===
var float last_buy_bar = na
var float last_sell_bar = na
can_buy = na(last_buy_bar) or (bar_index - last_buy_bar >= 15)
can_sell = na(last_sell_bar) or (bar_index - last_sell_bar >= 15)
buy_signal_final = buy_signal and can_buy
sell_signal_final = sell_signal and can_sell
if buy_signal_final
last_buy_bar := bar_index
if sell_signal_final
last_sell_bar := bar_index
// === ВЫДЕЛЕНИЕ СИЛЬНЫХ СИГНАЛОВ ===
strong_signal = strong_mom and math.abs(reg_slope) > ta.stdev(close, len_trend) * 0.5
// === VISUALIZATION ===
// Trend line (основная)
plot(reg, color=trend_up ? color.green : color.red, linewidth=2, title="Trend Line")
// Прогноз трендовой линии вперёд
reg_future = reg + reg_slope * bars_forward
line.new(x1=bar_index, y1=reg, x2=bar_index + bars_forward, y2=reg_future, color=color.new(color.blue, 0), width=2, extend=extend.none)
// Buy/Sell labels
plotshape(buy_signal_final and not strong_signal, style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), size=size.small, text="BUY", title="Buy Signal")
plotshape(buy_signal_final and strong_signal, style=shape.labelup, location=location.belowbar, color=color.new(color.lime, 0), size=size.large, text="BUY", title="Strong Buy Signal")
plotshape(sell_signal_final and not strong_signal, style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), size=size.small, text="SELL", title="Sell Signal")
plotshape(sell_signal_final and strong_signal, style=shape.labeldown, location=location.abovebar, color=color.new(color.fuchsia, 0), size=size.large, text="SELL", title="Strong Sell Signal")
// Trend direction forecast (arrow)
plotarrow(trend_up ? 1 : trend_down ? -1 : na, colorup=color.green, colordown=color.red, offset=0, title="Trend Forecast Arrow")
// === ALERTS ===
alertcondition(buy_signal, title="Buy Alert", message="Universal Trend Predictor: BUY signal!")
alertcondition(sell_signal, title="Sell Alert", message="Universal Trend Predictor: SELL signal!")
// === END ===
NQ31NQ market open 2m range breakout strategy
Retest entry
Entry at Range high or low
SL size equal to Range size
TP 2x range size TP1 and BE
TP2 3x range size
TP3 4x range size
NY time 9:30 1m timeframe
Multi-Timeframe EMA Table (Woche, Tag, 4h, 1h)Title: Multi-Timeframe EMA Table (Weekly, Daily, 4h, 1h)
Description:
This Pine Script indicator provides a concise and clear Multi-Timeframe (MTF) Exponential Moving Average (EMA) analysis directly on your TradingView chart. It displays the EMA values for the 1-hour, 4-hour, 1-day, and 1-week timeframes in a customizable table.
Features:
Clear Table Display: Shows the current EMA values for predefined higher timeframes (1h, 4h, Day, Week).
Dynamic Status: The status column immediately visualizes whether the current price of your chart is above (Green) or below (Red) its respective Multi-Timeframe EMA.
Customizable EMA Length: The length of the EMA can be easily adjusted via the indicator settings, allowing you to tailor it to your preferred analysis.
Visual Confirmation: The corresponding Multi-Timeframe EMA lines are optionally plotted directly on the chart to visually confirm the table values.
Non-Repainting: The displayed EMA values and lines are programmed to be non-repainting, meaning their values do not change on already closed candles.
This indicator is a useful tool for traders who want to quickly get an overview of the EMA's position across different timeframes without constantly switching their chart timeframe. It's ideal for confirming trends and identifying support and resistance levels from a higher perspective.