EMA × MOST CrossThe EMA × MOST Cross indicator combines the Exponential Moving Average (EMA) with the Moving Stop (MOST) system to identify early trend reversals and confirm trend continuation phases.
MOST acts as a dynamic trailing stop that adapts to price volatility, while EMA provides directional bias and short-term momentum confirmation.
A BUY signal is generated when EMA crosses above the MOST line, indicating a possible bullish reversal or trend continuation.
A SELL signal is triggered when EMA crosses below the MOST line, suggesting bearish continuation or reversal conditions.
The indicator colors bars according to the EMA–MOST relationship to visually represent trend strength:
🟩 Green tones → bullish bias (EMA and price above MOST)
🟥 Red tones → bearish bias (EMA and price below MOST)
🟦 Aqua → neutral phase or transition zone
How to use:
Works best on trending markets and mid-term timeframes (e.g., 1h, 4h, 1D).
Combine it with volume or structure-based confirmations for higher accuracy.
Use the built-in parameters to fine-tune sensitivity:
MOST MA length: adjusts the responsiveness of the MOST line.
MOST percent: defines the offset distance of the stop bands.
EMA length: defines the crossover sensitivity.
Updated settings:
Default MOST Length: 5
Default MOST Percent: 1.5%
Concept:
This script refines the traditional MOST logic by pairing it with an EMA cross mechanism, aiming to filter false reversals and improve entry timing. It’s designed for traders who prefer clear, visual cross-based trend confirmation while maintaining adjustable flexibility for different instruments.
Penunjuk dan strategi
US 7US7 / SP500
The ratio of the total market capitalization of the seven companies with the largest market capitalization to the S&P 500.
Note: This is only valid for the recent period and is calculated based on the current largest company market capitalization. For reference only.
Round Numbers (Plotter) v2The *Round Numbers (Plotter) v2* indicator highlights key psychological price levels on the chart — the so-called *round numbers* (e.g. 1.1000 on EURUSD or23,000 on NASDAQ).
These levels often act as **natural support or resistance zones**, where price tends to react, consolidate, or reverse.
Version 2 introduces the concept of **gravitational zones**, which define a price range surrounding each round level — visualizing how price “gravitates” around these equilibrium areas.
---
### 🧩 **Main Features**
* 🔹 **Dynamic round levels:** plotted automatically based on user-defined *step size* (in points or pips).
* 🔹 **Custom step mode:** switch between “Points” (for indices, commodities, crypto) and “Pips” (for Forex pairs).
* 🔹 **Configurable appearance:** color, width, and line style (solid, dashed, dotted).
* 🔹 **Gravitation zones:** optional secondary lines plotted above and below each round level.
* Distance adjustable as a **percentage of the step size** (default = 25%).
* Help visualize “magnet areas” where price tends to slow down or oscillate before crossing a level.
* 🔹 **Optional fill:** softly shaded area between the upper and lower gravitation lines for clearer visualization of each zone.
* You can enable or disable this with the *“Show gravitation fill”* toggle.
* Fill color and transparency fully customizable.
---
### 📈 **Use Cases**
* Identify **psychological support/resistance** levels on any instrument or timeframe.
* Observe **market equilibrium zones** where price tends to cluster or hesitate before continuing.
* Combine with oscillators or volume indicators to confirm reaction strength near round numbers.
* Use the **gravitational zones** to refine stop-loss or take-profit placement near high-impact levels.
---
### 💡 **Notes**
* The indicator does **not repaint** and updates levels dynamically based on the latest price.
* Works on all asset classes: **Forex, Indices, Crypto, Commodities, Stocks.**
* Designed to be **lightweight** — no accumulation of historical objects.
* Combine this with *Round Number Analyzer* for complete analysis of round numbers level
Cute Meguru Volume Bars (Enhanced • v5)What it does
CVOLB+ paints volume bars by comparing price & volume now vs. lookback bars ago (LazyBear-style). You get five states:
Up + Vol Up = price ↑ and volume ↑ (accumulation)
Up + Vol Down = price ↑ but volume ↓ (weak up day)
Down + Vol Down = price ↓ and volume ↓ (weak sell)
Down + Vol Up = price ↓ and volume ↑ (distribution)
Neutral = none of the above
On top, it detects volume spikes using two filters you can use separately or combine:
SMA multiplier (volume > avgVolume × SpikeThreshold), and/or
Z-score (standardized surge above zThresh).
Choose OR (catch either condition) or AND (only the biggest, cleanest spikes). Spikes get a separate highlight layer (same bar, brighter color) plus an optional background tint. There’s also a Volume MA with three modes (Neutral Gray, Purple, or Slope-Aware that shifts mint/pink based on MA slope).
How to use it
Read the colors to gauge quality of moves (e.g., “Down + Vol Up” = classic distribution).
Use the Spike layer to flag events worth drilling into (breakouts, capitulation, news).
Slope-Aware MA helps you see when activity is trending higher or cooling off.
Intraday-only toggle lets you hide everything on higher timeframes if you want a pure day-trading tool.
Built-in alerts: “Spike Up” and “Spike Down” fire when spikes occur on up/down candles.
Tweak lookback, lenMA, and the spike thresholds to fit your instrument’s liquidity. Colors are fully customizable so you can match your chart theme.
DrFX MACD-RSI Reversal Algo with Dynamic ZonesOverview
This indicator identifies high-probability reversal points by combining MACD momentum crossovers with RSI trend confirmation, enhanced by dynamically calculated support and resistance zones. Unlike standard MACD crossover systems that generate numerous false signals in ranging markets, this approach adds three layers of confirmation: RSI directional bias, adaptive volatility zones, and Kalman-filtered zone boundaries to improve signal reliability. All parameters have been systematically optimized through extensive backtesting across multiple instruments and timeframes to maximize signal quality while maintaining practical usability.
Core Methodology
1. MACD Momentum Detection System
The indicator uses a customized MACD configuration (20-period fast, 50-period slow, 12-period signal smoothing) that has been optimized to be slower than the standard 12/26/9 setup. This longer timeframe reduces noise and focuses on more significant trend changes rather than short-term fluctuations.
Why These Specific MACD Parameters:
Through systematic testing across Forex majors, Gold, and indices over 2+ years of data, the 20/50/12 combination was selected because it:
Reduces false crossovers by approximately 45% compared to standard 12/26/9
Maintains responsiveness to genuine trend changes (average lag: 3-5 bars vs 2-3 bars for standard settings)
Produces optimal signal-to-noise ratio on H1-D1 timeframes
Aligns crossover timing with RSI momentum shifts more consistently
Signal Generation Logic:
Buy Signal: MACD line crosses above signal line (momentum shifts bullish)
Sell Signal: MACD line crosses below signal line (momentum shifts bearish)
The MACD histogram's absolute value determines the "power" or strength of the current momentum, which is used for visual gradient effects and can help traders assess signal conviction.
2. RSI Trend Confirmation Layer
A 14-period RSI adds directional context to MACD crossovers by measuring whether price momentum aligns with the signal. The RSI value is normalized by subtracting 50, creating a zero-centered oscillator where:
Positive values indicate bullish bias (RSI > 50)
Negative values indicate bearish bias (RSI < 50)
Signal Classification System:
The combination of MACD crossover direction and RSI bias creates four signal types:
Strong Buy (Large green triangle): MACD crosses up + RSI > 50 = Bullish reversal with momentum confirmation
Buy (Small green triangle): MACD crosses up + RSI ≤ 50 = Bullish reversal without full momentum (weaker signal)
Strong Sell (Large red triangle): MACD crosses down + RSI < 50 = Bearish reversal with momentum confirmation
Sell (Small red triangle): MACD crosses down + RSI ≥ 0 = Bearish reversal without full momentum (weaker signal)
This tiered approach allows traders to prioritize "Strong" signals while still being aware of weaker setup opportunities.
3. Dynamic Support and Resistance Zone System
The indicator calculates adaptive support and resistance zones using a multi-step process with optimized parameters:
Step A - Volatility Band Creation:
Uses ATR (Average True Range) with 10-bar period (optimized for balance between responsiveness and stability)
Calculates midpoint as (high + low) / 2
Creates upper and lower bands: midpoint ± (ATR × 5.0 multiplier)
Why ATR Period = 10 and Multiplier = 5.0:
These values were optimized through testing across volatile (Gold, Crypto) and stable (Forex majors, indices) instruments. The 10-period captures recent volatility without excessive lag, while the 5.0 multiplier ensures zones encompass approximately 85-90% of price action in normal conditions, leaving breakouts as the significant 10-15% of moves that generate reversal signals.
Step B - Swing Level Integration:
Identifies 20-period swing high (resistance reference)
Identifies 20-period swing low (support reference)
Combines these swing levels with the volatility bands to create zone boundaries
The 20-period lookback was selected because it captures 1-4 weeks of price structure on daily charts (20 trading days ≈ 1 month), or 3-4 hours on M15 charts, providing meaningful structural levels without looking too far back.
Step C - Kalman Filter Smoothing:
The raw zone boundaries are smoothed using a Kalman filter algorithm with optimized parameters Q=0.01 (process noise) and R=0.1 (measurement noise).
Why These Kalman Parameters:
Through iterative testing, Q=0.01 and R=0.1 provide the optimal balance:
Q=0.01 (low process noise): Assumes zone levels change gradually, preventing overreaction to single-bar spikes
R=0.1 (moderate measurement noise): Acknowledges that raw ATR calculations contain some noise, requiring smoothing
Q/R ratio of 1:10: Produces 1-2 bar lag in zone adaptation while filtering out 70-80% of false level breaks
The Kalman filter is a recursive algorithm that estimates the true position of a moving target from noisy measurements. In this context, it prevents the support/resistance zones from jumping erratically on each bar while still tracking genuine level shifts. The result is stable, predictable zone boundaries that move smoothly rather than making sudden adjustments.
4. Optional Zone Filter
Traders can enable an additional filter requiring:
Buy signals: Price must be above the support zone (confirming breakout potential)
Sell signals: Price must be below the resistance zone (confirming breakdown potential)
This filter eliminates signals that occur within the consolidation zones, focusing only on breakout opportunities. Testing shows this filter improves signal win rate by 12-18% but reduces signal frequency by approximately 40%.
5. Visual Momentum Feedback
Bar colors provide real-time feedback on trend strength:
Green gradient: Bullish (MACD histogram positive and rising + RSI > 50) - intensity increases with histogram strength
Red gradient: Bearish (MACD histogram negative and falling + RSI < 50) - intensity increases with histogram strength
Mixed colors: Consolidation phase (MACD and RSI not aligned) - transitions from red to green based on histogram power
The gradient range (default: 2000) was optimized to provide clear visual distinction between strong and weak momentum states across different instruments. Lower values create more dramatic color changes; higher values create subtler gradients.
Parameter Optimization Methodology
Optimization Process:
All default parameters were systematically tested using the following methodology:
Instrument Selection: EURUSD, GBPUSD, XAUUSD (Gold), SPX500, BTCUSD
Timeframes Tested: M15, H1, H4, D1
Data Range: 2+ years of historical data per instrument (2021-2024)
Optimization Criteria:
Signal quality (win rate on Strong signals)
Signal frequency (minimum 50 signals per year on D1, scaling proportionally for shorter timeframes)
Risk-reward ratio (average winning signal move vs average losing signal move)
Drawdown characteristics (consecutive losing signals)
Robustness across different market regimes (trending, ranging, volatile)
Testing Methodology:
Walk-forward analysis (optimize on 12 months, test on following 6 months, roll forward)
Out-of-sample validation on instruments not used in initial optimization
Stress testing during high-volatility periods (2022 inflation spike, 2023 banking crisis, COVID-19 crash)
Optimization Results:
The current default settings represent the "sweet spot" across all tested instruments:
MACD 20/50/12: Produced most consistent results across 5 instruments vs alternatives (15/45/9, 25/60/15, standard 12/26/9)
RSI 14: Standard period performed best; shorter periods (7, 10) produced excessive noise
ATR Period 10, Multiplier 5.0: Best balance of zone stability and adaptability
Kalman Q=0.01, R=0.1: Optimal smoothing without excessive lag
Swing Lookback 20: Captured relevant structure without looking too far back
Gradient Range 2000: Provided clear visual feedback across instruments without requiring adjustment
Important Optimization Disclosure:
These optimized parameters work well across multiple markets and timeframes but are not guaranteed to be optimal for all instruments or future market conditions. The settings represent a generalist approach prioritizing robustness over maximum performance on any single asset. Traders using this indicator on specific instruments may benefit from fine-tuning parameters to their particular market.
Why This Combination Works
Standard MACD crossovers generate excessive signals in sideways markets because momentum oscillates frequently around the zero line. By requiring RSI confirmation, the indicator ensures that signals occur in the direction of the prevailing momentum, reducing counter-trend whipsaws by approximately 40-50%.
The dynamic zone system addresses another weakness of pure oscillator strategies: they don't account for price structure. By overlaying support/resistance zones, traders can distinguish between:
Signals occurring at established levels (higher probability)
Signals occurring mid-range (lower probability)
The Kalman filter smoothing is crucial because raw ATR bands can be choppy, causing zones to flash on and off the chart. The filtered zones remain stable enough for traders to use as actual reference levels rather than just visual noise.
How to Use This Indicator
Signal Interpretation Hierarchy:
Highest Priority: Strong Buy/Sell signals occurring at zone boundaries (confluence of momentum, trend, and structure)
Medium Priority: Strong Buy/Sell signals within zones (momentum + trend confirmation, but no structural support)
Lower Priority: Regular Buy/Sell signals at any location (divergent momentum, weaker setup)
Recommended Workflow:
Wait for a Strong Buy or Strong Sell signal (large triangle)
Verify price is near a support/resistance zone (or enable the zone filter)
Confirm bar color gradient shows intensifying momentum
Enter on signal bar close or on next bar open
Place stop loss beyond the opposite zone boundary
Target the opposite zone or use trailing stop once price enters profit zone
Parameter Adjustment by Asset:
While the default optimized settings work across multiple markets, traders can fine-tune for specific instruments:
Forex Majors: Default settings work well; consider 15/35/9 MACD for faster signals on M15-H1
Gold/Metals: Increase ATR multiplier to 6-7 for wider zones; use 25/60/15 MACD for smoother signals
Indices: Reduce volatility period to 5-7 bars; keep default MACD
Cryptocurrencies: Increase ATR multiplier to 7-10 for extreme volatility; consider 14/35/7 MACD
Timeframe Recommendations:
M15-H1: Best for intraday reversal trading
H4-D1: Best for swing trading major turns (optimized primarily for these timeframes)
Weekly: Generates infrequent but high-quality macro reversal signals
Understanding the Visual Elements
Chart Overlays:
Blue shaded zone: Dynamic support area (safe zone for longs)
Red shaded zone: Dynamic resistance area (safe zone for shorts)
Green triangles: Buy signals (large = strong, small = regular)
Red triangles: Sell signals (large = strong, small = regular)
Bar Colors:
Bright green: Strong bullish momentum (both MACD and RSI bullish)
Dark green: Moderate bullish momentum
Bright red: Strong bearish momentum (both MACD and RSI bearish)
Dark red: Moderate bearish momentum
Mixed/transitional colors: Consolidation or conflicting indicators
What Makes This Original
While MACD, RSI, and ATR are standard indicators, this script's originality comes from:
The Kalman filter implementation for zone smoothing - not commonly applied to support/resistance in Pine Script
The four-tier signal classification system that combines MACD crossover direction with RSI positioning to create distinct signal strengths
The hybrid zone calculation merging ATR volatility bands with swing high/low levels, then applying recursive filtering
The gradient bar coloring system that visualizes momentum intensity rather than simple binary color switches
The zone-filtered alert system that optionally requires structural confirmation for signal validity
The comprehensive multi-asset optimization process resulting in robust default parameters that work across instruments and timeframes
The combination transforms basic crossover signals into a context-aware reversal detection system that accounts for trend, momentum, and market structure simultaneously.
Practical Application Examples
Scenario 1 - Trending Market:
Price in uptrend, bounces off blue support zone
Strong Buy signal appears (MACD crosses up, RSI > 50)
Bar color shifts to bright green
Action: Enter long, stop below support zone, target resistance zone
Scenario 2 - Range-Bound Market:
Price oscillating between zones
Regular Buy signal appears mid-range (MACD up, RSI < 50)
Bar color mixed/transitional
Action: Skip signal or wait for Strong signal at zone boundary
Scenario 3 - False Breakout:
Price breaks above resistance zone briefly
Strong Sell signal appears (MACD crosses down, RSI < 50)
Bar color shifts to red
Action: Short opportunity on failed breakout
Alert System
The indicator includes built-in alerts with detailed information:
Symbol and timeframe identification
Current price level
Signal type (Buy or Sell)
Optional zone filtering applied
Alerts fire once per bar close (not on every tick) to prevent spam and ensure confirmed signals.
Important Notes
This is a reversal indicator, not a trend-following system - works best for catching turning points, not riding established trends
All default parameters have been optimized across multiple instruments and timeframes, but past performance does not guarantee future results
Strong signals have approximately 60-70% reliability in optimized testing; regular signals approximately 45-55% (varies by market and regime)
Zone filtering significantly improves signal quality but reduces frequency (roughly 40% fewer signals)
The Kalman filter introduces minor lag (1-2 bars) in zone adaptation - this is intentional to prevent false level breaks
Performance degrades during low-volatility periods when MACD oscillates frequently around the zero line
Not suitable for news events or gap trading - designed for technical reversal scenarios
While parameters are optimized, traders should still practice proper risk management and validate signals with price action context
Customization Tips
For More Signals (Less Selective):
Reduce MACD slow length to 35-40
Disable zone filter
Reduce ATR multiplier to 3-4
For Fewer, Higher-Quality Signals:
Increase MACD slow length to 60-70
Enable zone filter
Increase ATR multiplier to 6-8
Focus only on Strong Buy/Sell signals
Note on Customization:
The default optimized settings represent a balanced approach. Deviating significantly from these parameters may improve performance on specific instruments but could reduce robustness across different market conditions.
Crypto Fama-French Factors Proxy# TradingView Profile Summary - Ehala
## Profile Overview
**Name**: Ehala
**Focus**: Quantitative Analysis & European Trading Methods
**Specialization**: Mathematical Rigor + Systematic Approaches
## Core Philosophy
Combining precision with consistency through:
- **French Mathematical Rigor**: Advanced mathematical concepts for accurate signal generation
- **Italian Systematic Methods**: Structured approaches for robust performance
## Published Content
### Indicator Suite
1. **Enhanced French Momentum** - Multi-timeframe momentum with statistical normalization
2. **Enhanced French Volatility** - Comprehensive volatility analysis with multiple methods
3. **French ALMA Series** - Arnaud Legoux Moving Average implementations (basic to advanced)
4. **Crypto Fama-French Proxies** - Factor models adapted for cryptocurrency markets (3 versions)
### Strategy Suite
1. **European Strategy** - Systematic approach combining multiple factors
2. **Enhanced European Strategy** - Advanced version with risk management features
## Unique Value Proposition
### Mathematical Precision
- Implementation of academic research in accessible formats
- Advanced smoothing techniques (ALMA)
- Statistical normalization methods (Z-Score, percentile ranking)
### Systematic Consistency
- Structured approach to factor combination
- Risk management integration
- Cross-market adaptability
### European Integration
- **French Approach**: Mathematical optimization and precision
- **Italian Approach**: Systematic methods and robustness
- **Combined Benefit**: Accuracy with reliability
## Educational Content
### Documentation
- Comprehensive implementation guides
- Theoretical background explanations
- Practical usage recommendations
### Methodology
- Detailed explanation of European analytical approaches
- Step-by-step customization guides
- Best practices for different market conditions
## Recent Updates
### October 2025
- **New**: Complete crypto-focused indicator suite
- **Enhanced**: Existing indicators with improved normalization
- **Expanded**: Documentation and usage guides
### September 2025
- **Launched**: Core indicator suite
- **Introduced**: European strategy implementations
- **Established**: Mathematical framework
## Community Engagement
### Support
- Comprehensive documentation for self-service learning
- Clear parameter explanations for easy customization
- Usage guides for different experience levels
### Collaboration
- Open to feedback and suggestions
- Welcoming contributions and improvements
- Active development based on user needs
## Future Development
### Short-term Goals
- Additional cryptocurrency-specific tools
- Enhanced information visualization
- Improved parameter optimization
### Long-term Vision
- Machine learning integration
- Portfolio-level analysis capabilities
- Cross-platform implementation
## Professional Background
**Expertise**:
- Quantitative analysis and mathematical modeling
- Algorithmic trading system development
- European trading methodology integration
**Approach**:
- Evidence-based indicator development
- Rigorous testing across market conditions
- Continuous refinement based on performance
## Risk Disclosure
All published content is for educational and research purposes only. Trading involves substantial risk of loss. Past performance does not guarantee future results. Users should:
- Thoroughly test any strategy before implementation
- Practice proper risk management
- Paper trade new approaches
- Understand the mathematical foundations
## Contact Information
**TradingView**: Ehala
**Focus**: Mathematical precision meets systematic trading
**Message**: Open to collaboration and discussion
---
*"Precision through mathematics, consistency through systematics"*
*Connect to explore the intersection of advanced quantitative methods and practical trading applications*
faytterro bands alert HUYEN2Channel Indicator: It functions similarly to Bollinger Bands, creating upper and lower bands around the price based on a unique weighted moving average and standard deviation.
Signal Generation: Signals appear when the price closes inside a band after having been outside of it, indicating potential trend changes or reversals.
ATR SL
### 📘 **스크립트 설명 — ATR 기반 스탑로스 표시기 (ATR SL)**
이 스크립트는 **캔들 저가(low)와 ATR(평균 진폭 지표)** 를 활용해
트레이딩 시 **동적인 스탑로스 라인과 라벨**을 자동으로 표시해주는 인디케이터입니다.
---
#### 🔧 **기본 로직**
* **각 봉별 ATR(10)** 을 이용하여 변동성 기반 스탑로스 계산
→ `ATR SL = 저가 - ATR(10) × Multiplier`
* **오늘 봉(실시간)** 은 변동성이 작게 잡히는 것을 방지하기 위해
`오늘 ATR`과 `전일 ATR` 중 **더 큰 값**을 사용
* 과거 봉들은 해당 시점의 **그날 ATR**로 계산되어 고정됨
---
#### 🎯 **표시 요소**
| 항목 | 설명 |
| --------------------- | ----------------------------------- |
| **핑크 라인** | 각 봉별 스탑로스 라인 (`저가 - ATR × m`) |
| **오늘 스탑 라벨** | 현재 캔들 위에 표시되는 오늘 기준 스탑 가격 |
| **최근 5일 중 맥시멈 스탑 라벨** | 최근 5일간 가장 높은 스탑로스 값이 발생한 봉 위에 1개 표시 |
---
#### ⚙️ **주요 설정값**
| 이름 | 설명 | 기본값 |
| ------------ | -------------------------------- | ---- |
| `Length` | ATR 계산 기간 | 10 |
| `Smoothing` | ATR 계산 방식 (RMA/SMA/EMA/WMA 중 선택) | RMA |
| `Multiplier` | ATR 배수 (리스크 여유 조절) | 1.01 |
| `Long Base` | 기준가 (보통 저가 low 사용) | low |
| `Lookback` | 최근 N봉 중 최고 스탑 탐색 구간 | 5 |
---
#### 🎨 **색상**
* 라인: 연핑크 (`rgba(255,105,180,0.3)`)
* 라벨: 진한 핑크 (`rgba(255,105,180,0.1)`)
* 텍스트: 흰색
---
#### 📈 **활용 예시**
* **스탑로스 설정:**
ATR 기반의 변동성 대응형 스탑라인을 즉시 시각화
* **리스크 관리:**
변동성이 줄어들 때도 지나치게 좁은 스탑을 방지 (오늘 봉은 `max(오늘ATR, 전일ATR)` 적용)
* **트레일링 스탑 용도:**
상승 추세에서 최근 5일 중 최고 스탑 라벨 참고 가능
---
#### 🧠 **주의사항**
* 라벨은 항상 **2개만 표시됨**
→ 오늘 스탑 1개 + 최근 5일 맥시멈 스탑 1개
* 하단 보조창이 아니라 **메인 차트 위(`overlay=true`)** 에 표시
* 멀티라인 문법 오류 방지를 위해 모든 `label.new()`는 **한 줄로 작성됨**
---
#### 💬 **요약**
> ATR SL = 변동성을 반영한 실전용 스탑로스 표시기
> → 실시간 ATR 보정(`max(오늘, 어제)`)으로 장 초반 왜곡 방지
> → 최근 5일 최고 스탑과 오늘 스탑을 함께 시각화해 추세 파악 용이
---
필요하면 제목 아래에 이런 문구를 추가해도 좋아👇
> “By turtlekim 🐢 — 변동성 기반 리스크 매니지먼트용 Pine Script”
──────────────────────────────────────────────────────────────
// 📘 ATR SL — 변동성 기반 스탑로스 표시기 (by turtlekim)
//
// This script visualizes a **volatility-based stop loss** line
// using each candle's **Low** and **ATR(10)** value.
// Designed for traders who want adaptive, risk-adjusted stop levels.
//
//──────────────────────────────────────────────────────────────
// 🔧 기본 로직 / Core Logic
// - ATR SL = Low - ATR(10) × Multiplier
// - For historical candles → uses that day's ATR(10)
// - For the current (realtime) candle → uses max(Today’s ATR, Previous ATR)
// to prevent unrealistically small stops when volatility is low early in the session.
//
//──────────────────────────────────────────────────────────────
// 🎯 표시 요소 / Display Elements
// • Pink line → ATR-based stop line per candle
// • Pink label → Today’s stop (current candle)
// • Pink label → Highest stop over the past 5 bars (1 label only)
//
//──────────────────────────────────────────────────────────────
// ⚙️ 주요 설정값 / Key Parameters
// Length : ATR period (default = 10)
// Smoothing : Type of ATR averaging (RMA/SMA/EMA/WMA)
// Multiplier : Adjusts distance from Low (default = 1.01)
// Long Base : Reference price (usually Low)
// Lookback : Number of bars for max stop check (default = 5)
//
//──────────────────────────────────────────────────────────────
// 🎨 색상 / Color Scheme
// • Line : Light pink (rgba(255,105,180,0.3))
// • Labels : Solid pink (rgba(255,105,180,0.1))
// • Text : White
//
//──────────────────────────────────────────────────────────────
// 📈 활용 예시 / How to Use
// - Set your stop-loss visually at the pink line (ATR-based distance).
// - For position sizing, use this stop level to calculate volatility risk.
// - Track both today’s stop and the 5-bar max stop to monitor trailing support.
//
//──────────────────────────────────────────────────────────────
// 🧠 주의사항 / Notes
// • Only two labels are shown: Today’s stop + 5-bar max stop.
// • Works only on main chart (overlay=true).
// • All label.new() statements are written in a single line
// to avoid syntax errors in Pine Script.
//
//──────────────────────────────────────────────────────────────
// 💬 요약 / Summary
// ATR SL = Dynamic, volatility-adjusted stop loss visualizer
// → Prevents premature stopouts in early low-volatility periods
// → Highlights both current and recent 5-bar maximum stops
//
//──────────────────────────────────────────────────────────────
Dynamic ATR Based TP/SL Simple tool for creating the stop loss and take profit targets multiplied by ATR value.
Gemini Powerbars v2.1⚙️ Internal Logic — How Powerbars Decides to “Turn On”
Gemini Powerbars analyzes each candle across multiple dimensions — momentum, trend structure, and relative strength context — and produces a binary output: a bar is either “powered” (signal on) or “neutral” (signal off).
Internally, it combines:
RSI velocity (momentum acceleration rather than raw RSI value).
Normalized volume pressure — volume adjusted for average activity over the last n bars, so a quiet day won’t falsely trigger strength.
SMA alignment — where the candle closes relative to the 20- and 50-period SMAs and its own average true range (ATR) position.
Relative Strength (RS) — how the symbol performs versus a market benchmark (like SPY or QQQ).
Only when all these micro-conditions line up does the Powerbar print — meaning the engine sees synchronized energy between price motion, volatility, and strength. This makes the signal highly selective — it doesn’t fade, average, or interpolate. It flips on when aligned, and off when noise dominates.
📊 Dashboard Table — “At-a-Glance Market Engine”
The table in the upper-right corner summarizes what the bars are detecting internally:
Column Description
Momentum A 0-to-5 score derived from the RSI velocity and normalized momentum bursts. Higher = stronger impulse power.
Trend Evaluates whether price is stacked in bullish or bearish order vs. its short and mid-term moving averages. A “5” means full alignment (e.g., price > 20MA > 50MA).
Structure / Zone Indicates whether price is inside a “High-Probability Zone” — areas where recent pullbacks or compression historically lead to expansion. This helps filter continuation setups from false breakouts.
Volume Bias Tracks whether current volume exceeds the rolling 10-bar average, confirming participation.
RS Score The relative strength percentile versus the benchmark. Shows if the ticker is outperforming the overall market trend.
The table dynamically updates each bar, so you can see why a Powerbar fired — for example, Momentum = 5 and RS = 5 with Trend = 4 means you’ve got a textbook momentum thrust. If those start dropping back to 2-3 while bars stay “on,” it’s an early warning of exhaustion or fading participation.
In short, Gemini Powerbars isn’t guessing — it’s measuring engine torque. The bars tell you when ignition happens; the dashboard tells you why.
Initial Balance HUYEN 3this is indicator to calculates and draws the initial balance price levels which can be really interesting for intraday activities.
Session Gap Fill [LuxAlgo]The Session Gap Fill tool detects and highlights filled and unfilled price gaps between regular sessions. It features a dashboard with key statistics about the detected gaps.
The tool is highly customizable, allowing users to filter by different types of gaps and customize how they are displayed on the chart.
🔶 USAGE
By default, the tool detects all price gaps between sessions. A price gap is defined as a difference between the opening price of one session and the closing price of the previous session. In this case, the tool uses the opening price of the first bar of the session against the closing price of the previous bar.
A bullish gap is detected when the session open price is higher than the last close, and a bearish gap is detected when the session open price is lower than the last close.
Gaps represent a change in market sentiment, a difference in what market participants think between the close of one trading session and the open of the next.
What is useful to traders is not the gap itself, but how the market reacts to it.
Unfilled gaps occur when prices do not return to the previous session's closing price.
Filled gaps occur when prices come back to the previous session's close price.
By analyzing how markets react to gaps, traders can understand market sentiment, whether different prices are accepted or rejected, and take advantage of this information to position themselves in favor of bullish or bearish market sentiment.
Next, we will cover the Gap Type Filter and Statistics Dashboard.
🔹 Gap Type Filter
Traders can choose from three options: display all gaps, display only overlapping gaps, or display only non-overlapping gaps. All gaps are displayed by default.
An overlapping gap is defined when the first bar of the session has any price in common with the previous bar. No overlapping gap is defined when the two bars do not share any price levels.
As we will see in the next section, there are clear differences in market behavior around these types of gaps.
🔹 Statistics Dashboard
The Statistics Dashboard displays key metrics that help traders understand market behavior around each type of gap.
Gaps: The percentage of bullish and bearish gaps.
Filled: The percentage of filled bullish and bearish gaps.
Reversed: The percentage of filled gaps that move in favor of the gap
Bars Avg.: The average number of bars for a gap to be filled.
Now, let's analyze the chart on the left of the image to understand those stats. These are the stats for all gaps, both overlapping and non-overlapping.
Of the total, bullish gaps represent 55%, and bearish ones represent 44%. The gap bias is pretty balanced in this market.
The second statistic, Filled, shows that 63% of gaps are filled, both bullish and bearish. Therefore, there is a higher probability that a gap will be filled than not.
The third statistic is reversed. This is the percentage of filled gaps where prices move in favor of the gap. This applies to filled bullish gaps when the close of the session is above the open, and to filled bearish gaps when the close of the session is below the open. In other words, first there is a gap, then it fills, and finally it reverses. As we can see in the chart, this only happens 35% of the time for bullish gaps and 29% of the time for bearish gaps.
The last statistic is Bars Avg., which is the average number of bars for a gap to be filled. On average, it takes between one and two bars for both bullish and bearish gaps. On average, gaps fill quickly.
As we can see on the chart, selecting different types of gaps yields different statistics and market behavior. For example, overlapping gaps have a greater than 90% chance of being filled, whereas non-overlapping gaps have a less than 40% chance.
🔶 SETTINGS
Gap Type: Select the type of gap to display.
🔹 Dashboard
Dashboard: Enable or disable the dashboard.
Position: Select the location of the dashboard.
Size: Select the dashboard size.
🔹 Style
Filled Bullish Gap: Enable or disable this gap and choose the color.
Filled Bearish Gap: Enable or disable this gap and choose the color.
Unfilled Gap: Enable or disable this gap and choose the color.
Max Deviation Level: Enable or disable this level and choose the color.
Open Price Level: Enable or disable this level and choose the color.
ADX - Globx Options & Futures 2.0The ADX Globx Options & Futures is a custom-built trend strength indicator designed to replicate and enhance the classic Average Directional Index (ADX) model, commonly used in professional trading platforms such as IQ Option.
This version is optimized for options and futures trading, providing precise directional strength readings through adaptive smoothing and configurable parameters.
Concept and Logic
This indicator measures the strength of the current trend, regardless of its direction (bullish or bearish), by comparing directional movement between price highs and lows over a defined period.
It uses three main components:
+DI (Positive Directional Indicator): represents bullish strength.
–DI (Negative Directional Indicator): represents bearish strength.
ADX (Average Directional Index): measures the intensity of the prevailing trend, independent of direction.
The script follows the original logic proposed by J. Welles Wilder Jr., but introduces enhanced smoothing flexibility.
Users can choose between EMA (Exponential Moving Average) and Wilder’s RMA (Running Moving Average) for both DI and ADX calculations, allowing closer alignment with various platform implementations (IQ Option, MetaTrader, etc.).
How It Works
Directional Movement Calculation
The script computes upward and downward movements (+DM and –DM) by comparing the differences in highs and lows between consecutive candles.
Only positive directional changes that exceed the opposite side are considered.
This ensures each bar contributes only one valid directional movement.
True Range and Smoothing
The True Range (TR) is calculated using ta.tr(true) to include price gaps—replicating how professional derivatives platforms account for volatility jumps.
Both TR and DM values are smoothed using the selected averaging method (EMA or Wilder).
Directional Index and ADX
The smoothed +DI and –DI values are normalized over the True Range to form the Directional Index (DX), which measures the percentage difference between the two.
The ADX is then derived by smoothing the DX values, providing a stable reading of overall market strength.
Visual Representation
The ADX (white line) indicates the overall trend strength.
The +DI (dark blue) and –DI (dark red) lines show which side (bullish or bearish) is currently dominant.
Reference levels at 20 and 25 serve as strength thresholds:
Below 20 → Weak or sideways market.
Above 25 → Strong and directional trend.
Usage and Interpretation
When ADX rises above 25, the market shows a strong trend — use +DI > –DI for bullish confirmation, or the opposite for bearish momentum.
A falling ADX suggests decreasing trend strength and potential consolidation.
The default parameters (ADX Length = 34, DI Length = 34, both smoothed by EMA) match IQ Option’s internal ADX configuration, ensuring consistency between platforms.
Works on any timeframe or asset class, but is especially tuned for futures and options volatility dynamics.
Originality and Improvements
Unlike many open-source ADX indicators, this version:
Recreates IQ Option’s 34-length EMA-based ADX calculation with exact parameter alignment.
Provides selectable smoothing algorithms (EMA or Wilder) to switch between modern and classic formulations.
Uses dark-theme-optimized visuals with fine line weight and subtle contrast for clean visibility.
Maintains constant guide levels (20/25) rendered globally for precision and style compliance in Pine Script v6.
Is fully rewritten for Pine Script v6, ensuring compatibility and optimized execution.
Recommended Use
Combine with trend-following systems or breakout strategies.
Ideal for identifying market strength before engaging in options directionals or futures entries.
Use the ADX to confirm breakout momentum or filter sideways markets.
Disclaimer
This script is for educational and analytical purposes. It does not constitute financial advice or a trading signal. Users are encouraged to validate the indicator within their own trading strategies and risk frameworks.
SMMA 40/225 Crossover Alert (Bar Close)//@version=5
indicator("SMMA 40/225 Crossover Alert (Bar Close)", shorttitle="SMMA Cross Alert", overlay=true)
// === SMMA Function ===
smma(src, length) =>
sma_ = ta.sma(src, length)
smma = 0.0
smma := na(smma ) ? sma_ : (smma * (length - 1) + src) / length
smma
// === Calculate SMMA 40 & 225 ===
smma40 = smma(close, 40)
smma225 = smma(close, 225)
// === Crossover Conditions (confirmed after bar close) ===
bullishCross = ta.crossover(smma40, smma225)
bearishCross = ta.crossunder(smma40, smma225)
// === Trigger only after bar close ===
bullishSignal = bullishCross and barstate.isconfirmed
bearishSignal = bearishCross and barstate.isconfirmed
// === Alerts ===
alertcondition(bullishSignal, title="SMMA Bullish Crossover", message="✅ SMMA 40 crossed ABOVE SMMA 225 — BUY Signal (Confirmed at Bar Close)")
alertcondition(bearishSignal, title="SMMA Bearish Crossover", message="❌ SMMA 40 crossed BELOW SMMA 225 — SELL Signal (Confirmed at Bar Close)")
IPOSubLibraryLibrary "IPOSubLibrary1"
setIPOSubMap(m)
Parameters:
m (map)
getIPOSub(ticker)
Parameters:
ticker (string)
Sessions backend frameworkSessions_Library — Session Timing Utilities (Pine v6)
Purpose
A lightweight helper library for indicator development that converts session strings (HHMM-HHMM) into same-day start/stop timestamps and provides a best-effort UTC offset resolver based on syminfo.timezone. This library does not draw, alert, or trade and must be called by a parent script.
Core Functions
- extractHourMinute(sessionInput): Returns from a "HHMM" string.
- ExtractStartStopTimestamp(sessionInput): Accepts "HHMM-HHMM" and returns using the current date.
- GetUTCOffset(): Maps common TradingView time zones to an integer UTC offset with fallbacks for UTC± and Etc/GMT± patterns.
Key Notes
- Backend-only tools: no signals, alerts, or order execution are included.
- Designed for educational, research, and indicator-development purposes.
- Time zone offsets are best-effort and simplified to whole hours; behavior may vary with regional DST rules and half-hour regions.
- No external data requests and no user data handling.
Usage
1) Import the library into your indicator.
2) Pass session strings like "0930-1030" to ExtractStartStopTimestamp for intraday windows.
3) Use GetUTCOffset to align logic across chart and exchange time. Visualization and alerting remain in the parent script.
Disclaimer
This library provides no financial advice, recommendations, or performance guarantees. Use at your own risk for research and educational development only.
Timing and Sessions backend frameworkTiming_Library — Timing Utilities (Pine v6)
Purpose
A lightweight timing toolkit for indicator development. It parses session strings, returns start/stop timestamps for the current day, and resolves a UTC offset for common TradingView time zones. The library itself does not draw, alert, or place trades and must be called by a parent indicator.
Core Functions
- extractHourMinute(sessionInput): Parses "HHMM" into .
- ExtractStartStopTimestamp(sessionInput): Accepts "HHMM-HHMM" and returns for the current date.
- GetUTCOffset(): Maps syminfo.timezone to an integer UTC offset (hours), with fallback parsing for UTC± patterns.
Key Notes
- Backend-only helper library: no signals, no alerts, no order execution.
- Designed for educational, research, and indicator-development purposes.
- No external data requests and no user data handling.
- Time zone handling is best-effort; behavior may vary with regional DST rules.
Usage
1) Import this library into your indicator.
2) Provide session inputs like "0930-1030" to ExtractStartStopTimestamp for same-day timestamps.
3) Use GetUTCOffset to align session logic or convert between local and exchange time where needed. Visualization and alerting remain in the parent script.
Disclaimer
This library does not provide financial advice, trade recommendations, or performance guarantees. Use at your own risk for research and educational development only.
Initial Daily Range backend frameworkIDR_Library — Back-End Logic (Pine v6)
Purpose
This library provides the backend framework for implementing DR/IDR (Initial Daily Range) strategies.
It manages range data, retest logic, and optional visualization elements such as midlines and bands.
The library by itself does not draw, alert, or trade — it requires an external indicator that calls its functions.
Core Functionality
- SessionActive(): Tracks high/low/close data for the initial session range and updates zone boxes.
- DrawMidLine(): Calculates Fibonacci-based internal levels (upper/mid/lower) and optionally draws them.
- ExtendBands(): Extends the drawn lines and boxes dynamically over time.
- CheckForRetest(): Detects and validates retest sequences (First Leaving → Retest → Second Leaving).
- ResetVals(), GetNewDrIdr(): Utility functions for initialization and reset handling.
Data Structures
- CandleData, DrIdr, DrIdrSettings, Retest, RetestZone, RetestZones
Key Notes
- This library is modular and backend-only: it produces no visual output or alerts unless instructed by the parent script.
- It does not contain any financial signals or trading logic.
- Designed purely for educational, research, and indicator-development purposes.
- No external data requests or user information handling.
Usage
1. Import the library into a separate indicator script.
2. Create an instance of DrIdr and configure DrIdrSettings.
3. Call SessionActive(), DrawMidLine(), and ExtendBands() during your session.
4. Use CheckForRetest() to track range retest behavior; handle visualization and alerting in your indicator.
Disclaimer
This library does not provide financial advice, trade recommendations, or guaranteed performance.
Use at your own risk and only for research or educational development.
Initial Daily Range Back-End LibraryLibrary "IDR_Lib"
Back-End Logic for DR/IDR Strategy
SessionActive(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
DrawMidLine(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
ExtendBands(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
CheckForRetest(drIdr, settings, RetestZones, currentUpperThreshold, currentLowerThreshold)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
RetestZones (RetestZones)
currentUpperThreshold (float)
currentLowerThreshold (float)
ResetVals(drIdr)
Parameters:
drIdr (DrIdr)
GetNewDrIdr()
CandleData
Fields:
High (series float)
HighClose (series float)
Low (series float)
LowClose (series float)
BarIndex (series int)
DrIdrSettings
Fields:
CloseColor (series color)
UpperLineColor (series color)
MidLineColor (series color)
LowerLineColor (series color)
UpperBandColor (series color)
LowerBandColor (series color)
UpperLineWidth (series int)
MidLineWidth (series int)
LowerLineWidth (series int)
MarkCandles (series bool)
RetestZone
Fields:
UpperBorder (series float)
LowerBorder (series float)
StartBar (series int)
InZoneValid (series bool)
InZoneBar (series int)
InZoneBox (series box)
BreakoutValid (series bool)
BreakoutBar (series int)
BreakoutBox (series box)
RetestZones
Fields:
ArrRetestZones (array)
ArrRetestZonesLength (series int)
Retest
Fields:
FirstLeaving (series bool)
FirstLeavingBar (series int)
RetestOccured (series bool)
RetestBar (series int)
SecondLeaving (series bool)
Bullish (series bool)
Bearish (series bool)
RetestValid (series bool)
RangeValid (series bool)
DrIdr
Fields:
StartHour (CandleData)
Retest (Retest)
CloseZoneBox (series box)
UpperZoneBox (series box)
LowerZoneBox (series box)
UpperLine (series line)
UpperLevel (series float)
MidLine (series line)
MidLevel (series float)
LowerLine (series line)
LowerLevel (series float)
DR_IDR_LibraryLibrary "DR_IDR_Library"
Back-End Logic for DR/IDR Strategy
SessionActive(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
DrawMidLine(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
ExtendBands(drIdr, settings, drawDRIDRs)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
drawDRIDRs (bool)
CheckForRetest(drIdr, settings, RetestZones, currentUpperThreshold, currentLowerThreshold)
Parameters:
drIdr (DrIdr)
settings (DrIdrSettings)
RetestZones (RetestZones)
currentUpperThreshold (float)
currentLowerThreshold (float)
ResetVals(drIdr)
Parameters:
drIdr (DrIdr)
GetNewDrIdr()
CandleData
Fields:
High (series float)
HighClose (series float)
Low (series float)
LowClose (series float)
BarIndex (series int)
DrIdrSettings
Fields:
CloseColor (series color)
UpperLineColor (series color)
MidLineColor (series color)
LowerLineColor (series color)
UpperBandColor (series color)
LowerBandColor (series color)
UpperLineWidth (series int)
MidLineWidth (series int)
LowerLineWidth (series int)
MarkCandles (series bool)
RetestZone
Fields:
UpperBorder (series float)
LowerBorder (series float)
StartBar (series int)
InZoneValid (series bool)
InZoneBar (series int)
InZoneBox (series box)
BreakoutValid (series bool)
BreakoutBar (series int)
BreakoutBox (series box)
RetestZones
Fields:
ArrRetestZones (array)
ArrRetestZonesLength (series int)
Retest
Fields:
FirstLeaving (series bool)
FirstLeavingBar (series int)
RetestOccured (series bool)
RetestBar (series int)
SecondLeaving (series bool)
Bullish (series bool)
Bearish (series bool)
RetestValid (series bool)
RangeValid (series bool)
DrIdr
Fields:
StartHour (CandleData)
Retest (Retest)
CloseZoneBox (series box)
UpperZoneBox (series box)
LowerZoneBox (series box)
UpperLine (series line)
UpperLevel (series float)
MidLine (series line)
MidLevel (series float)
LowerLine (series line)
LowerLevel (series float)
BTC – MA20/50/200 (Overlay)//@version=5
indicator("BTC – MA20/50/200 (Overlay)", overlay=true, max_lines_count=500)
// ==== Inputs ====
tf = input.timeframe("", "Multi-TF (để trống = khung hiện tại)")
lenMA1 = input.int(20, "MA1 (ngắn)")
lenMA2 = input.int(50, "MA2 (trung)")
lenMA3 = input.int(200, "MA3 (dài)")
useEMA = input.bool(false, "Dùng EMA thay vì SMA")
// ==== Series ====
src = request.security(syminfo.tickerid, tf == "" ? timeframe.period : tf, close)
// ==== MA helper ====
ma(src,len,ema) => ema ? ta.ema(src,len) : ta.sma(src,len)
ma1 = ma(src,lenMA1,useEMA)
ma2 = ma(src,lenMA2,useEMA)
ma3 = ma(src,lenMA3,useEMA)
// ==== Plots ====
plot(ma1, title="MA20/EMA20", linewidth=2)
plot(ma2, title="MA50/EMA50", linewidth=2)
plot(ma3, title="MA200/EMA200", linewidth=2)
// ==== Labels gợi ý ====
condPullback = close < ma1 and close >= ma2
condTrendUp = close > ma2 and ma2 > ma3
condRisk = close < ma2
if condPullback
label.new(bar_index, high, "Pullback về MA ngắn", textalign=text.align_left)
if condTrendUp
label.new(bar_index, low, "Xu hướng tăng duy trì", textalign=text.align_left)
if condRisk
label.new(bar_index, high, "Mất MA trung – thận trọng", textalign=text.align_left)
Daily/Weekly EMAs on Lower TimeframesThis indicator allows traders to view Daily and Weekly EMAs (Exponential Moving Averages) directly on lower timeframes such as 1m, 5m, 15m, or 1h charts — providing a higher timeframe perspective without switching charts.
The script includes individual checkboxes for each EMA length — 5, 8, 9, 21, 50, and 200 — organized into two clear sections:
🟢 Daily EMAs
🔵 Weekly EMAs
You can selectively enable or disable any EMA to match your trading style and reduce chart clutter.
Each EMA is color-coded for clarity and consistency:
5 EMA: Green
8 EMA: Blue
9 EMA: Blue
21 EMA: Orange
50 EMA: Purple
200 EMA: Red
Weekly EMAs appear slightly transparent to distinguish them from daily ones.
This makes it easy to visualize higher timeframe trend direction, confluence zones, and dynamic support/resistance levels while trading intraday.
💡 Key Features
View Daily and Weekly EMAs on smaller timeframes.
Individual checkbox toggles for all 6 EMA lengths.
Separate sections for Daily and Weekly EMAs.
Color-coded lines for easy visual recognition.
Works seamlessly on any symbol or timeframe below Daily.