SOLUSDC Buy/Sell Signal - Optimized v6 - krizSOLUSDC Buy/Sell Signal - Optimized v6
The SOLUSDC Buy/Sell Signal - Optimized v6 is a powerful trend-following indicator designed for crypto traders who want to optimize their entry and exit points when trading SOL/USDC on a 3-minute timeframe.
This indicator utilizes a combination of Exponential Moving Averages (EMA), MACD, RSI, and Bollinger Bands to generate high-probability buy and sell signals. Additionally, it features historical signal tracking, allowing traders to view past buy and sell opportunities up to one week back for backtesting and strategy refinement.
🚀 Key Features:
✅ High-Accuracy Buy & Sell Signals – Based on EMA crossovers, MACD confirmation, RSI levels, and Bollinger Band positioning.
✅ Trend Filtering – Trades only in the direction of the 200 EMA to avoid weak or false signals.
✅ Historical Signal Tracking – Displays buy and sell signals from the past week, making it easier to analyze past performance.
✅ Optimized for Pine Script v6 – Fully compatible with the latest version of TradingView's scripting language.
✅ Visual Alerts on Chart – Clear green arrows for Buy signals and red arrows for Sell signals directly on the chart.
✅ Performance Success Rate Display – A dynamic success rate panel in the top-right corner helps gauge the effectiveness of the strategy.
📊 How It Works:
Buy Signal 📈 (Green Arrow)
9 EMA crosses above 21 EMA (bullish momentum)
MACD line is above the signal line
RSI is below 40 (indicating a possible oversold condition)
Price touches or breaks below the lower Bollinger Band
Price is above the 200 EMA (confirming an uptrend)
Sell Signal 📉 (Red Arrow)
9 EMA crosses below 21 EMA (bearish momentum)
MACD line is below the signal line
RSI is above 60 (indicating a possible overbought condition)
Price touches or breaks above the upper Bollinger Band
Price is below the 200 EMA (confirming a downtrend)
📌 Best Usage Practices:
Works best on SOLUSDC with a 3-minute timeframe.
Combine with volume analysis and market structure for optimal trade confirmation.
Avoid trading during highly volatile news events to reduce false signals.
Backtest using the historical signals feature to refine strategy execution.
🎯 How to Use in TradingView:
Open TradingView.
Go to Pine Editor (Bottom panel).
Copy and paste the script.
Click "Save" → "Add to Chart".
Switch to a 3-minute timeframe for the best results.
🔥 Why Use This Indicator?
✅ Minimizes False Signals – Uses multiple confirmations for precision.
✅ Works in Real-Time & Historical Data – See past signals up to one week back for better analysis.
✅ Custom-Tuned for SOLUSDC – Optimized specifically for crypto traders.
✅ Fully Compatible with Pine Script v6 – No errors, runs smoothly.
🚀 Take your trading to the next level with the SOLUSDC Buy/Sell Signal - Optimized v6! 🚀
Indicators and strategies
RSI/MACD Momentum Scalper TableThe RSI/MACD Momentum Scalper Table is a powerful technical analysis tool that evaluates market momentum across multiple timeframes using the Relative Strength Index (RSI) and Moving Average Convergence Divergence (MACD) . It displays a table with different timeframes, allowing traders to quickly assess trend strength and direction.
Why This Indicator is Unique
- Multi-Timeframe Analysis: Unlike traditional RSI/MACD indicators that only apply to a single timeframe, this indicator tracks trends across five customizable timeframes.
- Dynamic Color-Coding: The table updates in real-time, showing green for bullish momentum, red for bearish, and gray for neutral conditions.
- Customizable Moving Averages: Users can choose between EMA, DEMA, and HMA, providing flexibility in trend detection.
- Adjustable Positioning: The table can be placed in any corner of the chart using the **position input setting**.
Why This Indicator is Useful
- Quick Market Overview: Instantly see whether multiple timeframes align for a strong trend.
- Scalping & Swing Trading Support: Helps scalpers and swing traders identify optimal entry and exit points.
- Versatility: Can be applied to stocks, forex, crypto, and other financial instruments.
How to Use It
1. Set Timeframes: Choose up to five timeframes to monitor momentum.
2. Customize Trend Settings: Adjust RSI length, MACD settings, and moving average type.
3. Interpret the Table:
- Green cells indicate a bullish trend.
- Red cells indicate a bearish trend.
- Gray cells suggest neutral momentum.
4. Adjust Table Position: Move the table to a preferred location using the Table position input.
This indicator is ideal for traders who need a **quick and efficient** way to track market momentum across different timeframes. 🚀
Candle Gap ScannerThis code will compare the first candle with the second candle. If the highest value reached by the first candle is lower than the lowest value reached by the second candle, and this difference is greater than a percentage value that can be adjusted in the settings, it will place a red mark. Additionally, it will compare the first candle with the second candle again. If the lowest value reached by the first candle is higher than the highest value reached by the second candle, and this difference is greater than a percentage value that can be adjusted in the settings, it will place a red mark.
Dynamic SMATimeframe Detection: The indicator first identifies the current timeframe of the chart (e.g., daily, 4-hour, 1-hour).
SMA Calculation: It calculates three different SMAs:
Daily SMA: A 8-period SMA calculated on daily closing prices.
4-Hour SMA: A 50-period SMA calculated on 4-hour closing prices.
1-Hour SMA: A 100-period SMA calculated on 1-hour closing prices.
Dynamic SMA Selection: Based on the detected timeframe, the indicator selects the appropriate SMA to display:
If the timeframe is daily, it uses the daily SMA.
If the timeframe is 4-hour, it uses the 4-hour SMA.
If the timeframe is 1-hour, it uses the 1-hour SMA.
Plotting: The selected SMA is plotted on the chart as a blue line.
Dynamic Label: The indicator also creates a dynamic label that displays the current SMA being used, along with the corresponding timeframe and period. For example, it will show "Active SMA: 8 SMA (Daily)" when the daily SMA is active.
This indicator is useful for traders who want to use different SMAs for different timeframes without having to manually switch between them. It provides a convenient way to see the relevant SMA for the current chart view.
Yesterday's OHLCThis indicator is designed to provide traders with a visual representation of the previous day's key price levels on their charts. The script calculates and plots four critical price points: the open, high, low, and close from the previous trading day. Users can customize the resolution from which these values are pulled, with the default set to daily. Additionally, the script offers options to hide past prices, display tomorrow's projected values, and customize the colors of the plotted lines for better visibility. The script intelligently adjusts for extended trading sessions, ensuring that the displayed values remain accurate regardless of the current market conditions. By utilizing the request.security function, it fetches historical price data and plots the values using step line styles, making it easy for traders to identify significant price levels that may influence future price movements. This indicator serves as a valuable tool for traders looking to analyze market behavior based on historical data, enabling them to make informed trading decisions.
Trading Strategy Using This Indicator
Strategy Overview:
The "Yesterday's OHLC" indicator can be effectively integrated into a trading strategy focused on breakout and reversal patterns. By observing how the current price interacts with the previous day's key levels, traders can identify potential entry and exit points.
1. Breakout Strategy:
Entry Signal:
If the current price breaks above yesterday's high, it may indicate bullish momentum. Traders can enter a long position once the price closes above this level, confirming the breakout.
Conversely, if the price breaks below yesterday's low, it may signal bearish momentum. Traders can enter a short position upon a close below this level.
Stop Loss:
Set a stop loss just below yesterday's high for long positions or just above yesterday's low for short positions to manage risk.
Take Profit:
Target a risk-reward ratio of at least 1:2. Traders can use previous support and resistance levels or Fibonacci retracement levels to identify potential take profit areas.
2. Reversal Strategy:
Entry Signal:
If the price approaches yesterday's high or low but fails to break through, it may indicate a reversal. Traders can look for candlestick patterns (like pin bars or engulfing patterns) near these levels to signal a potential reversal.
For example, if the price tests yesterday's high and forms a bearish reversal pattern, traders can enter a short position.
Stop Loss:
Place a stop loss just above the high (for short positions) or below the low (for long positions) to protect against false breakouts.
Take Profit:
Similar to the breakout strategy, aim for a risk-reward ratio of at least 1:2, using previous price action levels to set targets.
3. Additional Considerations:
Volume Confirmation:
Look for increased trading volume during breakouts or reversals to confirm the strength of the move.
Market Context:
Always consider the broader market context, including economic news and events, which can impact price movements.
By incorporating the "Yesterday's OHLC" indicator into these strategies, traders can enhance their decision-making process, leveraging historical price levels to identify potential trading opportunities. This approach not only helps in managing risk but also allows traders to align their trades with market sentiment and price action.
Anchored Moving AverageAn Anchored Moving Average (AMA) is a technical analysis tool that calculates the average price of an asset starting from a specific point in time. Every closing candle calculates the price.
Combined SmartComment & Dynamic S/R LevelsDescription:
The Combined SmartComment & Dynamic S/R Levels script is designed to provide valuable insights for traders using TradingView. It integrates dynamic support and resistance levels with a powerful Intelligent Comment system to enhance decision-making. The Intelligent Comment feature generates market commentary based on key technical indicators, delivering real-time actionable feedback that helps optimize trading strategies.
Intelligent Comment Feature:
The Intelligent Comment function continuously analyzes market conditions and offers relevant insights based on combinations of various technical indicators such as RSI, ATR, MACD, WMA, and others. These comments help traders identify potential price movements, highlighting opportunities to buy, sell, or wait.
Examples of the insights provided by the system include:
RSI in overbought/oversold and price near resistance/support: Indicates potential price reversal points.
Price above VAH and volume increasing: Suggests a strengthening uptrend.
Price near dynamic support/resistance: Alerts when price approaches critical support or resistance zones.
MACD crossovers and RSI movements: Provide signals for potential trend shifts or continuations.
Indicators Used:
RSI (Relative Strength Index)
ATR (Average True Range)
MACD (Moving Average Convergence Divergence)
WMA (Weighted Moving Average)
POC (Point of Control)
Bollinger Bands
SuperSignal
Volume
EMA (Exponential Moving Average)
Dynamic Support/Resistance Levels
How It Works:
The script performs real-time market analysis, assessing multiple technical indicators to generate Intelligent Comments. These comments provide traders with timely guidance on potential market movements, assisting with decision-making in a dynamic market environment. The script also integrates dynamic support and resistance levels to further enhance trading accuracy.
Daily Lines Drawer with Previous Day's RangeThis Pine Script indicator calculates and plots the highest high and lowest low within the first nine days of each month. It dynamically updates these values only for the 1st to 9th days, ensuring accurate tracking within this period. The highest high is plotted in blue, and the lowest low is plotted in red for easy visualization on the chart.
Al-Sat İndikatörü//@version=5
indicator("Al-Sat İndikatörü", overlay=true)
// Parametreler
shortLength = input(9, title="Kısa EMA Periyodu")
longLength = input(21, title="Uzun EMA Periyodu")
// Hareketli Ortalamalar
shortEMA = ta.ema(close, shortLength)
longEMA = ta.ema(close, longLength)
// Al-Sat Sinyalleri
buySignal = ta.crossover(shortEMA, longEMA) // Kısa EMA, Uzun EMA'yı yukarı keserse AL
sellSignal = ta.crossunder(shortEMA, longEMA) // Kısa EMA, Uzun EMA'yı aşağı keserse SAT
// Grafikte gösterim
plot(shortEMA, color=color.blue, title="Kısa EMA")
plot(longEMA, color=color.red, title="Uzun EMA")
// İşaretler
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="AL")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SAT")
alertcondition(buySignal, title="AL Sinyali", message="Fiyat yukarı yönlü kesişti!")
alertcondition(sellSignal, title="SAT Sinyali", message="Fiyat aşağı yönlü kesişti!")
Sahil23_HammerHammer indicator:
It will identify a hammer and then it will check if the candle next to the hammer is green or not, if it's green it will put a white triangle below it.
MOATH EMADversion one
touchesRedLine2 = not na(dojiLineDown2) and
(low <= line.get_y1(dojiLineDown2) and high >= line.get_y1(dojiLineDown2)) and
(open < line.get_y1(dojiLineDown2) and close > line.get_y1(dojiLineDown2)) and // تفتح تحت الخط وتغلق فوقه
(real_close > line.get_y1(dojiLineDown2)) and // إضافة شرط السعر الحقيقي فوق الخط الأحمر
(bar_index - dojiLineDownBarIndex2 <= 5) and // فقط خلال 5 شموع
not labelPlacedDown and // التأكد من أن الإشارة لم توضع مسبقًا
(((close > ema200 + pointDistance)and enableIndicator)or not enableIndicator) and
(((rsi<30 )and enableIndicator2)or not enableIndicator2) and is_stop_candle_down// الشرط الجديد: الشمعة فوق الـ EMA بمقدار نقطتين
if touchesGreenLine
label.new(bar_index, high, text="Sell", color=color.orange, textcolor=color.white, size=size.small, style=label.style_label_down)
labelPlacedUp := true
if touchesRedLine
label.new(bar_index, low, text="Buy", color=color.blue, textcolor=color.white, size=size.small, style=label.style_label_up)
labelPlacedDown := true // تم وضع الإشارة
if touchesGreenLine2
label.new(bar_index, high, text="Sell", color=color.orange, textcolor=color.white, size=size.small, style=label.style_label_down)
labelPlacedUp := true
if touchesRedLine2
label.new(bar_index, low, text="Buy", color=color.blue, textcolor=color.white, size=size.small, style=label.style_label_up)
labelPlacedDown := true // تم وضع الإشارة
alertcondition(touchesGreenLine or touchesRedLine or touchesGreenLine2 or touchesRedLine2 , title="Buy/Sell Alert", message="Signal detected: Buy or Sell")
var table statsTable = table.new(position.top_right, 1, 1, border_color=color.purple, bgcolor=color.new(color.black, 90))
table.cell(statsTable, 0, 0, "Moath Emad", text_color=color.white, bgcolor=color.black, text_size=size.auto)
EMA +vegas The Vegas tunnel and EMA are combined for trend judgment, while EMA12 is used to filter out false breakouts.
ATR Stop-Loss by Marius AVisual and Logical Behavior of the Code
1️⃣ ATR is calculated based on the chosen period (default 14) to determine volatility.
2️⃣ When the price crosses above the SMA(14), a Long stop-loss is set.
The stop-loss is placed below the current price at a distance of 1.5 × ATR (default).
The green line appears below the candle.
3️⃣ When the price crosses below the SMA(14), a Short stop-loss is set.
The stop-loss is placed above the current price at a distance of 1.5 × ATR.
The red line appears above the candle.
🔹 Examples of Manifestation on the Chart
📌 Scenario 1: Bullish Trend → Long Stop-Loss is Activated
✅ If the price rises above the SMA(14), a green stop-loss is set below the price.
✅ The stop-loss remains fixed until the price makes a new crossover.
🔴 If the price drops and hits the green line, the Long position is closed.
📌 Scenario 2: Bearish Trend → Short Stop-Loss is Activated
✅ If the price falls below the SMA(14), a red stop-loss is set above the price.
✅ The stop-loss remains in place until a new cross below the SMA(14).
🟢 If the price rises and hits the red line, the Short position is closed.
🔹 Strengths and Limitations of the Code
✅ Advantages:
Automatically adapts to market volatility.
Works on any timeframe and instrument.
Provides a dynamic stop-loss based on real conditions.
❌ Limitations:
Does not adjust the stop-loss after each candle (it is not a trailing stop).
The stop-loss remains fixed until a new crossover/crossunder of the price over the SMA(14).
Does not provide entry signals, only position protection.
Uptrick: FRAMA Matrix RSIUptrick: FRAMA Matrix RSI
Introduction
The Uptrick: FRAMA Matrix RSI is a momentum-based indicator that integrates the Relative Strength Index (RSI) with the Fractal Adaptive Moving Average (FRAMA). By applying FRAMA's adaptive smoothing to RSI—and further refining it with a Zero-Lag Moving Average (ZLMA)—this script creates a refined and reliable momentum oscillator. The indicator now includes enhanced divergence detection, potential reversal signals, customizable buy/sell signal options, an internal stats table, and a fully customizable bar coloring system for an enhanced visual trading experience.
Why Combine RSI with FRAMA
Traditional RSI is a well-known momentum indicator but has several limitations. It is highly sensitive to price fluctuations, often generating false signals in choppy or volatile markets. FRAMA, in contrast, adapts dynamically to price changes by adjusting its smoothing factor based on market conditions.
By integrating FRAMA into RSI calculations, this indicator reduces noise while preserving RSI's ability to track momentum, adapts to volatility by reducing lag in trending markets and smoothing out choppiness in ranging conditions, enhances trend-following capability for more reliable momentum shifts, and refines overbought and oversold signals by adjusting to the current market structure.
With the new enhancements, such as a manual alpha input, noise filtering, divergence detection, and multiple buy/sell signal options, the indicator offers even greater flexibility and precision for traders. This combination improves the standard RSI by making it more adaptive and responsive to market changes.
Originality
This indicator is unique because it applies FRAMA's adaptive smoothing technique to RSI, creating a dynamic momentum oscillator that adjusts to different market conditions. Many traditional RSI-based indicators either use fixed smoothing methods like exponential moving averages or employ basic RSI calculations without adjusting for volatility.
This script stands out by integrating several elements, including the fractal dimension-based smoothing of FRAMA to reduce noise while retaining responsiveness, the use of Zero-Lag Moving Average smoothing to enhance trend sensitivity and reduce lag, divergence detection to highlight mismatches between price action and RSI momentum, a noise filter and manual alpha option to prevent minor fluctuations from generating false signals, customizable buy/sell signal options that let traders choose between ZLMA-based or FRAMA RSI-based signals, an internal stats table displaying real-time FRAMA calculations such as fractal dimension and the adaptive alpha factor, and a fully customizable bar coloring system to visually distinguish bullish, bearish, and neutral conditions.
Features
Adaptive FRAMA RSI
The indicator applies FRAMA to RSI values, making the momentum oscillator adaptive to volatility while filtering out noise. Unlike a traditional RSI that reacts equally to all price movements, FRAMA RSI adjusts its smoothing factor based on market structure, making it more effective for identifying true momentum shifts.
Zero-Lag Moving Average (ZLMA)
A smoothing technique that minimizes lag while preserving the responsiveness of price movements. It is applied to the FRAMA RSI to further refine signals and ensure smoother trend detection.
Bullish and Bearish Threshold Crossovers
This system compares FRAMA RSI to a user-defined threshold (default is 50). When FRAMA RSI moves above the threshold, it indicates bullish momentum, while movement below signals bearish conditions. The enhanced noise filter ensures that only significant moves trigger signals.
Noise Filter and Manual Alpha
A new noise filter input prevents tiny fluctuations from triggering false signals. In addition, a manual alpha option allows traders to override the automatically computed smoothing factor with a custom value, providing extra control over the indicator’s sensitivity.
Divergence Detection
The indicator identifies divergence patterns by comparing FRAMA RSI pivots to price action. Bullish divergence occurs when price makes a lower low while FRAMA RSI makes a higher low, and bearish divergence occurs when price makes a higher high while FRAMA RSI makes a lower high. These signals can help traders anticipate potential reversals.
Reversal Signals
Labels appear on the chart when FRAMA RSI confirms classic RSI overbought (70) or oversold (30) conditions, providing visual cues for potential trend reversals.
Buy and Sell Signal Options
Traders can now choose between two signal-generation methods. ZLMA-based signals trigger when the ZLMA of FRAMA RSI crosses key overbought (70) or oversold (30) levels, while FRAMA RSI-based signals trigger when FRAMA RSI itself crosses these levels. This added flexibility allows users to tailor the indicator to their preferred trading style.
ZLMA:
FRAMA:
Customizable Alerts
Alerts notify traders when FRAMA RSI crosses key levels, divergence signals occur, reversal conditions are met, or buy/sell signals trigger. This ensures that important trading events are not missed.
Fully Customizable Bar Coloring System
Users can color bars based on different conditions, enhancing visual clarity. Bar coloring modes include: FRAMA RSI threshold (bars change color based on whether FRAMA RSI is above or below the threshold), ZLMA crossover (bars change when ZLMA crosses overbought or oversold levels), buy/sell signals (bars change when official signals trigger), divergence (bars highlight when bullish or bearish divergence is detected), and reversals (bars indicate when RSI reaches overbought or oversold conditions confirmed by FRAMA RSI). The system also remembers the last applied bar color, ensuring a smooth visual transition.
Input Parameters and Features
Core Inputs
RSI Length (default: 14) defines the period for RSI calculations.
FRAMA Lookback (default: 16) determines the length for the FRAMA smoothing function.
RSI Bull Threshold (default: 50) sets the level above which the market is considered bullish and below which it is bearish.
Noise Filter (default: 1.0) ensures that small fluctuations do not trigger false bullish or bearish signals.
Additional Features
Show Bull and Bear Alerts (default: true) enables notifications when FRAMA RSI crosses the threshold.
Enable Divergence Detection (default: false) highlights bullish and bearish divergences based on price and FRAMA RSI pivots.
Show Potential Reversal Signals (default: false) identifies overbought (70) and oversold (30) levels as possible trend reversal points.
Buy and Sell Signal Option (default: ZLMA) allows traders to choose between ZLMA-based signals or FRAMA RSI-based signals for trade entry.
ZLMA Enhancements
ZLMA Length (default: 14) determines the period for the Zero-Lag Moving Average applied to FRAMA RSI.
Visualization Options
Show Internal Stats Table (default: false) displays real-time FRAMA calculations, including fractal dimension and the adaptive alpha smoothing factor.
Show Threshold FRAMA Signals (default: false) plots buy and sell labels when FRAMA RSI crosses the threshold level.
How It Works
FRAMA Calculation
FRAMA dynamically adjusts smoothing based on the price fractal dimension. The alpha smoothing factor is derived from the fractal dimension or can be set manually to maintain responsiveness.
RSI with FRAMA Smoothing
RSI is calculated using the user-defined lookback period. FRAMA is then applied to the RSI to make it more adaptive to volatility. Optionally, ZLMA is applied to further refine the signals and reduce lag.
Bullish and Bearish Threshold Crosses
A bullish condition occurs when FRAMA RSI crosses above the threshold, while a bearish condition occurs when it falls below. The noise filter ensures that only significant trend shifts generate signals.
Buy and Sell Signal Options
Traders can choose between ZLMA crossovers or FRAMA RSI crossovers as the basis for buy and sell signals, offering flexibility in trade entry timing.
Divergence Detection
The indicator identifies divergences where price action and FRAMA RSI momentum do not align, potentially signaling upcoming reversals.
Reversal Signal Labels
When classic RSI overbought or oversold levels are confirmed by FRAMA RSI conditions, reversal labels are added on the chart to highlight potential exhaustion points.
Bar Coloring System
Bars are dynamically colored based on various conditions such as RSI thresholds, ZLMA crossovers, buy/sell signals, divergence, and reversals, allowing traders to quickly interpret market sentiment.
Alerts and Internal Stats
Customizable alerts notify traders of key events, and an optional internal stats table displays real-time calculations (fractal dimension, alpha value, and RSI values) to help users understand the underlying dynamics of the indicator.
Summary
The Uptrick: FRAMA Matrix RSI offers an enhanced approach to momentum analysis by combining RSI with adaptive FRAMA smoothing and additional layers of signal refinement. The indicator now includes adaptive RSI smoothing to reduce noise and improve responsiveness, Zero-Lag Moving Average filtering to minimize lag, divergence and reversal detection to identify potential turning points, customizable buy/sell signal options that let traders choose between different signal methodologies, a fully customizable bar coloring system to visually distinguish market conditions, and an internal stats table for real-time insight into FRAMA calculation parameters.
Whether used for trend confirmation, divergence detection, or momentum-based strategies, this indicator provides a powerful and adaptive approach to trading.
Disclaimer
This script is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results. Always conduct proper research and consult with a financial advisor before making trading decisions.
GpPa Fixed Range VWAP & Standard DeviationsGpPa Fixed Range VWAP & Standard Deviations
Este indicador permite analizar un rango de tiempo específico calculando el VWAP (Precio Promedio Ponderado por Volumen) junto con sus niveles de desviación estándar. Utilizando el precio HLC3 y el volumen, el script determina el VWAP del período seleccionado y traza niveles de volatilidad a 0.5, 1.0, 1.5 y 2.0 desviaciones estándar por encima y por debajo del VWAP. Además, se marcan visualmente el inicio y el fin del rango mediante líneas verticales, facilitando la identificación de zonas de soporte, resistencia y posibles puntos de reversión en función de la volatilidad del precio.
Personaliza fácilmente el rango de análisis y los colores del VWAP, los niveles de desviación y las líneas, adaptándolo a tus necesidades de trading.
4Hour Zone SeparatorThis custom TradingView indicator draws vertical lines on your chart to visually separate the 4-hour trading zones within a single trading day. The indicator helps traders identify key time intervals throughout the day for better market analysis and decision-making.
Features:
• Time-Based Zones: The indicator divides the day into six distinct 4-hour periods, starting from midnight (00:00) and continuing every 4 hours. Each zone is marked by a vertical line on the chart.
• User Customization: You can toggle the visibility of the lines for each 4-hour period (00:00, 04:00, 08:00, 12:00, 16:00, 20:00) based on your preference. This allows you to focus on specific zones that matter most for your analysis.
• Line Styling Options: Choose from three different line styles — Solid, Dashed, or Dotted — and adjust the thickness to your desired preference.
• Dynamic Time Adjustment: The indicator automatically adjusts for the time zone, ensuring that the 00:00 timestamp reflects the correct start of the day based on your chart’s time zone.
How It Works:
1. The indicator starts by calculating the beginning of the day at 00:00, then it sequentially places vertical lines every 4 hours.
2. Each line is color-coded for easy identification, and the lines stretch from the highest to the lowest point on the chart for that range.
3. The lines are drawn only when the chart enters a new 4-hour zone.
This tool is especially useful for day traders who want to track price action during specific times of the day and make informed decisions based on market behavior within each 4-hour period.
Adaptive Resonance Oscillator [AlgoAlpha]Introducing the Adaptive Resonance Oscillator , an advanced momentum-based oscillator designed to dynamically adjust to changing market conditions. This innovative indicator detects market frequency through a Hilbert Transform approach, adapting in real-time to identify overbought and oversold conditions with improved accuracy. With built-in divergence detection, trend analysis, and customizable smoothing, this tool is perfect for traders looking to refine their entries and exits based on adaptive oscillation mechanics.
🚀 Key Features :
🔹 Adaptive Frequency Detection – Uses Hilbert Transform principles to dynamically determine market cycle length for precise oscillator calculation.
⚙️ Customizable Smoothing – Option to apply a Hull Moving Average (HMA) for enhanced signal clarity.
📈 Divergence Detection – Identifies bullish and bearish divergences with visual markers, helping traders spot early trend reversals.
🟢 Overbought & Oversold Signals – Highlights extreme momentum conditions with adjustable thresholds.
🔔 Real-Time Alerts – Get notified for crossovers, divergences, and strong trend shifts directly on your TradingView chart.
🎨 Fully Customizable Appearance – Modify colors, divergence sensitivity, and smoothing options to fit your trading style.
🛠 How to Use :
Add the Adaptive Resonance Oscillator to your TradingView chart by clicking the ★ to favorite it.
Monitor the Charts , switch between smoothed and I smoothed modes to identify trend and price swings, use divergences and reversal signals for potential entry/exits.
Set alerts for bullish/bearish crossovers and divergence signals to stay ahead of market moves.
⚙ How It Works :
The indicator begins by applying a Hilbert Transform frequency estimation to the price series, identifying the dominant market cycle length. This is used to calculate a period for the RSI that matches its resonant frequency with the dominant market frequency, dynamically adjusting the Oscillator. The oscillator then applies an optional Hull Moving Average (HMA) smoothing for signal refinement. Additionally, the indicator scans for bullish and bearish divergences by comparing oscillator movements against price action, plotting signals accordingly. When overbought/oversold conditions or divergence events occur, alerts are triggered to notify the trader in real time.
Bullish Breakout Confirmation ProtovestBreakout Detection:
A candle closes above the defined breakout level.
The next candle must close above the high of the breakout candle without closing back below the breakout level.
Liquidity crypt
//@version=5
indicator(" 💧TFO_LVL_OI_LIQ 💧 ", " 💧TFO_LVL_OI_LIQ 💧", true, max_bars_back=5000, max_lines_count = 500, max_polylines_count = 100, max_labels_count = 500, max_boxes_count = 500)
string userSymbol = 'BINANCE' + ":" + string(syminfo.basecurrency) + 'USDT.P'
string Formula = str.format("{0}_OI", userSymbol)
OI = request.security(Formula, timeframe.period, close)
OI_delta = OI - nz(OI )
maLength = input(60, title="MA Length")
numOfLines = 500
OI_delta_MA = ta.sma(OI_delta, maLength)
OI_delta_abs = math.abs(OI_delta)
OI_delta_abs_MA = ta.sma(OI_delta_abs, maLength)
h3 = input(3.0, title="Large Liquidation Level")
h2 = input(2.0, title="Middle Liquidation Level")
h1 = input(1.2, title="Small Liquidation Level")
OI_delta_open_h3 = (OI_delta_abs >= OI_delta_abs_MA * h3) and OI_delta > 0
OI_delta_open_h2 = (OI_delta_abs >= OI_delta_abs_MA * h2 and OI_delta_abs < OI_delta_abs_MA * h3) and OI_delta > 0
OI_delta_open_h1 = (OI_delta_abs >= OI_delta_abs_MA * h1 and OI_delta_abs < OI_delta_abs_MA * h2) and OI_delta > 0
kline_price = (open + close + high + low) / 4
showLine = input(true, title="Show lines")
showHist = input(true, title="Show histgram")
showLocalOnly = input(true, title="Only show local liquidation levels")
i_5xColor = input.color(#626367a2, '5x Leverage color', group='5x Leverage')
i_10xColor = input.color(#017cff7a, '10x Leverage color', group='10x Leverage')
i_25xColor = input.color(#0dff0064, '25x Leverage color', group='25x Leverage')
i_50xColor = input.color(#f0a02966, '50x Leverage color', group='50x Leverage')
i_100xColor = input.color(color.rgb(218, 55, 101, 44), '100x Leverage color', group='100x Leverage')
var h3Array = array.new_line()
var h2Array = array.new_line()
var h1Array = array.new_line()
// histgram
barColor = input(color.rgb(0, 55, 254, 4), "Bar Color")
numOfBars = input(120, 'Number of bars to lookback')
distLastCandle = input(5, 'Histgram distance from last candle')
local_high = ta.highest(high, numOfBars)
local_low = ta.lowest(low, numOfBars)
rangeHigh = local_high * (1 + local_high / local_low / 10)
rangeLow = local_low * (1 - local_high / local_low / 10)
rangeHeight = rangeHigh - rangeLow
numOfHistograms = input(120, 'Number of histograms (<=120)')
histogramHeight = rangeHeight / numOfHistograms
histogramLowList = array.new_float(numOfHistograms, na)
histogramHighList = array.new_float(numOfHistograms, na)
histogramData = array.new_float()
histogramtargetList = array.new_float(numOfHistograms, 0.0)
var Bars = array.new_box(numOfHistograms, na)
// Clean up drawings every tick
for i=0 to numOfHistograms - 1
box.delete(array.get(Bars, i))
f_drawLine(_x1, _x2, _yValue, _lineColor, _style, _width) =>
line.new(x1=_x1, y1=_yValue, x2=_x2, y2=_yValue, color=_lineColor, style=_style, width=_width)
f_extendArray(_lineArray, _extendLines) =>
if array.size(_lineArray) > 0
for _i = array.size(_lineArray) - 1 to 0 by 1
x2 = line.get_x2(array.get(_lineArray, _i))
yValue = line.get_y1(array.get(_lineArray, _i))
if _extendLines or bar_index - 1 == x2 - 1 and not(high > yValue and low < yValue)
line.set_x2(array.get(_lineArray, _i), bar_index + 1)
if bar_index == last_bar_index
array.push(histogramData, yValue)
f_calculateLeverage100x(_pivotValue, _shortSell) =>
_shortSell ? _pivotValue * (1 - 0.01) : _pivotValue * (1 + 0.01)
f_calculateLeverage50x( _pivotValue, _shortSell) =>
_shortSell ? _pivotValue * (1 - 0.02) : _pivotValue * (1 + 0.02)
f_calculateLeverage25x(_pivotValue, _shortSell) =>
_shortSell ? _pivotValue * (1 - 0.04) : _pivotValue * (1 + 0.04)
f_calculateLeverage10x(_pivotValue, _shortSell) =>
_shortSell ? _pivotValue * (1 - 0.1) : _pivotValue * (1 + 0.1)
f_calculateLeverage5x(_pivotValue, _shortSell) =>
_shortSell ? _pivotValue * (1 - 0.2) : _pivotValue * (1 + 0.2)
float yValue = na
int x1 = na
int x2 = na
line l = na
x1 := bar_index
x2 := bar_index
f_append(Array, l) =>
if array.size(Array) == numOfLines
line.delete(array.shift(Array))
array.push(Array, l)
if OI_delta_open_h3
yValue := f_calculateLeverage5x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_5xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage5x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_5xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage10x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_10xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage10x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_10xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage25x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage25x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage50x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage50x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage100x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_solid, 1)
f_append(h3Array, l)
yValue := f_calculateLeverage100x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_solid, 1)
f_append(h3Array, l)
if OI_delta_open_h2
yValue := f_calculateLeverage10x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_10xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage10x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_10xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage25x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage25x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage50x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage50x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage100x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_solid, 1)
f_append(h2Array, l)
yValue := f_calculateLeverage100x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_solid, 1)
f_append(h2Array, l)
if OI_delta_open_h1
yValue := f_calculateLeverage25x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_dotted, 1)
f_append(h1Array, l)
yValue := f_calculateLeverage25x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_25xColor, line.style_dotted, 1)
f_append(h1Array, l)
yValue := f_calculateLeverage50x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_dotted, 1)
f_append(h1Array, l)
yValue := f_calculateLeverage50x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_50xColor, line.style_dotted, 1)
f_append(h1Array, l)
yValue := f_calculateLeverage100x(kline_price, true)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_dotted, 1)
f_append(h1Array, l)
yValue := f_calculateLeverage100x(kline_price, false)
l := f_drawLine(x1, x2, yValue, i_100xColor, line.style_dotted, 1)
f_append(h1Array, l)
f_extendArray(h3Array, false)
f_extendArray(h2Array, false)
f_extendArray(h1Array, false)
// draw hist
if barstate.islast and showHist
// Define lows and highs of the histograms
for i = 0 to numOfHistograms - 1
histogramLow = rangeLow + histogramHeight * i
histogramHigh = rangeLow + histogramHeight * (i + 1)
array.set(histogramLowList, i, histogramLow)
array.set(histogramHighList, i, histogramHigh)
for i = 0 to array.size(histogramData) - 1
y = array.get(histogramData, i)
for j = 0 to numOfHistograms - 1
histogramLow = array.get(histogramLowList, j)
histogramHigh = array.get(histogramHighList, j)
if y >= histogramLow and y <= histogramHigh
array.set(histogramtargetList, j, array.get(histogramtargetList, j) + 1)
for i = 0 to numOfHistograms - 1
histogramLow = array.get(histogramLowList, i)
histogramHigh = array.get(histogramHighList, i)
histogramtarget = array.get(histogramtargetList, i)
histogramWidth = math.floor((histogramtarget + 0.49) * 2)
// Draw histograms
array.set(Bars, i, box.new(left=bar_index + distLastCandle, top=histogramHigh, right=bar_index + distLastCandle + histogramWidth, bottom=histogramLow, bgcolor=barColor, border_color=barColor))
if barstate.islast and not showLine
for i=0 to array.size(h3Array) - 1
line.delete(array.get(h3Array, i))
for i=0 to array.size(h2Array) - 1
line.delete(array.get(h2Array, i))
for i=0 to array.size(h1Array) - 1
line.delete(array.get(h1Array, i))
else if barstate.islast and showLocalOnly
for i=0 to array.size(h3Array) - 1
if line.get_y1(array.get(h3Array, i)) < rangeLow or line.get_y1(array.get(h3Array, i)) > rangeHigh
line.delete(array.get(h3Array, i))
for i=0 to array.size(h2Array) - 1
if line.get_y1(array.get(h2Array, i)) < rangeLow or line.get_y1(array.get(h2Array, i)) > rangeHigh
line.delete(array.get(h2Array, i))
for i=0 to array.size(h1Array) - 1
if line.get_y1(array.get(h1Array, i)) < rangeLow or line.get_y1(array.get(h1Array, i)) > rangeHigh
line.delete(array.get(h1Array, i))
// Volume Profile Inputs
var g_VP = "Volume Profile"
rows = input.int(200, "Rows", tooltip = "The number of price levels/rows that will be used to approximate the cumulative volume profile", group = g_VP)
tf = input.timeframe("D", "Profile Timeframe", tooltip = "The aggregate timeframe that the volume profile represents", group = g_VP)
ltf = input.timeframe("1", "Resolution Timeframe", tooltip = "The timeframe whose price data will be used to build the volume profile", group = g_VP)
extend = input.int(100, "Profile Extend %", 0, 100, tooltip = "How much the volume profile should extend to the next session", group = g_VP)
vp_color = input.color(color.new(color.blue, 70), "Profile Color", tooltip = "The color of the volume profile", group = g_VP)
// Volume Point of Control Inputs
var g_VPOC = "Volume Point of Control"
show_vpoc = input.bool(true, "Show VPOC", inline = "VPOC", tooltip = "Whether to show the volume point of control (VPOC), or the level with the largest volume in a given volume profile", group = g_VPOC)
vpoc_color = input.color(color.yellow, "", inline = "VPOC", group = g_VPOC)
ext_vpoc = input.bool(true, "Extend Last N VPOCs", inline = "EXT", tooltip = "Whether to extend the last N number of VPOCs to the right of the chart", group = g_VPOC)
ext_n_vpoc = input.int(5, "", 0, 100, inline = "EXT", group = g_VPOC)
vpoc_label_above = input.timeframe("D", "Show Labels Above", tooltip = "With extend last N VPOCs turned on, labels displaying the date of said VPOCs will be shown when the profile timeframe is greater than or equal to this", group = g_VPOC)
vpoc_label_size = input.string('Normal', "Label Size", options = , tooltip = "The size of VPOC date labels", group = g_VPOC)
vpoc_width = input.int(2, "Line Width", tooltip = "The width of VPOC lines", group = g_VPOC)
// High Volume Nodes Inputs
var g_HVN = "High Volume Nodes"
show_hvn = input.bool(true, "Show Previous HVNs", inline = "HVN", tooltip = "Whether to show high volume nodes (HVNs) from the previous session. Using the previous session's close, HVNs above this price will use the first color, and HVNs below this price will use the second color", group = g_HVN)
hvn_color_bull = input.color(color.new(color.teal, 70), "", inline = "HVN", group = g_HVN)
hvn_color_bear = input.color(color.new(color.red, 70), "", inline = "HVN", group = g_HVN)
hvn_strength = input.int(10, "HVN Strength", tooltip = "HVNs are validated when a given level in the volume profile contains more volume than this many rows both above and below it", group = g_HVN)
hvn_type = input.string("Areas", "HVN Type", options = , tooltip = "Whether to display HVNs as levels (lines) or areas (boxes). Levels use a solid line to denote the prior session's VPOC, and dotted lines for all other HVNs", group = g_HVN)
hvn_width = input.int(1, "Line Width", tooltip = "The width of HVN lines, if the HVN type is selected as levels", group = g_HVN)
// Bubbles AcadAlgo Inputs
showBubbles = input.bool(true, "Display Bubbles", group="Bubbles", inline="1")
useHeatMap = input.bool(false, "Enable HeatMap", group="Bubbles")
showLevels = input.bool(false, "Highlight Significant Levels", group="Volume Levels")
levelsCount = input.int(10, "Number of Levels", group="Volume Levels")
mainColor = input.color(color.green, "Main Color", group="Colors")
heatMapColor1 = input.color(color.new(color.aqua, 50), "HeatMap Color 1", group="Colors")
heatMapColor2 = input.color(color.new(color.green, 50), "HeatMap Color 2", group="Colors")
heatMapColor3 = input.color(color.new(color.yellow, 50), "HeatMap Color 3", group="Colors")
heatMapColor4 = input.color(color.new(color.orange, 30), "HeatMap Color 4", group="Colors")
heatMapColor5 = input.color(#d32626, "HeatMap Color 5", group="Colors")
calculateInDollars = input.bool(false, "Calculate Volume in Dollars", group="Volume Options")
volumeFilterOn = input.bool(true, "Enable Volume Filter", group="Volume Filters") // Toggle button for volume filter
minVolumeDollars = input.float(100, "Minimum Volume ($)", minval=1, group="Volume Filters")
maxVolumeDollars = input.float(1000000000000, "Maximum Volume ($)", minval=1, group="Volume Filters")
// SPL Level Inputs
swingSizeR = input.int(10, 'Bars Right-Left', inline='brl')
swingSizeL = input.int(15, '-', inline='brl')
showBoxes = input.bool(true, 'Show Boxes ', inline='aa')
showSwingLines = input.bool(true, 'Show Lines', inline='aa')
showBubblesSPL = input.bool(true, 'Show Labels ', inline='bb')
showVol = input.bool(false, 'Show Volume', inline='bb')
showOId = input.bool(false, 'Show OI Δ ', inline='cc')
extendtilfilled = input.bool(true, 'Extend Until Fill', inline='cc')
hidefilled = input.bool(false, 'Hide Filled', group='Conditions')
voltresh = input.int(0, 'Volume >', group='Conditions')
oitresh = input.int(0, 'OI Δ (abs.) >', group='Conditions')
pnoid = input.string('/', 'Only Swings With', options= , group='Conditions')
showhighs = input.bool(true, '', inline='sh', group='Appearance')
showlows = input.bool(true, '', inline='sl', group='Appearance')
sellcol = input.color(#aa2430, 'Lows (Line - Label - Box)', inline='sh', group='Appearance')
buycol = input.color(#66bb6a, 'Highs (Line - Label - Box)', inline='sl', group='Appearance')
sellcolB = input.color(#aa2430, '', inline='sh', group='Appearance')
buycolB = input.color(#66bb6a, '', inline='sl', group='Appearance')
sellboxCol = input.color(#80192231, '', inline='sh', group='Appearance')
buyboxCol = input.color(#66bb6a31, '', inline='sl', group='Appearance')
lineStyle = input.string('Dotted', 'Line Style + Width', , inline='l', group='Appearance')
lineWid = input.int(1, '', inline='l', group='Appearance')
boxWid = input.float(0.7, 'Box Width + Type ', step=0.1, inline='xx', group='Appearance')
boxStyle = input.string('TYPE 1', '', options= , inline='xx', group='Appearance')
labelsize = input.string('Size: Tiny', 'Text Style ', options= , inline='txt', group='Appearance' )
texthalign = input.string('Right','', options= , inline='txt', group='Appearance')
lookback = input.bool(false, '', inline='lb')
daysBack = input.float(150, 'Lookback (D) ',inline='lb')
binance = input.bool(true, 'Binance USDT.P', inline='src', group='Open Interest')
binance2 = input.bool(true, 'Binance USD.P', inline='src', group='Open Interest')
binance3 = input.bool(true, 'Binance BUSD.P', inline='src2', group='Open Interest')
bitmex = input.bool(true, 'BitMEX USD.P', inline='src2', group='Open Interest')
bitmex2 = input.bool(true, 'BitMEX USDT.P ', inline='src3', group='Open Interest')
kraken = input.bool(true, 'Kraken USD.P', inline='src3', group='Open Interest')
// Calculating inRange, used for lookback in days
MSPD = 24 * 60 * 60 * 1000
lastBarDate = timestamp(year(timenow), month(timenow), dayofmonth(timenow), hour(timenow), minute(timenow), second(timenow))
thisBarDate = timestamp(year, month, dayofmonth, hour, minute, second)
daysLeft = math.abs(math.floor((lastBarDate - thisBarDate) / MSPD))
inRange = lookback ? (daysLeft < daysBack) : true
// Volume Profile Variables
var vpoc = array.new_line()
var dates = array.new_label()
var values = array.new_float()
var x_vol = array.new_int()
var y_vol = array.new_float()
var hvn_lines = array.new_line()
var hvn_boxes = array.new_box()
var hvn_Ly = array.new_float()
var hvn_By = array.new_float()
var PLA = array.new()
var polyline PL = na
var line temp_vpoc = na
var int lb_idx = na
var int lb_time = na
// SPL Level Variables
int prevHighIndex= na, int prevLowIndex= na, bool highActive= false, bool lowActive= false, bool h= false, bool lv= false
pivHi = ta.pivothigh(high, swingSizeL, swingSizeR)
pivLo = ta.pivotlow(low, swingSizeL, swingSizeR)
if not na(pivHi)
h := true
prevHighIndex := bar_index - swingSizeR
if not na(pivLo)
lv := true
prevLowIndex := bar_index - swingSizeR
// Getting OI data
mex = syminfo.basecurrency == 'BTC' ? 'XBT' : string(syminfo.basecurrency)
oid1 = nz(request.security('BINANCE:' + string(syminfo.basecurrency) + 'USDT.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
oid2 = nz(request.security('BINANCE:' + string(syminfo.basecurrency) + 'USD.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
oid3 = nz(request.security('BINANCE:' + string(syminfo.basecurrency) + 'BUSD.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
oid4 = nz(request.security('BITMEX:' + mex + 'USD.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
oid5 = nz(request.security('BITMEX:' + mex + 'USDT.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
oid6 = nz(request.security('KRAKEN:' + string(syminfo.basecurrency) + 'USD.P_OI', timeframe.period, close - close , ignore_invalid_symbol=true), 0)
deltaOI = (binance ? nz(oid1, 0) : 0) + (binance2 ? nz(oid2, 0) / close : 0) + (binance3 ? nz(oid3, 0) : 0) + (bitmex ? nz(oid4, 0) / close : 0) + (bitmex2 ? nz(oid5, 0) / close : 0) + (kraken ? nz(oid6, 0) / close : 0)
// Volume, OI, box width
vol = volume
oitreshcond = oitresh > 0 ? math.abs(deltaOI ) > oitresh : true
voltreshcond = voltresh > 0 ? vol > voltresh : true
oicond = pnoid == 'Positive OI Delta' ? deltaOI > 0 : pnoid == 'Negative OI Delta' ? deltaOI < 0 : true
CLEAR = color.rgb(0, 0, 0, 100)
boxWid1 = 0.001 * boxWid
// Styles
boxStyle(x) =>
switch x
'TYPE 1' => h ? pivHi : lv ? pivLo : na
'TYPE 2' => h ? pivHi * (1 - boxWid1) : lv ? pivLo * (1 + boxWid1) : na
lineStyle(x) =>
switch x
'Solid' => line.style_solid
'Dashed' => line.style_dashed
'Dotted' => line.style_dotted
switchtextsize(textsize) =>
switch textsize
'Size: Normal' => size.normal
'Size: Small' => size.small
'Size: Tiny' => size.tiny
'Size: Auto' => size.auto
'Size: Large' => size.large
switchhalign(texthalign) =>
switch texthalign
'Middle' => text.align_center
'Right' => text.align_right
'Left' => text.align_left
// Swing level labels
var levelBoxes = array.new_box()
var levelLines = array.new_line()
if h and inRange and showhighs and oitreshcond and voltreshcond and oicond
hBox = box.new(prevHighIndex, pivHi * (1 + boxWid1), bar_index, boxStyle(boxStyle), border_color=na, bgcolor=showBoxes ? sellboxCol : CLEAR, text=(showVol ? str.tostring(vol, format.volume) : na) + ' ' + (showOId ? str.tostring(deltaOI , format.volume) : ''), text_halign=switchhalign(texthalign), text_valign=text.align_center, text_color=chart.fg_color, text_size=switchtextsize(labelsize))
hLine = line.new(prevHighIndex, pivHi, bar_index, pivHi, color=showSwingLines ? sellcol : CLEAR, style=lineStyle(lineStyle), width=lineWid)
array.push(levelBoxes, hBox)
array.push(levelLines, hLine)
if lv and inRange and showlows and oitreshcond and voltreshcond and oicond
lBox = box.new(prevLowIndex, pivLo * (1 - boxWid1), bar_index, boxStyle(boxStyle), border_color=na, bgcolor=showBoxes ? buyboxCol : CLEAR, text=(showVol ? str.tostring(vol, format.volume) : na) + ' ' + (showOId ? str.tostring(deltaOI , format.volume) : ''), text_halign=switchhalign(texthalign), text_valign=text.align_center, text_color=chart.fg_color, text_size=switchtextsize(labelsize))
lLine = line.new(prevLowIndex, pivLo, bar_index, pivLo, color=showSwingLines ? buycol : CLEAR, style=lineStyle(lineStyle), width=lineWid)
array.push(levelBoxes, lBox)
array.push(levelLines, lLine)
// Looping over the full array of lines and updating them, and deleting them if they have been touched
size = array.size(levelBoxes)
if size > 0
for i = 0 to size - 1
j = size - 1 - i
box = array.get(levelBoxes, j)
line = array.get(levelLines, j)
level = line.get_y2(line)
filled = (high >= level and low <= level)
if filled and extendtilfilled and not hidefilled
array.remove(levelLines, j)
array.remove(levelBoxes, j)
continue
box.set_right(box, bar_index + 1)
line.set_x2(line, bar_index + 1)
if filled and hidefilled
array.remove(levelLines, j)
array.remove(levelBoxes, j)
line.delete(line)
box.delete(box)
if not filled and not extendtilfilled
array.remove(levelLines, j)
array.remove(levelBoxes, j)
continue
// Deleting the oldest lines if array is too big
if array.size(levelBoxes) >= 500
int i = 0
while array.size(levelBoxes) >= 500
box = array.get(levelBoxes, i)
line = array.get(levelLines, i)
box.delete(box)
line.delete(line)
array.remove(levelBoxes, i)
array.remove(levelLines, i)
i += 1
// Plotting circle labels for SPL
plotshape(showhighs and showBubblesSPL and h and oitreshcond and voltreshcond and oicond ? high : na, style=shape.triangleup, location=location.absolute, offset=-swingSizeR, color=sellcolB, size=size.tiny)
plotshape(showlows and showBubblesSPL and lv and oitreshcond and voltreshcond and oicond ? low : na, style=shape.triangledown, location=location.absolute, offset=-swingSizeR, color=buycolB, size=size.tiny)
// Calculations for Bubbles AcadAlgo
volumeData = volume
priceSource = hl2
volumeInDollars = volumeData * close
selectedVolume = calculateInDollars ? volumeInDollars : volumeData
normalizedVolume = selectedVolume / ta.stdev(selectedVolume, 200)
gradientColor = not useHeatMap
? color.from_gradient(
normalizedVolume, 0, 8,
chart.bg_color == color.white ? color.new(mainColor, 100) : color.rgb(18, 34, 18, 50),
mainColor
)
:
(
normalizedVolume < 1
? color.from_gradient(normalizedVolume, 0, 1, heatMapColor1, heatMapColor2)
: normalizedVolume >= 1 and normalizedVolume < 4
? color.from_gradient(normalizedVolume, 1, 4, heatMapColor3, heatMapColor4)
: normalizedVolume >= 4
? color.from_gradient(normalizedVolume, 4, 8, heatMapColor4, heatMapColor5) : na
)
volumeCondition = volumeFilterOn ? (selectedVolume >= minVolumeDollars and selectedVolume < maxVolumeDollars) : true
conditionTiny = volumeCondition and normalizedVolume > 0 and normalizedVolume < 1 and showBubbles
conditionSmall = volumeCondition and normalizedVolume >= 1 and normalizedVolume < 2 and showBubbles
conditionNormal= volumeCondition and normalizedVolume >= 2 and normalizedVolume < 3 and showBubbles
conditionLarge = volumeCondition and normalizedVolume >= 3 and normalizedVolume < 4 and showBubbles
conditionHuge = volumeCondition and normalizedVolume >= 4 and showBubbles
// Plotting for Bubbles AcadAlgo
if conditionHuge and (showLevels or showBubbles)
label.new(showBubbles ? bar_index : last_bar_index, priceSource, str.tostring(selectedVolume, format.volume), xloc.bar_index, yloc.price,
#00000000, showBubbles ? label.style_label_center : label.style_label_left, chart.fg_color)
if conditionHuge and showLevels
line.new(bar_index, priceSource, last_bar_index, priceSource, xloc.bar_index, extend.none, gradientColor, width=2)
// figure
plotshape(conditionTiny ? priceSource : na, "", shape.square, location.absolute, gradientColor, 0, "", na, size=size.tiny)
plotshape(conditionSmall ? priceSource : na, "", shape.circle, location.absolute, gradientColor, 0, "", na, size=size.small)
plotshape(conditionNormal? priceSource : na, "", shape.circle, location.absolute, gradientColor, 0, "", na, size=size.normal)
plotshape(conditionLarge ? priceSource : na, "", shape.square, location.absolute, gradientColor, 0, "", na, size=size.normal)
plotshape(conditionHuge ? priceSource : na, "", shape.diamond, location.absolute, gradientColor, 0, "", na, size=size.huge)
// Manage the number of lines and labels on the chart
a_allLines = line.all
if array.size(a_allLines) > levelsCount
line.delete(array.shift(a_allLines))
a_allLabels = label.all
if array.size(a_allLabels) > levelsCount and not showBubbles
label.delete(array.shift(a_allLabels))
// Warning if no Volume data Provided
if ta.cum(volume) <= 0 and barstate.islast
label.new(bar_index, hl2, "No Volume Data Available Use Another Symbol",
style=label.style_label_left,
textcolor=chart.fg_color)
// Volume Profile Functions
get_label_size(x) =>
result = switch x
'Auto' => size.auto
'Tiny' => size.tiny
'Small' => size.small
'Normal' => size.normal
'Large' => size.large
'Huge' => size.huge
get_hvn() =>
if values.size() > hvn_strength
for i = 0 to values.size() - 1
start = values.get(i)
valid = true
for j = -hvn_strength to hvn_strength
k = i + j
if k < 0 or k > values.size() - 1
continue
else
if j != 0 and values.get(k) > start
valid := false
break
if valid
idx = values.indexof(start)
if idx != -1
y1 = y_vol.get(idx)
y2 = y_vol.get(idx)
val = y_vol.get(idx)
if i < values.size() - 1
for m = i to values.size() - 2
if values.get(m + 1) > values.get(m)
y1 := y_vol.get(m)
break
if i > 0
for m = i to 1
if values.get(m - 1) > values.get(m)
y2 := y_vol.get(m)
break
new_color = close > math.avg(y1, y2) ? hvn_color_bull : hvn_color_bear
if hvn_type == "Levels"
if hvn_Ly.indexof(val) == -1
hvn_Ly.unshift(val)
hvn_lines.unshift(line.new(time, val, time + timeframe.in_seconds(tf)*1000, val, xloc = xloc.bar_time, color = color.new(new_color, 0), style = start == values.max() ? line.style_solid : line.style_dotted, width = hvn_width))
else
if hvn_By.indexof(y1) == -1
hvn_By.unshift(y1)
hvn_boxes.unshift(box.new(time, y1, time + timeframe.in_seconds(tf)*1000, y2, xloc = xloc.bar_time, bgcolor = new_color, border_color = na))
ltf := timeframe.in_seconds(ltf) <= timeframe.in_seconds() ? ltf : ""
= request.security_lower_tf(syminfo.tickerid, ltf, )
if not na(lb_idx)
lb = bar_index - lb_idx > 0 ? (bar_index - lb_idx) : 1
y_max = ta.highest(high , lb)
y_min = ta.lowest(low , lb)
if timeframe.change(tf) or barstate.islast
x_vol.clear()
y_vol.clear()
values.clear()
for i = 0 to rows
y = y_min + i * (y_max - y_min) / rows
x_vol.push(lb_time)
y_vol.push(y)
values.push(0)
for i = bar_index - lb_idx to 1
vol = ltf_V ,
if vol.size() > 0
for j = 0 to values.size() - 1
temp = y_vol.get(j)
for k = 0 to vol.size() - 1
H = ltf_H
L = ltf_L
V = ltf_V
if H.get(k) >= temp and L.get(k) <= temp
add = math.floor(V.get(k) / ((H.get(k) - L.get(k)) / (y_max - y_min) / rows))
values.set(j, values.get(j) + add)
max_y = y_vol.get(values.indexof(values.max()))
sf = values.max() / (time - lb_time) / (extend / 100)
for j = 0 to values.size() - 1
set = (lb_time + math.floor(values.get(j) / sf))
x_vol.set(j, set)
PLA.clear()
PLA.push(chart.point.from_time(lb_time, y_min))
for i = 0 to x_vol.size() - 1
PLA.push(chart.point.from_time(x_vol.get(i), y_vol.get(i)))
PLA.push(chart.point.from_time(lb_time, y_max))
PL.delete()
if timeframe.change(tf)
polyline.new(PLA, curved = false, closed = true, line_color = vp_color, fill_color = vp_color, xloc = xloc.bar_time)
temp_vpoc.delete()
vpoc.unshift(line.new(lb_time, max_y, time, max_y, xloc = xloc.bar_time, color = show_vpoc ? vpoc_color : na, extend = ext_vpoc ? extend.right : extend.none, width = vpoc_width))
if ext_vpoc and timeframe.in_seconds(tf) >= timeframe.in_seconds(vpoc_label_above)
dates.unshift(label.new(bar_index, max_y, str.format("{0,date,short}", time("", session = "0000-0000", timezone = "America/New_York")), textcolor = show_vpoc ? vpoc_color : na, color = na, size = get_label_size(vpoc_label_size)))
else
PL := polyline.new(PLA, curved = false, closed = true, line_color = vp_color, fill_color = vp_color, xloc = xloc.bar_time)
if na(temp_vpoc)
temp_vpoc := line.new(lb_time, max_y, time, max_y, xloc = xloc.bar_time, color = show_vpoc ? vpoc_color : na, extend = ext_vpoc ? extend.right : extend.none, width = vpoc_width)
temp_vpoc.set_y1(max_y)
temp_vpoc.set_y2(max_y)
temp_vpoc.set_x2(time)
if timeframe.change(tf)
lb_idx := bar_index
lb_time := time
if show_hvn
hvn_lines.clear()
hvn_boxes.clear()
hvn_Ly.clear()
hvn_By.clear()
get_hvn()
if ext_vpoc and vpoc.size() > ext_n_vpoc
line.set_extend(vpoc.pop(), extend.none)
if timeframe.in_seconds(tf) >= timeframe.in_seconds(vpoc_label_above)
label.delete(dates.pop())
if dates.size() > 0
for i = 0 to dates.size() - 1
dates.get(i).set_x(bar_index + 20)
//@version=5 indicator("Supply and Demand Zones with Reversal Pa//@version=5 indicator("Supply and Demand Zones with Reversal Pa with shahidi
Williams %R with Dual EMAThis script enhances the traditional Williams %R oscillator by adding two exponential moving averages (EMAs) to identify overbought and oversold conditions more effectively