Zmienność
Period Range AnalyzerThis indicator analyzes a specific periodic range, which can start from a fixed date or a defined lookback period. It draws percentage levels and colored zones between the highest and lowest price. It also displays a detailed information table, which shows the price's position within the range in "Trend" mode, and the relative strength of currency pairs in "Forex" mode. The current price position is also indicated by a label with a percentage value and the name of the corresponding zone.
User Guide
Calculation Method
This setting determines how the indicator defines the range used for the calculation.
Lookback Period: In this mode, the indicator uses the last N candles (the number can be specified in the "Lookback Period (bars)" field). The range (the highest and lowest price) is "floating," meaning it is recalculated with each new candle based on the last N candles.
Date Based: In this mode, the calculation starts from a fixed date and time you select. The indicator finds the opening price of the start date and continuously tracks the highest and lowest price from that point on. This mode is ideal for measuring performance from a specific event (e.g., start of a week/month/year, news).
Data Handling Note: If you select a date in "Date Based" mode for which no data is available on the current timeframe (e.g., switching to a very low timeframe), the indicator will automatically use the earliest available candle as the starting point. All calculations (Open, Max, Min, Range, Percentage, Change, Trend) are based on this actual start date.
Start Date & Time
This setting is only active in "Date Based" mode.
Here you can specify the fixed starting point for the calculation.
The specified time is in the Exchange timezone.
Important limitation: Due to TradingView platform limits, visual elements (levels, zones) are only drawn for a maximum of 250 candles back. If the set date is older than this, the calculation still applies to the entire period (from the set date), but the drawing only covers the last 250 candles. The table always displays accurate data for the entire period.
When switching to a higher timeframe, the range may restart from a slightly later bar due to TradingView's bar alignment. For best accuracy, set your timeframe first, then select the start date.
Table Mode
This setting controls what data the information table displays.
Trend: This is the default mode, which works on any symbol (stock, index, crypto, etc.). It displays information related to the trend and the range.
Forex: This is a special mode used to measure the strength of currency and crypto pairs. It only works on symbols with exactly 6 characters (e.g., "EURUSD", "BTCUSD"). It treats the first 3 characters as the base currency (e.g., EUR) and the last 3 as the quote currency (e.g., USD). If the symbol does not have 6 characters, the table will automatically display in "Trend" mode.
Trend
This trend determination operates based on the formation order of the high and low within the analyzed range:
Its switch is located in the “Table Additional Rows” menu.
Bullish: Indicated if the low was formed before the high (on different candles). Or if they formed on the same candle, it was a bullish candle.
Bearish: Indicated if the high was formed before the low (on different candles). Or if they formed on the same candle, it was a bearish candle.
Neutral: Indicated if the high and low formed on the same candle, and it was a "doji" candle (close = open).
Upper & Lower Threshold
These settings (Upper Threshold (%) and Lower Threshold (%) in the "Label Coloring" section) primarily determine the state (Bullish/Bearish/Neutral) of the top row of the table.
The logic is not based on the percentage change of the price movement, but on the current price's position within the range, where the bottom of the range is 0% and the top is 100%.
Upper Threshold (%): The percentage level (e.g., 60.0) above which the indicator considers the price position "Bullish" (or "Strong").
Lower Threshold (%): The percentage level (e.g., 40.0) below which the indicator considers the price position "Bearish" (or "Weak").
If the price is between the two (e.g., between 40% and 60%), the signal is Neutral.
Secondary function: These thresholds also control the color of the label next to the price, provided the "Dynamic Label Coloring" option is enabled.
SMC ORB vs Pre-Market SPY/IWMStacks institutional confluences such as Smart Money Concepts, Inner Circle Trading, volatility, and structure.
Plots Premarket high/low and 15 minute Opening range
Plots the first sweep of Premarket high/low and any subsequent orb breaks
SMC ORB vs PM ALPHADesigned to stack institutional confluences such as Smart Money Concepts, Inner Circle Trading, volatility, and market structure.
Plots pre-market high/low and 15 Opening Range.
Plots first sweep of Pre-market high/low as well as orb break/holds.
TP of Previous high/low & SL optional
KD-NewAutoTrade for Future Trading - Heikin Ashi candles The KD-NewAutoTrade strategy is a dynamic trend-following indicator designed for scalping and swing trading across crypto, forex, and index futures. It combines the precision of EMA crossovers, RSI momentum, and ADX trend strength to deliver clear Buy/Sell signals with high reliability.
🔹 Core Logic
EMA Fast & Slow Crossover – Identifies short-term and long-term trend shifts.
RSI Confirmation – Filters out false signals by requiring RSI to cross custom Buy/Sell thresholds.
ADX Filter – Ensures trades only trigger when market trend strength exceeds your chosen ADX minimum.
🔹 Key Features
Visual Buy/Sell triangles directly on the chart.
Customizable inputs for EMA, RSI, and ADX lengths.
Works efficiently on all timeframes and all markets (Crypto, Indices, Stocks, Commodities).
Optional background highlights for active trade zones.
Alert conditions for both BUY and SELL setups – ready to use in automated strategies or alert bots.
🔹 Recommended Usage
Use Heikin Ashi candles
Works best on 1M - 5M timeframes.
Combine with volume or higher-timeframe trend confirmation for stronger signals.
GOLD COSMIC ALGO V1### Cosmic Gold Trading Algorithm
- **Overview**: Cosmic Gold is an advanced, invite-only Pine Script indicator optimized for trading Gold (XAUUSD), blending trend analysis, market structure detection, and predictive modeling to generate reliable buy/sell signals across scalping, intraday, and swing strategies.
- **Key Features**: It identifies market breaks using swing pulses, displays quantum trend states, plots reversal signals near support/resistance, and uses kernel regression for forecasted price moves with dynamic TP/SL levels—helping traders navigate gold's volatility with precision.
- **Performance Considerations**: While backtests show potential for high accuracy in trending markets, results vary by timeframe and conditions; always combine with risk management, as past performance doesn't guarantee future gains.
#### Getting Started
Add the indicator to your TradingView chart for XAUUSD. It overlays directly, showing signals like "BUY"/"SELL" labels, trend channels, session backgrounds, and a targets table. Default settings suit most users, but adjust visuals (e.g., colors) via inputs for personalization.
#### Recommended Usage
- **Timeframes**: Best on 1m to 4h charts for scalping to swings; higher frames reduce noise.
- **Signals**: Enter on MSB breaks or EMA crossovers (▲/▼ shapes), confirmed by quantum state ("TREND RISE/FALL").
- **Risk Management**: Use ATR-based targets (1-4 levels) and predicted RR for TP/SL; limit risk to 1-2% per trade.
- **Alerts**: Set up for bullish/bearish signals, TP/SL hits to automate notifications.
#### Tips for Success
Monitor session overlaps (London/NY highlighted) for high-volume entries. Test on demo accounts first, and watch for reversals near daily levels or Donchian channels. For optimal results, pair with fundamental gold news.
---
Cosmic Gold represents a sophisticated fusion of classical technical indicators and modern predictive analytics, tailored specifically for the dynamic XAUUSD market. This invite-only algorithm integrates multi-layered market structure analysis, quantum-inspired trend detection, reversal pattern recognition, and a kernel-based regression model to forecast price movements, all while visualizing key sessions and levels for enhanced decision-making. Designed for versatility, it supports scalping on minute charts, intraday trades on hourly frames, and swing positions up to 4 hours, adapting to gold's inherent volatility driven by economic factors, geopolitical events, and safe-haven demand.
At the heart of Cosmic Gold lies a dual swing detection system. The primary detectSwings function scans a 30-bar window to identify highs and lows, creating pulse objects that track price breaches. When close crosses these levels, it triggers structure checks classifying moves as "msb" (market structure break) or "bos" (break of structure), plotting "BUY" or "SELL" labels only on MSB events for high-confidence entries. Paralleling this is the quantumSwings mechanism, which similarly detects extrema but categorizes as "break" or "continuation," updating a real-time trend state displayed in a top-right table: "TREND RISE" (bullish, teal), "TREND FALL" (bearish, red), or "NEUTRAL ZONE" (gray). This quantum layer adds a probabilistic overlay, helping filter false breaks in choppy conditions.
Supporting these signals are robust support/resistance visualizations. Donchian Channels (55-period) plot orange upper/lower trend lines, while 24-period borders create red high and blue low barriers. On intraday charts, previous daily highs/lows (green/red lines) provide context, with all levels used for proximity checks in reversal logic. Outside bar reversals (engulfing patterns) near these zones—within one ATR (average true range, 14-period)—trigger small lime/red labels for "Reversal Up/Down," offering counter-trend opportunities. Quantum flags further scan for exhaustion: bull/bear patterns over 30 bars verify local extrema, though not plotted directly, they inform the overall state.
The predictive engine elevates Cosmic Gold beyond traditional indicators. Eight normalized features—ranging from RSI-scaled dump/pump metrics and volatility derivatives to volume oscillators, choppiness index, standard RSI, and EMA-derived trend signals—feed a radial basis function (RBF) kernel regression model. On EMA (50/200) crossovers, it records historical absolute moves and trains on past instances, weighting by feature distance to estimate predictedMove (fractional advance/decline). Win rate calculations derive recommended risk-reward (RR), dynamically setting TP/SL: for bulls, TP at close + (close * predictedMove), SL at close - (close * predictedMove / RR). Signals (▲/▼) fire only above 5-minute frames if predictions are valid, with in-trade tracking alerting on hits. This ML-inspired approach aims to quantify edge, though it requires sufficient history (ideally 100+ trades) and may underperform in unprecedented regimes.
Visual and utility elements enhance usability. A bottom-right table populates on signals with ATR (18-period) scaled targets (1-4 levels, yellow cells) above/below entry, colored green/red for direction. Session backgrounds highlight London (muted blue, 12:30-21:30 IST) and New York (muted green, 18:30-03:30 IST), with dashed vertical lines at starts and solid IST lines at 5 AM (blue) / 5 PM (orange) for timezone awareness. Alerts cover signals, TP/SL, ensuring hands-off monitoring.
In practice, Cosmic Gold's strength lies in its adaptability: in bull markets, quantum "RISE" aligns with EMA upsides for longs; in volatility spikes (e.g., Fed announcements), reversals near channels provide quick scalps. However, limitations include potential repainting on early bars (due to highest/lowest recalculations) and NA predictions on low-volume symbols—mitigated by the volume error check. Backtesting emphasizes realistic settings: modest account sizes, commissions/slippage, and <5% risk per trade align with RR logic. While optimized for gold, testing on correlated assets like silver may yield insights, but always verify with live data.
| Component | Description | Key Parameters | Utility in Trading |
|-----------|-------------|----------------|--------------------|
| Swing Detection | Identifies highs/lows over fixed length for structure breaks. | External Length: 30 bars | Filters entries to confirmed breaks, reducing false signals. |
| Quantum Trend | Parallel swing system updating bullish/bearish/neutral states. | Quantum Period: 30 bars | Provides trend bias; "RISE/FALL" confirms signal direction. |
| Reversal Signals | Engulfing patterns near S/R within ATR. | ATR Length: 14 | Spots counter-trends; ideal for scalps near daily levels. |
| Kernel Regression | RBF model predicts moves from 8 features. | Bandwidth: 5; Features: RSI, volatility, etc. | Forecasts TP/SL; enhances RR for sustainable trading. |
| Visual Aids | Channels, sessions, targets table. | Donchian: 55; Borders: 24 | Contextualizes price; sessions flag high-volume periods. |
| Alerts & Risk | Dynamic TP/SL, win rate tracking. | Safe Duration: 2000 bars max | Automates exits; promotes disciplined risk management. |
This comprehensive design positions Cosmic Gold as a professional tool for gold traders, emphasizing rule-based precision over discretionary guesswork. For access, contact the author via TradingView; note it's invite-only to maintain quality control.
**Key Citations:**
- (tropicalglitz.net)
- (www.cnn.com)
- (www.forbes.com)
- (auronum.co.uk)
- (www.prismaticpowders.com)
- (cosmicgoldmusic.com)
ATM Pulse (Arjo)ATM Pulse (Arjo) — Real-Time ATM Options Sentiment & Trend Strength Indicator
Overview
ATM Pulse (Arjo) is an options analytics and trend overlay tool that automatically detects the At-The-Money (ATM) strike for NIFTY, BANKNIFTY , or any selected stock.
It merges Call–Put Volume Ratio (CPVR) sentiment analysis with a Chandelier Exit trend overlay to help traders visualize both market bias and trend direction in a single chart.
Concepts & Logic
ATM Auto Detection
The script calculates the current ATM strike by rounding the underlying’s price to the nearest strike interval (e.g., 50 for NIFTY, 100 for BANKNIFTY). It then requests live option-chain data for that strike.
Call–Put Volume Ratio (CPVR)
The Call-Put Volume Ratio (CPVR) is calculated as the call volume divided by the put volume.
CPVR > 1.25 → Bullish dominance (Calls stronger)
CPVR < 0.75 → Bearish dominance (Puts stronger)
0.75–1.25 → Neutral sentiment
This ratio helps interpret real-time option-market positioning.
Chandelier Exit Trend Overlay
Using Average True Range (ATR) , the overlay plots dynamic trailing stops and visual trend zones:
🟢 Green: Uptrend continuation zone
🔴 Red: Downtrend continuation zone
A color change signals possible momentum reversal.
Combination of CPVR and Chandelier Exit
CPVR gauges option-market sentiment
Chandelier Exit confirms price-action direction
When both align (e.g., bullish CPVR + green Chandelier zone), it strengthens directional conviction. Divergent readings may signal indecision or early reversals.
How to Use
Open any NIFTY, BANKNIFTY , or stocks chart.
Add ATM Pulse (Arjo) to the chart.
Select your expiry date — the script auto-detects the ATM strike and displays:
C: Call LTP
P: Put LTP
CPVR: Call/Put Volume Ratio label
Watch the Chandelier Exit colors:
🟢 Green = Bullish trend
🔴 Red = Bearish trend
Combine CPVR bias + trend color for confirmation.
If CPVR is above 1.25 and trend color green → More bullish activity (Calls stronger).
If CPVR is below 0.75, and trend color red→ More bearish activity (Puts stronger).
If CPVR is between 0.75 and 1.25 and the trend color is gray/mixed → Neutral
Practical Use Case
The script continuously updates the ATM strike, CPVR , and trend overlay in real time.
It provides a clear visual snapshot of how option volumes align with price momentum , ideal for intraday or short-term directional traders.
Disclaimer
This tool is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading signals.
Happy Trading. ARJO
Range Percentage Analyzer This indicator is a tool for analyzing the market range and trend. It calculates the extent of price movement between a specified starting point and the current price, displaying it as a percentage.
The calculation can be based on a fixed lookback period (e.g., the last 30 candles) or from a fixed start date. It also provides a clear table that shows the general trend in "Trend" mode, and the relative strength of the base and quote currencies of forex pairs (e.g., EURUSD) in "Forex" mode.
User Guide
Calculation Method
This setting determines how the indicator defines the starting point for the calculation.
Lookback Period: In this mode, the indicator uses the last N candles (the number can be specified in the "Lookback Period (bars)" field, maximum 250).
The starting point is "floating," meaning it shifts with each new candle. For example, with a setting of 30, the 30th candle from the current one will always be the starting point.
Date Based: In this mode, the calculation starts from a fixed date and time you select.
This mode is ideal for measuring performance from a specific event (e.g., news, start of a week/month).
Note: If you select a date in "Date Based" mode for which no data is available on the current timeframe (e.g., switching to a very low timeframe), the indicator will automatically use the earliest available candle as the starting point.
Start Date & Time
This setting is only active in "Date Based" mode.
Here you can specify the fixed starting point for the calculation.
The specified time is in the Exchange timezone.
Important limitation: Due to TradingView platform limits, visual elements (box, line) are only drawn for a maximum of 250 candles back.
If the set date is older than this, the calculation still applies to the entire period (from the set date), but the drawing only covers the last 250 candles.
When switching to a higher timeframe, the range may restart from a slightly later bar due to TradingView's bar alignment. For best accuracy, set your timeframe first, then select the start date.
Table Mode
This setting controls what data the information table displays.
Trend: This is the default mode, which works on any symbol (stock, index, crypto, etc.). It displays information related to the trend.
Forex: This is a special mode used to measure the strength of currency pairs.
It only works on symbols with exactly 6 characters (e.g., "EURUSD", "BTCUSD"). It treats the first 3 characters as the base currency (e.g., EUR) and the last 3 as the quote currency (e.g., USD).
If the symbol does not have 6 characters, the table will automatically display in "Trend" mode.
Extremes Trend Row
If this is enabled, the table displays an additional row that determines the trend based on the formation order of the high and low within the analyzed range.
The logic is as follows:
Bullish: Indicated if the low was formed before the high.
(Or if they formed on the same candle, which was a bullish candle).
Bearish: Indicated if the high was formed before the low.
(Or if they formed on the same candle, which was a bearish candle).
Neutral: Indicated if the high and low formed on the same candle, and it was a "doji" candle (close = open).
Upper & Lower Threshold
These settings control the logic for the "Change Trend" and "Forex Display" rows at the top of the table.
They determine when the total percentage change for the entire period is considered "Bullish/Strong", "Bearish/Weak", or "Neutral".
Upper Threshold (%): The percentage value (default 0.1%) above which the indicator considers the change "Bullish/Strong".
Lower Threshold (%): The percentage value (default -0.1%) below which the indicator considers the change "Bearish/Weak".
If the change is between the two, the signal is Neutral.
Directional Strength and Momentum Index█ OVERVIEW
“Directional Strength and Momentum Index” (DSMI) is a technical analysis indicator inspired by DMI, but due to different source data, it produces distinct results. DSMI combines direction measurement, trend strength, and overheat levels into a single index, enhanced with gradient fills, extreme zones, entry signals, candle coloring, and a summary table.
█ CONCEPT
The classic DMI, despite its relatively simple logic, can seem somewhat chaotic due to separate +DI and -DI lines and the need for manual interpretation of their relationships. The DSMI indicator was created to increase clarity and speed up results, consolidating key information into a single index from 0 to 100 that simultaneously:
- Indicates trend direction (bullish/bearish)
- Measures movement strength
- Identifies overheat levels
- Generates ready entry signals
DMI (ADX + +DI / -DI) measures trend direction and strength, but does so based solely on comparing price movements between candles. ADX shows whether the trend is orderly and growing (e.g., above 20–30), but does not assess how dynamic the movement is.
DSMI, on the other hand, takes into account candle size and actual market aggression, thus showing directional momentum — whether the trend has real “fuel” to sustain or accelerate, not just whether it is orderly.
The main calculation difference involves replacing True Range with candle size (high-low) and using directional EMA instead of Wilder smoothing. This allows DSMI to react faster to momentum changes, eliminating delays typical of classic DMI based on TR.
This gives the trader an immediate picture of the market situation without analyzing multiple lines.
█ FEATURES
DSMI Main Line:
- EMA(Directional Index) based on +DS and -DS
- Scale 0–100, smooth color gradient depending on strength
+DS / -DS:
- Positive and Negative Directional Strength
- Gradient fill between lines — more intense with stronger trend
Extreme Zones:
- Default 20 and 80
- Gradient fill outside zones
Trend Strength Levels:
- Weak (<10) → neutral
- Moderate (up to 35)
- Strong (up to 45)
- Overheated (up to 55)
- Extreme (>55)
All levels editable
Entry Signals:
- Activated on crossing entry level (default 20)
Or on direction change when DSMI already ≥ entry level
- Highlighted background (green/red)
Candle Coloring:
- According to current trend
Trend Strength Table:
- Top-right corner
- Shows current strength (WEAK/STRONG etc.) + DSMI value
Alerts:
- DSMI Bullish Entry
- DSMI Bearish Entry
█ HOW TO USE
Add to Chart: Paste code in Pine Editor or find in indicator library.
Settings:
DSMI Parameters:
- DSMI Period → default 20
- Show DSMI Line → on/off
Extreme Zones:
- Lower Level → default 20
- Upper Level → default 80
Trend Strength Levels:
- Weak, Moderate, Strong, Overheated → adjust to strategy
Trend Colors:
- BULLISH → default green
- BEARISH → default red
- NEUTRAL → gray
Entry Signals:
- Show Highlight → on/off
- DSMI Entry Level → default 20
Signal Interpretation:
- DSMI Line: Main strength indicator.
- Gradient between +DS and -DS: Visualizes side dominance.
- Crossing 18 with direction confirmation → entry signal.
- Extreme Zones: Potential reversal or continuation points after correction.
- Table: Quick overview of current trend condition.
█ APPLICATIONS
The indicator works well in:
- Trend-following: Enter on signal, exit on direction change or overheat. When a new trend appears, consider entering a position, preferably with a rising trend strength indicator.
- Scalping/daytrading: Shorter period (7–10), lower entry level.
- Swing/position: Longer period (20–30), higher entry level, extreme zones as filters.
- Noise filtering: Ignores consolidation below “Weak” – increasing value e.g. to 15 highlights consolidation zones, but no signals appear there.
Style Adjustment:
- Aggressive strategies → shorten period and entry level
- Conservative → extend period, raise entry level (25–30), watch “Overheated”
“Weak” level (<10 default) → neutral; increasing it e.g. to 15 gives fewer but higher-quality signals. The Weak zone value controls the level below which no signals appear, and the gradient turns gray (often aligned with consolidation zones).
Combine with:
- Support/resistance levels
- Fair Value Gaps (FVG)
- Volume (Volume Profile, VWAP)
- Other oscillators (RSI, Stochastic)
█ NOTES
- Works on all markets and timeframes.
- Adjust period and levels to instrument volatility.
- Higher entry level → fewer signals, higher quality.
- Neutral color below “Weak” – avoids trading in consolidation.
- Gradient and table enable quick assessment without line analysis.
Williams AD + MA“I’ve added an MA to the Williams Accumulation/Distribution (AD) indicator. You can use it to infer potential trend inflection points and to assess the persistence of the trend.”
Nic RSI + MACD (single pane)📊 SPACE-SAVING COMBINED INDICATOR FOR FREE USERS
This indicator combines RSI and MACD into a single pane, perfect for TradingView users with limited indicator slots. Designed to match the default TradingView styling you're familiar with.
🎯 USE AS A PACKAGE:
For optimal trading analysis, use this indicator together with "Nic SMA 9, SMA 200, 9 count" which displays moving averages and the 9 count on your main chart. Together, these two indicators give you a complete technical analysis setup while staying within the 2-3 indicator limit for free TradingView accounts.
📈 WHAT'S INCLUDED:
✅ RSI (Relative Strength Index) - Top Section:
• Default purple line matching TradingView's built-in RSI
• Reference lines at 30, 50, and 70 levels
• Background shading for overbought (>70) and oversold (<30) zones
• Takes up 55% of the pane for better visibility
• Fully customizable period (default: 14)
✅ MACD (Moving Average Convergence Divergence) - Bottom Section:
• Classic histogram with TradingView's default color scheme:
- Teal/cyan for positive momentum
- Red/pink for negative momentum
• Blue MACD line and orange Signal line
• Clear zero line for easy reference
• Takes up 45% of the pane
• Fully customizable periods (default: 12, 26, 9)
⚙️ CUSTOMIZATION OPTIONS:
• Adjust RSI length and source
• Customize RSI line color
• Adjust MACD fast, slow, and signal periods
• Customize MACD source
• Modify gap size between RSI and MACD sections
💡 WHY USE THIS?
• Saves indicator slots - combines 2 indicators into 1
• Professional appearance matching TradingView defaults
• Clean, uncluttered display
• All the functionality of separate RSI and MACD indicators
• Perfect for traders on free or limited plans
📋 RECOMMENDED SETUP:
1. Add "Nic SMA 9, SMA 200, 9 count" to your main chart (published separately)
2. Add this "Nic RSI top + MACD bottom" indicator
3. Optionally add Volume indicator if you have a slot available
This gives you moving averages, the 9 count, RSI, and MACD - everything you need for comprehensive technical analysis!
🔔 WORKS WITH FREE ACCOUNTS:
Both indicators in the Nic package are designed to maximize your analysis capabilities within TradingView's indicator limits.
#RSI #MACD #TechnicalAnalysis #FreeIndicators #SpaceSaving #CombinedIndicator
Nic SMA 9, SMA 200, 9 count📈 ESSENTIAL TREND & MOMENTUM OVERLAY INDICATOR
This powerful overlay indicator combines moving averages and the 9 count pattern on your main chart, giving you critical trend and reversal signals without cluttering your screen.
🎯 USE AS A PACKAGE:
For optimal trading analysis, use this indicator together with "Nic RSI top + MACD bottom" which combines RSI and MACD into a single pane. Together, these two indicators give you a complete technical analysis setup while staying within the 2-3 indicator limit for free TradingView accounts.
📈 WHAT'S INCLUDED:
✅ SMA 9 (9-day Simple Moving Average):
• Default red line for short-term trend identification
• Fully customizable period and color
• Perfect for identifying quick momentum shifts
✅ SMA 200 (200-day Simple Moving Average):
• Default white line for long-term trend direction
• Fully customizable period and color
• Classic indicator for major support/resistance levels
✅ The 9 Count Pattern:
• Displays numbers 7, 8, and 9 when the pattern completes
• Buy signals (teal/cyan labels) appear below price when downtrend exhausts
• Sell signals (red labels) appear above price when uptrend exhausts
• Helps identify potential trend reversals and exhaustion points
• Only shows the critical final three counts for clarity
• Customizable label colors
⚙️ CUSTOMIZATION OPTIONS:
• Adjust SMA 9 length and color
• Adjust SMA 200 length and color
• Toggle the 9 count display on/off
• Customize buy and sell label colors
• All components can be independently controlled
💡 WHY USE THIS?
• Combines 3 essential tools into one overlay indicator
• Clean chart layout - no separate panes needed
• Classic moving averages you're already familiar with
• Powerful reversal pattern identification
• Perfect for swing trading and position trading
• Saves indicator slots for free account users
📋 RECOMMENDED SETUP:
1. Add this "Nic SMA 9, SMA 200, 9 count" indicator to your main chart
2. Add "Nic RSI top + MACD bottom" indicator (published separately)
3. Optionally add Volume indicator if you have a slot available
This gives you moving averages, the 9 count pattern, RSI, and MACD - everything you need for comprehensive technical analysis!
🔔 WORKS WITH FREE ACCOUNTS:
Both indicators in the Nic package are designed to maximize your analysis capabilities within TradingView's indicator limits.
📊 HOW TO USE:
• When price is above SMA 200, focus on long opportunities
• When price is below SMA 200, focus on short opportunities
• SMA 9 crossovers with SMA 200 signal potential trend changes
• The 9 count appearing suggests the current trend may be exhausting
• Combine with RSI and MACD for confirmation
#MovingAverages #SMA #TrendAnalysis #ReversalPattern #FreeIndicators #TechnicalAnalysis
The Machine – Smart Zones PRO The Machine – Smart Zones PRO
Overview
The Machine – Smart Zones PRO is a multi-component analytical indicator that identifies key market structure zones, trend alignments, and potential confluence areas using a weighted probability model. It’s designed to map price behavior around support and resistance pivots while integrating higher-timeframe trend and volatility data for confirmation.
Core Logic
The indicator combines four analytical modules to generate its visualization and probability metrics:
Trend Analysis
Calculates short-term trend using a moving-average filter (SMA) and ATR-based volatility structure.
Confirms directional bias from a user-selected higher timeframe for multi-timeframe alignment.
Volatility and Confirmation
Detects volume spikes relative to the moving average of volume to confirm activity strength.
Generates bar-confirmed buy/sell signals when local and higher-timeframe trends align with volatility expansion.
Smart Zone Mapping
Uses pivot-based detection on the selected timeframe to locate reaction highs and lows.
Converts those pivots into adaptive “Smart Zones” (highlighted boxes) extended forward in time to represent potential support/resistance regions.
Old zones are automatically cleared to keep the chart optimized.
Confluence Logic
Calculates the proximity of price to existing Smart Zones and scores confluence strength.
When trend, volatility, and zone alignment agree, the system marks a “Buy” or “Sell” confluence marker.
Scoring and Probabilities
Each signal and zone evaluation is expressed as a weighted probability. The model blends four weighted components:
Local trend (wTrend)
Higher-timeframe alignment (wHTF)
Volume confirmation (wVol)
Proximity to Smart Zones (wZone)
These weights produce two probability values — Buy Probability and Sell Probability — that update in real time and can be visualized as continuous plot lines.
Visual Elements
Smart Zones: Dynamic colored boxes marking pivot-based support and resistance regions.
Trendlines: Optional horizontal extensions from local pivots.
Signal Markers: Buy/Sell labels appear only after confirmed bar closes.
Confluence Markers: Triangular symbols when price interacts with significant zones during aligned trend conditions.
Dashboard Panel: Displays the latest signal, probability score, active trend direction, and potential next directional bias.
Use Case
This indicator helps visualize market structure shifts, identify high-probability confluence areas, and monitor how price interacts with statistically significant zones. It can be applied to any timeframe or instrument for structural confirmation or bias observation.
Disclaimer
This script is for technical analysis and educational purposes only. It does not provide trade recommendations or financial advice.
The Machine – Session Map PRO (final)The Machine – Session Map
Overview
The Machine – Session Map is a session-based analytical indicator that divides the trading day into the three main global sessions — Asia, London, and New York — and maps their price behavior using structured logic. It’s designed for traders who study intraday cycles, session liquidity behavior, and inter-session relationships.
Core Logic
The indicator identifies the start and end times of each major trading session based on user-defined session times. For every session, it:
Captures session range by recording the high, low, and close between session start and end.
Stores previous session data and projects key levels (previous session high, low, and midpoint) into the next day as reference support/resistance zones.
Computes pip range and volatility metrics per session to measure strength and expansion.
Determines directional bias by comparing the session’s close relative to its open and prior session range (expansion above or below prior structure defines bias).
Detects accumulation and distribution zones using session overlap logic and range compression/expansion criteria.
Labels session structures with automatic annotations such as “Expansion,” “Retracement,” or “Reversal” when volatility or bias conditions are met.
Visual Elements
Session Boxes: Colored regions that visually segment the chart into the three sessions.
High/Low Lines: Dynamic lines showing real-time session highs and lows as price develops.
Previous Session Levels: Optional projection of previous highs/lows/midpoints as structural zones.
Bias Labels: Text markers summarizing session direction and volatility conditions.
Dashboard Panel: Displays current session time, range in pips, and directional bias summary.
Use Case
This tool is useful for identifying intraday structure shifts, comparing session volatility, and observing how price behaves relative to prior session levels. It can support strategies involving session-based liquidity cycles, accumulation/manipulation/distribution behavior, or time-based confluence.
Disclaimer
This indicator is designed for technical and educational analysis. It does not generate buy/sell signals or provide financial advice.
VWAP Reversion (Sequential Stats + Profit/Loss Points)First time posting. This is my attempt to evaluate the effectiveness of VWAP reversion. I decided to make this an indicator with its own integrated stats.
If you set the session length to lets say 100, but choose a 1 minute timeframe, it will only load as many sessions as the chart will allow for that timeframe. increasing the timeframe will allow you to go back further with more sessions.
I plan to implement more and more as I refine it. I just wanted to get my working copy out into the universe. I'd like to add some method of "scaling in". Perhaps if the price goes further and further away from the original entry, say for each additional std. deviation band further, it could add another entry signal.
My trading journey is just beginning, I've never coded before, and this was made entirely through the fusion of my attempt to communicate the ideas in my head for ChatGPT to turn into code!
Ultimate RSI Suite [BigBeluga]🔵 OVERVIEW
The Ultimate RSI Suite elevates the classic RSI into a full professional trading system.
It combines momentum analysis, advanced divergence detection, volatility-based RSI channels, multi-timeframe signals, deviation tracking, and reversal alerts into one powerful tool.
This is no ordinary RSI — it’s a complete momentum intelligence engine designed to identify trend strength, exhaustion, breakout conditions, and reliable reversal points with high precision.
⚠️ Note:
This suite enhances RSI with MTF dashboards, dynamic channels, deviation logic, and smart alerting — ideal for scalpers, swing traders, and institutional-style trend followers.
🔵 CONCEPTS
Measures market momentum to detect overbought/oversold zones and trend health
Tracks RSI behavior relative to dynamic channels (BB/Keltner/Donchian)
Identifies regular bullish & bearish divergences
Detects deviation moves after divergence to confirm trend continuation or exhaustion
Multi-timeframe RSI conditions reveal higher-timeframe confluence
Reversal triggers confirm early momentum shifts
Overbought/oversold gradients visually highlight exhaustion zones
🔵 FEATURES
Classic + Enhanced RSI with configurable lookback & price source
RSI-Channel System (Bollinger, Keltner, Donchian) for volatility-adaptive trend structure
RSI-Smoothing MA for trend direction filters
RSI Reversal Signals for early trend inflection detection
RSI Reversal Signals Deviation Levels +1 / +2 for advanced continuation confirmation
Overbought/Oversold Gradient Zones at 35/65 or user-defined levels
Divergence Engine for bullish & bearish momentum exhaustion signals
On-Chart Divergence & Signals (full overlay capability)
Divergence Engine Deviation Levels +1 / +2 for advanced continuation confirmation
Multi-Timeframe Dashboard (RSI OB/OS, signals, divergences, channel breaks)
• Hover your mouse over any signal cell to see how many bars ago it was triggered
• Signals automatically expire after 50 bars
Smart Alerts for divergence, reversals, channel breaks, and deviation triggers
🔵 HOW TO USE
Enter long when RSI reverses from oversold & prints bullish divergence or a ▲ signal
Enter short when RSI reverses from overbought & prints bearish divergence or ▼
Use channel breaks to confirm momentum expansions or trend shifts
Look for deviation crosses (+1 / +2) for strong confirmation after divergence
Track MTF table — more timeframe agreement = stronger conviction
Avoid trading against MTF RSI extremes (OB/OS stacked zones)
Combine with market structure or volume-based tools for maximum precision
🔵 ALERTS
Includes full automation suite:
Bullish / Bearish divergence
Reversal signals (▲ / ▼)
Channel breakouts (Up/Down)
Deviation +1 / +2 confirmation triggers
Extra RSI signal deviation alerts for precision continuation reads
Great for automated systems, confirmation models, and high-probability intraday/swing entries.
🔵 CONCLUSION
The Ultimate RSI Suite transforms RSI into a smart momentum-analysis system.
With multi-timeframe logic, dynamic channels, advanced divergence/deviation systems, and powerful visual cues, it offers institutional-grade trend, exhaustion, and reversal detection.
If you rely on RSI, this toolkit provides superior clarity, deeper context, and stronger execution timing — making it an elite upgrade for professional traders.
Płatny skrypt
NSR - Dynamic Linear Regression ChannelOverview
The NSR - Dynamic Linear Regression Channel is a powerful overlay indicator that plots a dynamic regression-based channel around price action. Unlike static channels, this tool continuously recalculates the linear regression trendline from a user-defined starting point and builds upper and lower boundaries using a combination of standard deviation and maximum price deviations (highs/lows).
It visually separates "Premium" (overvalued) and "Discount" (undervalued) zones relative to the regression trend — ideal for mean-reversion, breakout, or trend-following strategies.
Key Features
Dynamic Regression Line Calculates slope, intercept, and average using full lookback from a reset point.
Adaptive Channel Width Combines standard deviation of residuals with max high/low deviations for robust boundaries.
Auto-Reset on Breakout Channel resets when price closes beyond upper/lower band twice in direction of trend .
Visual Zones Blue shaded = Premium (resistance zone)
Red shaded = Discount (support zone)
Real-Time Updates Live channel extends with each bar; historical channels preserved on reset.
How It Works
Regression Calculation
Uses all bars since last reset to compute the best-fit line:
y = intercept + slope × bar_position
Deviation Bands
Statistical : Standard deviation of price from regression line
Structural : Maximum distance from highs to line (upper) and lows to line (lower)
Final band = Regression Line ± (Deviation Input × StdDev)
Channel Reset Logic
Resets when:
Price closes above upper band twice in an uptrend (slope > 0)
OR closes below lower band twice in a downtrend (slope < 0)
Prevents overextension and adapts to new trends.
Visual Output
Active channel updates in real-time
Completed channels saved as historical reference (up to 500 lines/boxes)
Input Parameters
Deviation (2.0) - Multiplier for standard deviation to set channel width
Premium Color - blue color for upper (resistance) zone
Discount Color - red color for lower (support) zone
Best Use Cases
Mean Reversion - Buy near lower band in uptrend, sell near upper band
Breakout Trading - Enter on confirmed close beyond band + volume
Trend Confirmation - Use slope direction + price position in channel
Stop Loss / Take Profit - Place stops beyond opposite band
Pro Tips
Use on higher timeframes (4H, Daily) for cleaner regression fits
Combine with volume or momentum to filter false breakouts
Lower Deviation (e.g., 1.5) for tighter, more responsive channels
Watch channel resets — they often mark significant trend shifts
Why Use DLRC?
"Most channels are static. This one evolves with the market."
The NSR-DLRC gives you a mathematically sound, visually intuitive way to see:
Where price should be (regression)
Where it has been (deviation extremes)
When the trend is breaking structure
Perfect for traders who want regression-based precision without rigid assumptions.
Add to chart → Watch price dance within the evolving trend corridor.
MIG and MC 发布简介(中文)
MIG and MC 指标帮助日内交易者快速识别微型缺口(Micro Gap)与微型通道(Micro Channel)。脚本支持过滤开盘跳空、合并连续缺口,并自动绘制
FPL(Fair Price Line)延伸线,既可追踪缺口是否被填补,也能直观标注潜在的趋势结构。为了确保跨周期一致性,最新版本对开盘前后和跨日场景做了专门处理
主要特性
- 自动检测并显示看涨/看跌微型缺口,支持按需合并连续缺口。
- 自定义是否忽略开盘缺口、缺口显示范围与 FPL 样式。
- FPL 触及后即停止延伸,辅助研判缺口是否真正回补。
- 内置强收盘与缺口过滤的微型通道识别,可选多种严格程度。
- 适用于 1/5/9 分钟等日内周期,也适用于更长周期。
Recommended English Description
The MIG and MC indicator highlights Micro Gaps and Micro Channels so you can track true intraday imbalances without noise. It merges
consecutive gaps, projects Fair Price Lines (FPL) that stop once touched, and offers a full intraday-ready opening-gap filter so your
early bars stay clean. The latest update refines cross-session handling, giving reliable gap plots on 1-, 5-, and 9-minute charts as well as higher time frames.
Key Features
- Detects bullish and bearish micro gaps with optional gap merging.
- Toggle opening-gap filters and configure look back, visibility, and FPL style.
- FPL lines stop as soon as price revisits the gap, making gap closure obvious.
- Micro Channel mode uses strong-close and gap filters to mark high-quality trend legs.
- Consistent behavior across intraday and higher time frames.
Kalman Adaptive Score Overlay [BackQuant]Kalman Adaptive Score Overlay
A powerful indicator that uses adaptive scoring to assess market conditions and trends, utilizing advanced filtering techniques to smooth price data, enhance trend-following precision, and predict future price movements based on past data. It is ideal for traders who need a dynamic and responsive trend analysis tool that adjusts to market fluctuations.
What is Adaptive Scoring?
Adaptive scoring is a technique that adjusts the weight or importance of certain price movements over time based on an ongoing assessment of market behavior. This indicator uses dynamic scoring to assess the strength and direction of price movements, providing insight into whether a trend is likely to continue or reverse. The score is recalculated continuously to reflect the most up-to-date market conditions, offering a responsive approach to trend-following.
How It Works
The core of this indicator is built on advanced filtering methods that smooth price data, adjusting the response to recent price changes. The filtering mechanism incorporates a Kalman filter to reduce noise and improve the accuracy of price signals. Combined with adaptive scoring, this creates a robust framework that automatically adjusts to both short-term fluctuations and long-term trends.
The indicator also uses a dynamic trend-following component that updates its analysis based on the direction of the market, with the option to visualize it through colored candles. When a strong trend is identified, the candles are painted to reflect the prevailing trend, helping traders quickly identify whether the market is in a bullish or bearish state.
Why Adaptive Scoring Is Important
Dynamic Response: Adaptive scoring allows the indicator to respond to changing market conditions. By adjusting its sensitivity to price fluctuations, it ensures that trends are captured accurately, without being overly influenced by short-term noise.
Trend Precision: By combining Kalman filtering with adaptive scoring, the indicator offers a precise and smooth trend-following mechanism. It helps traders stay aligned with the market direction and avoid false signals.
Versatility: The indicator works across multiple timeframes, making it adaptable to different trading strategies, from scalping to long-term trend-following.
Confidence in Market Moves: The adaptive scoring component provides traders with confidence in the strength of the trend, helping them determine when to enter or exit positions with greater certainty.
How Traders Use It
Trend-Following Strategy: Traders can use this indicator to confirm trends and refine their entries and exits. The colored candles and adaptive scoring offer a visual cue of trend strength and direction, making it easier to follow the prevailing market movement.
Multi-Timeframe Analysis: The script supports multi-timeframe analysis, allowing traders to analyze trends and scores across different timeframes (e.g., 1m, 5m, 15m, 30m, 1h, 4h, 12h). This is useful for traders who want to confirm trends on both short and long-term charts before making a trade.
Refining Entry Points: By utilizing the adaptive scoring, traders can identify potential entry points where the score indicates a high probability of trend continuation. Higher scores signal stronger trends, guiding decision-making.
Managing Risk: Traders can use the adaptive scoring system to assess trend stability and adjust their risk management strategies accordingly. For example, higher confidence in the trend allows for larger positions, while lower confidence may require smaller, more cautious trades.
Key Features and Benefits
Kalman Filter for Noise Reduction: The Kalman filter helps to smooth out market noise and allows for a clearer understanding of the underlying price movements. This is particularly useful in volatile markets where short-term fluctuations can cloud trend analysis.
Adaptive Scoring for Flexibility: Adaptive scoring ensures that the indicator remains responsive to changing market conditions. It automatically adjusts to the strength of price movements, enabling better detection of trends and reversals.
Visual Trend Signals: The indicator provides visual signals through candle coloring, making it easier to identify whether the market is in a bullish, neutral, or bearish phase.
Multi-Timeframe Display: The indicator’s multi-timeframe feature allows traders to see the trend and adaptive score on different timeframes simultaneously, providing a comprehensive view of the market.
Customizable Settings: Traders can customize the indicator’s settings, such as the filter parameters, scoring thresholds, and visualization options, tailoring it to their specific trading style and strategy.
Why This is Important for Traders
Improved Decision Making: The adaptive nature of the scoring system allows traders to make more informed decisions based on real-time market data, without being influenced by past volatility.
Market Clarity: By smoothing out price movements and scoring trends adaptively, the indicator provides a clearer picture of market behavior, which is essential for effective trend-following and timing entries and exits.
Increased Confidence in Signals: Adaptive scoring ensures that signals are based on the current market structure, reducing the likelihood of false positives. This boosts traders' confidence when acting on signals.
Conclusion
The Kalman Adaptive Score Overlay offers a dynamic and responsive trend-following tool that integrates Kalman filtering with adaptive scoring. By adjusting to market fluctuations in real time, it allows traders to identify and follow trends with greater precision. Whether you are trading on short or long timeframes, this tool helps you stay aligned with market momentum, ensuring that your entries and exits are based on the most up-to-date and reliable data available.
7D Historical Volatility (Regimes + Stats) - ChrrizzyHere’s what that indicator does—at a glance:
### Core idea
It computes **7-day Historical Volatility (HV)** from **daily** log returns (annualized), then shows:
* the **HV line** and its **30-day average**,
* colored **volatility regimes** (Low / Normal / High / Extreme) with thresholds you set,
* a compact **status panel** (top-right, nudged left) with current stats and time-in-zone.
### Calculations
* **HV (7D)**: `stdev(log(close/close ), 7) * sqrt(365) * 100`, always from **daily data** via `request.security`, so it’s consistent on any chart timeframe.
* **Regimes** (defaults):
Low < 25% • Normal 25–50% • High 50–70% • Extreme > 70% (all editable).
* **30-day avg**: SMA of HV.
* **Time in zone (% over window)**: SMA of boolean flags (e.g., in Low=1 else 0) over `statsWin` days (default 300).
* **Rolling median HV**: 50th percentile over `statsWin`.
### What you see on the chart
* **HV line** (bold) + **30-day HV** (lighter).
* **Horizontal dashed lines** at your regime thresholds.
* **Background shading** that changes with the current regime (green/blue/orange/red).
### Panel (top-right)
Shows:
* BTC Price (daily close)
* Current HV
* 30-day Avg HV
* Median HV (over window)
* Current **Regime**
* A two-line summary: **% of time spent** in Low / Normal / High / Extreme over the chosen window.
The panel is shifted slightly left using a hidden spacer column; tweak the **“Panel right padding (chars)”** input to move it.
### Alerts (ready to use)
* **HV crossed up Low**
* **HV crossed down Low**
* **HV crossed up High**
* **HV crossed up Extreme**
### Inputs you can tune
* `HV Lookback (days)` (default 7)
* `Average HV (days)` (default 30)
* Thresholds: Low/High/Extreme
* `Stats Window (days)` (default 300)
* Panel padding, toggle table/zones on/off.
### How to use it
* **Context**: quickly see if BTC is in **compressed** (Low) or **stressed** (High/Extreme) volatility.
* **Regime cross alerts**: get notified when volatility **expands** from Low (potential breakout conditions) or pushes into High/Extreme (risk increases).
* **Stats/median**: compare today’s HV to its typical level over your lookback window.
If you want, I can add an **HV percentile rank** (e.g., “Current HV is at the 38th percentile over 300d”) or mirror the **low-vol breakout signal** from Script A into this panel.
Machine Learning Moving Average [BackQuant]Machine Learning Moving Average
A powerful tool combining clustering, pseudo-machine learning, and adaptive prediction, enabling traders to understand and react to price behavior across multiple market regimes (Bullish, Neutral, Bearish). This script uses a dynamic clustering approach based on percentile thresholds and calculates an adaptive moving average, ideal for forecasting price movements with enhanced confidence levels.
What is Percentile Clustering?
Percentile clustering is a method that sorts and categorizes data into distinct groups based on its statistical distribution. In this script, the clustering process relies on the percentile values of a composite feature (based on technical indicators like RSI, CCI, ATR, etc.). By identifying key thresholds (lower and upper percentiles), the script assigns each data point (price movement) to a cluster (Bullish, Neutral, or Bearish), based on its proximity to these thresholds.
This approach mimics aspects of machine learning, where we “train” the model on past price behavior to predict future movements. The key difference is that this is not true machine learning; rather, it uses data-driven statistical techniques to "cluster" the market into patterns.
Why Percentile Clustering is Useful
Clustering price data into meaningful patterns (Bullish, Neutral, Bearish) helps traders visualize how price behavior can be grouped over time.
By leveraging past price behavior and technical indicators, percentile clustering adapts dynamically to evolving market conditions.
It helps you understand whether price behavior today aligns with past bullish or bearish trends, improving market context.
Clusters can be used to predict upcoming market conditions by identifying regimes with high confidence, improving entry/exit timing.
What This Script Does
Clustering Based on Percentiles : The script uses historical price data and various technical features to compute a "composite feature" for each bar. This feature is then sorted and clustered based on predefined percentile thresholds (e.g., 10th percentile for lower, 90th percentile for upper).
Cluster-Based Prediction : Once clustered, the script uses a weighted average, cluster momentum, or regime transition model to predict future price behavior over a specified number of bars.
Dynamic Moving Average : The script calculates a machine-learning-inspired moving average (MLMA) based on the current cluster, adjusting its behavior according to the cluster regime (Bullish, Neutral, Bearish).
Adaptive Confidence Levels : Confidence in the predicted return is calculated based on the distance between the current value and the other clusters. The further it is from the next closest cluster, the higher the confidence.
Visual Cluster Mapping : The script visually highlights different clusters on the chart with distinct colors for Bullish, Neutral, and Bearish regimes, and plots the MLMA line.
Prediction Output : It projects the predicted price based on the selected method and shows both predicted price and confidence percentage for each prediction horizon.
Trend Identification : Using the clustering output, the script colors the bars based on the current cluster to reflect whether the market is trending Bullish (green), Bearish (red), or is Neutral (gray).
How Traders Use It
Predicting Price Movements : The script provides traders with an idea of where prices might go based on past market behavior. Traders can use this forecast for short-term and long-term predictions, guiding their trades.
Clustering for Regime Analysis : Traders can identify whether the market is in a Bullish, Neutral, or Bearish regime, using that information to adjust trading strategies.
Adaptive Moving Average for Trend Following : The adaptive moving average can be used as a trend-following indicator, helping traders stay in the market when it’s aligned with the current trend (Bullish or Bearish).
Entry/Exit Strategy : By understanding the current cluster and its associated trend, traders can time entries and exits with higher precision, taking advantage of favorable conditions when the confidence in the predicted price is high.
Confidence for Risk Management : The confidence level associated with the predicted returns allows traders to manage risk better. Higher confidence levels indicate stronger market conditions, which can lead to higher position sizes.
Pseudo Machine Learning Aspect
While the script does not use conventional machine learning models (e.g., neural networks or decision trees), it mimics certain aspects of machine learning in its approach. By using clustering and the dynamic adjustment of a moving average, the model learns from historical data to adjust predictions for future price behavior. The "learning" comes from how the script uses past price data (and technical indicators) to create patterns (clusters) and predict future market movements based on those patterns.
Why This Is Important for Traders
Understanding market regimes helps to adjust trading strategies in a way that adapts to current market conditions.
Forecasting price behavior provides an additional edge, enabling traders to time entries and exits based on predicted price movements.
By leveraging the clustering technique, traders can separate noise from signal, improving the reliability of trading signals.
The combination of clustering and predictive modeling in one tool reduces the complexity for traders, allowing them to focus on actionable insights rather than manual analysis.
How to Interpret the Output
Bullish (Green) Zone : When the price behavior clusters into the Bullish zone, expect upward price movement. The MLMA line will help confirm if the trend remains upward.
Bearish (Red) Zone : When the price behavior clusters into the Bearish zone, expect downward price movement. The MLMA line will assist in tracking any downward trends.
Neutral (Gray) Zone : A neutral market condition signals indecision or range-bound behavior. The MLMA line can help track any potential breakouts or trend reversals.
Predicted Price : The projected price is shown on the chart, based on the cluster's predicted behavior. This provides a useful reference for where the price might move in the near future.
Prediction Confidence : The confidence percentage helps you gauge the reliability of the predicted price. A higher percentage indicates stronger market confidence in the forecasted move.
Tips for Use
Combining with Other Indicators : Use the output of this indicator in combination with your existing strategy (e.g., RSI, MACD, or moving averages) to enhance signal accuracy.
Position Sizing with Confidence : Increase position size when the prediction confidence is high, and decrease size when it’s low, based on the confidence interval.
Regime-Based Strategy : Consider developing a multi-strategy approach where you use this tool for Bullish or Bearish regimes and a separate strategy for Neutral markets.
Optimization : Adjust the lookback period and percentile settings to optimize the clustering algorithm based on your asset’s characteristics.
Conclusion
The Machine Learning Moving Average offers a novel approach to price prediction by leveraging percentile clustering and a dynamically adapting moving average. While not a traditional machine learning model, this tool mimics the adaptive behavior of machine learning by adjusting to evolving market conditions, helping traders predict price movements and identify trends with improved confidence and accuracy.
Twisted Analytics ATR Model ProThe Trend Spotter Indicator is a sophisticated technical analysis tool engineered to identify high-probability trend formations across all timeframes and asset classes. Built with proprietary algorithms, this indicator combines multiple technical methodologies to deliver clear, actionable signals for traders at all experience levels.
What Makes It Unique
Unlike basic moving average systems, the Trend Spotter employs a multi-layered approach that validates trends through:
Multi-Timeframe Analysis: Confirms signals across higher timeframes to filter false positives
Adaptive Volatility Filtering: Adjusts thresholds based on ATR to optimize for both ranging and trending markets
Momentum Confirmation: Validates trend strength using proprietary oscillators before generating signals
Dynamic Trend Strength Measurement: Real-time assessment of trend intensity and potential exhaustion
Key Features
✅ Universal Compatibility: Works seamlessly on crypto, stocks, forex, commodities, and indices
✅ No Repainting: Signals remain fixed once generated - reliable for backtesting and live trading
✅ Customizable Alerts: Set up notifications for trend reversals, breakouts, and momentum shifts
✅ Visual Clarity: Color-coded signals with adjustable display settings
✅ Smart Noise Filtering: Advanced algorithms eliminate market noise and focus on genuine trends
✅ Support/Resistance Detection: Automatically identifies key levels based on trend structure
How It Works
The indicator analyzes price action through four independent validation layers:
Trend Identification: Detects higher highs/lows (uptrend) or lower highs/lows (downtrend)
Momentum Confirmation: Ensures signals align with prevailing momentum
Volatility Analysis: Adapts to changing market conditions using ATR-based thresholds
Signal Validation: Cross-references multiple factors before generating final signals
This multi-factor approach significantly reduces false signals by requiring confirmation from multiple independent analysis methods.
Best Use Cases
Trend Following: Ride major trends from early entry to exhaustion
Breakout Trading: Catch strong momentum moves out of consolidation
Reversal Trading: Identify trend exhaustion and potential reversals
Multi-Timeframe Strategies: Confirm lower timeframe entries with higher timeframe trends
Who Should Use This
Day traders seeking reliable trend signals on intraday charts
Swing traders looking for multi-day trend opportunities
Position traders wanting to identify major trend changes
Both beginner and professional traders who value data-driven decision making
Configuration Flexibility
The indicator offers extensive customization options:
Trend Period: Adjust sensitivity from 5 to 200 bars
Signal Sensitivity: Choose Low/Medium/High based on trading style
Trend Strength Threshold: Filter weak trends (0-100 scale)
Multi-Timeframe Mode: Enable/disable higher timeframe confirmation
Visual Settings: Customize colors, signal size, and labels
Trading Strategy Examples
Trend Following: Enter on initial signal, add on pullbacks, exit on reversal
Breakout Strategy: Wait for consolidation, enter on trend signal breakout
Reversal Strategy: Identify exhaustion, enter on first opposite signal
Scalping: Use high sensitivity on 1-15 min charts for quick trades
Risk Management Note
While the Trend Spotter provides high-probability signals, no indicator guarantees profits. Always use proper risk management:
Risk only 1-2% of capital per trade
Set stop-losses based on technical levels
Combine with volume analysis and support/resistance
Backtest settings on historical data before live trading
What You Get
Professional-grade trend detection algorithm
Real-time signal generation with no lag
Comprehensive parameter customization
Visual clarity with intuitive color coding
Compatible with all TradingView account types
Ongoing updates and improvements
Technical Specifications
Calculation Method: Proprietary multi-factor analysis
Signal Type: Non-repainting trend direction and strength
Overlay: Yes - displays directly on price chart
Alerts: Fully customizable alert conditions
Timeframes: All timeframes from 1-minute to monthly
Asset Classes: Universal - works on all tradable instruments
Support
Published by Twisted Analytics - Professional trading tools built by traders, for traders.
RSI Overbought/Oversold + Divergence Indicator (new)//@version=5
indicator('CryptoSignalScanner - RSI Overbought/Oversold + Divergence Indicator (new)',
//---------------------------------------------------------------------------------------------------------------------------------
//--- Define Colors ---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------
vWhite = #FFFFFF
vViolet = #C77DF3
vIndigo = #8A2BE2
vBlue = #009CDF
vGreen = #5EBD3E
vYellow = #FFB900
vRed = #E23838
longColor = color.green
shortColor = color.red
textColor = color.white
bullishColor = color.rgb(38,166,154,0) //Used in the display table
bearishColor = color.rgb(239,83,79,0) //Used in the display table
nomatchColor = color.silver //Used in the display table
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Functions--------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
TF2txt(TF) =>
switch TF
"S" => "RSI 1s:"
"5S" => "RSI 5s:"
"10S" => "RSI 10s:"
"15S" => "RSI 15s:"
"30S" => "RSI 30s"
"1" => "RSI 1m:"
"3" => "RSI 3m:"
"5" => "RSI 5m:"
"15" => "RSI 15m:"
"30" => "RSI 30m"
"45" => "RSI 45m"
"60" => "RSI 1h:"
"120" => "RSI 2h:"
"180" => "RSI 3h:"
"240" => "RSI 4h:"
"480" => "RSI 8h:"
"D" => "RSI 1D:"
"1D" => "RSI 1D:"
"2D" => "RSI 2D:"
"3D" => "RSI 2D:"
"3D" => "RSI 3W:"
"W" => "RSI 1W:"
"1W" => "RSI 1W:"
"M" => "RSI 1M:"
"1M" => "RSI 1M:"
"3M" => "RSI 3M:"
"6M" => "RSI 6M:"
"12M" => "RSI 12M:"
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Show/Hide Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowInput = input(true, title='Show RSI', group='Show/Hide Settings')
maShowInput = input(false, title='Show MA', group='Show/Hide Settings')
showRSIMAInput = input(true, title='Show RSIMA Cloud', group='Show/Hide Settings')
rsiBandShowInput = input(true, title='Show Oversold/Overbought Lines', group='Show/Hide Settings')
rsiBandExtShowInput = input(true, title='Show Oversold/Overbought Extended Lines', group='Show/Hide Settings')
rsiHighlightShowInput = input(true, title='Show Oversold/Overbought Highlight Lines', group='Show/Hide Settings')
DivergenceShowInput = input(true, title='Show RSI Divergence Labels', group='Show/Hide Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Table Settings --------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowTable = input(true, title='Show RSI Table Information box', group="RSI Table Settings")
rsiTablePosition = input.string(title='Location', defval='middle_right', options= , group="RSI Table Settings", inline='1')
rsiTextSize = input.string(title=' Size', defval='small', options= , group="RSI Table Settings", inline='1')
rsiShowTF1 = input(true, title='Show TimeFrame1', group="RSI Table Settings", inline='tf1')
rsiTF1 = input.timeframe("15", title=" Time", group="RSI Table Settings", inline='tf1')
rsiShowTF2 = input(true, title='Show TimeFrame2', group="RSI Table Settings", inline='tf2')
rsiTF2 = input.timeframe("60", title=" Time", group="RSI Table Settings", inline='tf2')
rsiShowTF3 = input(true, title='Show TimeFrame3', group="RSI Table Settings", inline='tf3')
rsiTF3 = input.timeframe("240", title=" Time", group="RSI Table Settings", inline='tf3')
rsiShowTF4 = input(true, title='Show TimeFrame4', group="RSI Table Settings", inline='tf4')
rsiTF4 = input.timeframe("D", title=" Time", group="RSI Table Settings", inline='tf4')
rsiShowHist = input(true, title='Show RSI Historical Columns', group="RSI Table Settings", tooltip='Show the information of the 2 previous closed candles')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Input Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiSourceInput = input.source(close, 'Source', group='RSI Settings')
rsiLengthInput = input.int(14, minval=1, title='RSI Length', group='RSI Settings', tooltip='Here we set the RSI lenght')
rsiColorInput = input.color(#26a69a, title="RSI Color", group='RSI Settings')
rsimaColorInput = input.color(#ef534f, title="RSIMA Color", group='RSI Settings')
rsiBandColorInput = input.color(#787B86, title="RSI Band Color", group='RSI Settings')
rsiUpperBandExtInput = input.int(title='RSI Overbought Extended Line', defval=80, minval=50, maxval=100, group='RSI Settings')
rsiUpperBandInput = input.int(title='RSI Overbought Line', defval=70, minval=50, maxval=100, group='RSI Settings')
rsiLowerBandInput = input.int(title='RSI Oversold Line', defval=30, minval=0, maxval=50, group='RSI Settings')
rsiLowerBandExtInput = input.int(title='RSI Oversold Extended Line', defval=20, minval=0, maxval=50, group='RSI Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Input Settings -----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
maTypeInput = input.string("EMA", title="MA Type", options= , group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
maColorInput = input.color(color.yellow, title="MA Color", group='MA Settings') //#7E57C2
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Input Settings ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
lbrInput = input(title="Pivot Lookback Right", defval=2, group='RSI Divergence Settings')
lblInput = input(title="Pivot Lookback Left", defval=2, group='RSI Divergence Settings')
lbRangeMaxInput = input(title="Max of Lookback Range", defval=10, group='RSI Divergence Settings')
lbRangeMinInput = input(title="Min of Lookback Range", defval=2, group='RSI Divergence Settings')
plotBullInput = input(title="Plot Bullish", defval=true, group='RSI Divergence Settings')
plotHiddenBullInput = input(title="Plot Hidden Bullish", defval=true, group='RSI Divergence Settings')
plotBearInput = input(title="Plot Bearish", defval=true, group='RSI Divergence Settings')
plotHiddenBearInput = input(title="Plot Hidden Bearish", defval=true, group='RSI Divergence Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsi = ta.rsi(rsiSourceInput, rsiLengthInput)
rsiprevious = rsi
= request.security(syminfo.tickerid, rsiTF1, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF2, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF3, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF4, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
ma(source, length, type) =>
switch type
"SMA" => ta.sma(source, length)
"Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
rsiMA = ma(rsi, maLengthInput, maTypeInput)
rsiMAPrevious = rsiMA
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Stoch RSI Settings + Calculation --------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
showStochRSI = input(false, title="Show Stochastic RSI", group='Stochastic RSI Settings')
smoothK = input.int(title="Stochastic K", defval=3, minval=1, maxval=10, group='Stochastic RSI Settings')
smoothD = input.int(title="Stochastic D", defval=4, minval=1, maxval=10, group='Stochastic RSI Settings')
lengthRSI = input.int(title="Stochastic RSI Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
lengthStoch = input.int(title="Stochastic Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
colorK = input.color(color.rgb(41,98,255,0), title="K Color", group='Stochastic RSI Settings', inline="1")
colorD = input.color(color.rgb(205,109,0,0), title="D Color", group='Stochastic RSI Settings', inline="1")
StochRSI = ta.rsi(rsiSourceInput, lengthRSI)
k = ta.sma(ta.stoch(StochRSI, StochRSI, StochRSI, lengthStoch), smoothK) //Blue Line
d = ta.sma(k, smoothD) //Red Line
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Settings ------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 50)
hiddenBearColor = color.new(color.red, 50)
//textColor = color.white
noneColor = color.new(color.white, 100)
osc = rsi
plFound = na(ta.pivotlow(osc, lblInput, lbrInput)) ? false : true
phFound = na(ta.pivothigh(osc, lblInput, lbrInput)) ? false : true
_inRange(cond) =>
bars = ta.barssince(cond == true)
lbRangeMinInput <= bars and bars <= lbRangeMaxInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define Plot & Line Colors ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiColor = rsi >= rsiMA ? rsiColorInput : rsimaColorInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Lines ------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Create a horizontal line at a specific price level
myLine = line.new(bar_index , 75, bar_index, 75, color = color.rgb(187, 14, 14), width = 2)
bottom = line.new(bar_index , 50, bar_index, 50, color = color.rgb(223, 226, 28), width = 2)
mymainLine = line.new(bar_index , 60, bar_index, 60, color = color.rgb(13, 154, 10), width = 3)
hline(50, title='RSI Baseline', color=color.new(rsiBandColorInput, 50), linestyle=hline.style_solid, editable=false)
hline(rsiBandExtShowInput ? rsiUpperBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiUpperBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiLowerBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandExtShowInput ? rsiLowerBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandExtInput ? color.new(rsiColorInput, 70) : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandInput ? rsi < rsiUpperBandExtInput ? color.new(#64ffda, 90) : na : na: na, title="Show Overbought Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? rsi > rsiLowerBandExtInput ? color.new(#F43E32, 90) : na : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? color.new(rsimaColorInput, 70) : na : na, title="Show Oversold Highlight", editable=false)
maPlot = plot(maShowInput ? rsiMA : na, title='MA', color=color.new(maColorInput,0), linewidth=1)
rsiMAPlot = plot(showRSIMAInput ? rsiMA : na, title="RSI EMA", color=color.new(rsimaColorInput,0), editable=false, display=display.none)
rsiPlot = plot(rsiShowInput ? rsi : na, title='RSI', color=color.new(rsiColor,0), linewidth=1)
fill(rsiPlot, rsiMAPlot, color=color.new(rsiColor, 60), title="RSIMA Cloud")
plot(showStochRSI ? k : na, title='Stochastic K', color=colorK, linewidth=1)
plot(showStochRSI ? d : na, title='Stochastic D', color=colorD, linewidth=1)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Divergence -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Regular Bullish
// Osc: Higher Low
oscHL = osc > ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Lower Low
priceLL = low < ta.valuewhen(plFound, low , 1)
bullCond = plotBullInput and priceLL and oscHL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Regular Bullish",
linewidth=2,
color=(bullCond ? bullColor : noneColor)
)
plotshape(
DivergenceShowInput ? bullCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bullish Label",
text=" Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bullish
// Osc: Lower Low
oscLL = osc < ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Higher Low
priceHL = low > ta.valuewhen(plFound, low , 1)
hiddenBullCond = plotHiddenBullInput and priceHL and oscLL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Hidden Bullish",
linewidth=2,
color=(hiddenBullCond ? hiddenBullColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBullCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bullish Label",
text=" H Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Regular Bearish
// Osc: Lower High
oscLH = osc < ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Higher High
priceHH = high > ta.valuewhen(phFound, high , 1)
bearCond = plotBearInput and priceHH and oscLH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Regular Bearish",
linewidth=2,
color=(bearCond ? bearColor : noneColor)
)
plotshape(
DivergenceShowInput ? bearCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bearish Label",
text=" Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bearish
// Osc: Higher High
oscHH = osc > ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Lower High
priceLH = high < ta.valuewhen(phFound, high , 1)
hiddenBearCond = plotHiddenBearInput and priceLH and oscHH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Hidden Bearish",
linewidth=2,
color=(hiddenBearCond ? hiddenBearColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBearCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bearish Label",
text=" H Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Check RSI Lineup ------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bullTF = rsi > rsi and rsi > rsi
bearTF = rsi < rsi and rsi < rsi
bullTF1 = rsi1 > rsi1_1 and rsi1_1 > rsi1_2
bearTF1 = rsi1 < rsi1_1 and rsi1_1 < rsi1_2
bullTF2 = rsi2 > rsi2_1 and rsi2_1 > rsi2_2
bearTF2 = rsi2 < rsi2_1 and rsi2_1 < rsi2_2
bullTF3 = rsi3 > rsi3_1 and rsi3_1 > rsi3_2
bearTF3 = rsi3 < rsi3_1 and rsi3_1 < rsi3_2
bullTF4 = rsi4 > rsi4_1 and rsi4_1 > rsi4_2
bearTF4 = rsi4 < rsi4_1 and rsi4_1 < rsi4_2
bbTxt(bull,bear) =>
bull ? "BULLISH" : bear ? "BEARISCH" : 'NO LINEUP'
bbColor(bull,bear) =>
bull ? bullishColor : bear ? bearishColor : nomatchColor
newTC(tBox, col, row, txt, width, txtColor, bgColor, txtHA, txtSize) =>
table.cell(table_id=tBox,column=col, row=row, text=txt, width=width,text_color=txtColor,bgcolor=bgColor, text_halign=txtHA, text_size=txtSize)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define RSI Table Setting ----------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
width_c0 = 0
width_c1 = 0
if rsiShowTable
var tBox = table.new(position=rsiTablePosition, columns=5, rows=6, bgcolor=color.rgb(18,22,33,50), frame_color=color.black, frame_width=1, border_color=color.black, border_width=1)
newTC(tBox, 0,1,"RSI Current",width_c0,color.orange,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,1,str.format(" {0,number,#.##} ", rsi),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,1,bbTxt(bullTF, bearTF),width_c0,vWhite,bbColor(bullTF, bearTF),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF1
newTC(tBox, 0,2,TF2txt(rsiTF1),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,2,str.format(" {0,number,#.##} ", rsi1),width_c0,vWhite,rsi1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,2,bbTxt(bullTF1, bearTF1),width_c0,vWhite,bbColor(bullTF1,bearTF1),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,2,str.format(" {0,number,#.##} ", rsi1_1),width_c0,vWhite,rsi1_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,2,str.format(" {0,number,#.##} ", rsi1_2),width_c0,vWhite,rsi1_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF2
newTC(tBox, 0,3,TF2txt(rsiTF2),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,3,str.format(" {0,number,#.##} ", rsi2),width_c0,vWhite,rsi2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,3,bbTxt(bullTF2, bearTF2),width_c0,vWhite,bbColor(bullTF2,bearTF2),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,3,str.format(" {0,number,#.##} ", rsi2_1),width_c0,vWhite,rsi2_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,3,str.format(" {0,number,#.##} ", rsi2_2),width_c0,vWhite,rsi2_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF3
newTC(tBox, 0,4,TF2txt(rsiTF3),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,4,str.format(" {0,number,#.##} ", rsi3),width_c0,vWhite,rsi3 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,4,bbTxt(bullTF3, bearTF3),width_c0,vWhite,bbColor(bullTF3,bearTF3),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,4,str.format(" {0,number,#.##} ", rsi3_1),width_c0,vWhite,rsi3_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,4,str.format(" {0,number,#.##} ", rsi3_2),width_c0,vWhite,rsi3_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF4
newTC(tBox, 0,5,TF2txt(rsiTF4),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,5,str.format(" {0,number,#.##} ", rsi4),width_c0,vWhite,rsi4 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,5,bbTxt(bullTF4, bearTF4),width_c0,vWhite,bbColor(bullTF4,bearTF4),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,5,str.format(" {0,number,#.##} ", rsi4_1),width_c0,vWhite,rsi4_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,5,str.format(" {0,number,#.##} ", rsi4_2),width_c0,vWhite,rsi4_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
//------------------------------------------------------
//--- Alerts -------------------------------------------
//------------------------------------------------------






















