High Volume Points from BigBeluga updated scriptThank you Bigbeluga for this amazing code. I have updated the code little bit to add alerts and also to allow user to adjust setting of selection of left bar and right bar in settings.
The High Volume Points script from BigBeluga is designed to detect significant price levels (pivots) on a chart that occur alongside high trading volumes. These points can be potential areas for reversals or key support/resistance levels. The script plots circles at pivot points and allows for visual analysis of these significant price levels in conjunction with volume.
This can help traders identify critical points in the market where the price might reverse or consolidate, particularly when high volume is present, indicating strong market participation.
Main Features of the Script:
Pivot Points Detection:
The script identifies pivot highs and pivot lows. A pivot high is a point where the price is higher than its neighboring bars, and a pivot low is where the price is lower than its neighboring bars.
These pivots are calculated using a user-defined number of bars to the left and right of the pivot (controlled by the leftBars and rightBars input).
Volume Filtering:
The script filters pivots by volume. Only pivots that occur when the volume exceeds a certain threshold (set by the filter_vol input) are plotted and considered significant.
Volume is normalized to a scale of 0 to 6, based on its percentile rank relative to the recent historical volumes.
Visual Aids:
Circles are drawn around the pivot points to make them easy to spot. These circles' size and position depend on the volume and proximity to the pivot.
The script uses different colors for pivot highs and pivot lows (defined by upper_col for highs and lower_col for lows) to differentiate between the two types of pivots.
The script also draws levels (lines) at pivot highs and lows, which extend indefinitely to the right of the chart to highlight key support or resistance zones.
Dynamic Line Widths:
The width of the lines drawn at the pivots is dynamically adjusted based on the normalized volume, providing an indication of how significant the volume is relative to the overall market.
Volume Threshold:
The script compares the current volume to a reference volume (the 95th percentile of volume over the lookback period). This comparison determines whether the volume is considered "high" and therefore worthy of highlighting on the chart.
Alerts:
Alert conditions are set up to notify you when significant events happen on the chart, such as:
When a pivot high occurs with high volume.
When a pivot low occurs with high volume.
When any point with high volume is detected (not necessarily a pivot).
These alerts help you stay informed in real-time when key price points and volume surges happen.
Usage Instructions:
How to Use the Script:
Set the Script on the Chart:
After copying and pasting the script into the Pine Script editor in TradingView, add the indicator to your chart.
Visualizing Key Points:
Once the script is running on your chart, it will start plotting circles at the locations of detected pivot highs and pivot lows, with the size of the circle representing the volume of that bar relative to recent volume.
The circles are drawn in different colors for pivot highs and lows, making it easy to distinguish between them.
Lines will be drawn at the detected pivot points, extending indefinitely to the right, providing potential support or resistance levels.
Adjusting Settings (If Desired):
The script allows you to adjust several input parameters to customize its behavior:
Diameter Of Circles (step): Controls the size of the circles plotted around the pivots.
Filter Points by Volume (filter_vol): Sets the minimum volume level for a pivot to be plotted.
Length: Controls how many bars to consider on the left and right of a pivot when detecting pivot points.
Show Levels (show_lvl): Toggle whether or not the levels (lines) are displayed on the chart.
Adjusting these settings allows you to fine-tune how sensitive the script is to volume and how much historical data is considered in detecting pivots.
Alerts:
To set up alerts, click on the Alerts button (the alarm clock icon) in TradingView.
Create a new alert and select one of the following conditions:
Pivot High with High Volume: Triggers when a pivot high with high volume is detected.
Pivot Low with High Volume: Triggers when a pivot low with high volume is detected.
High Volume Point: Triggers when any high volume point (pivot or not) is detected.
Choose the notification method (e.g., pop-up, email, webhook, etc.), and the alert will notify you when the condition is met.
Example Use Case:
Trend Reversal Confirmation: If you're analyzing a bullish trend, a sudden pivot high with high volume could indicate a potential trend reversal or resistance point. Similarly, a pivot low with high volume could indicate a potential support level.
Volume Surge Detection: High volume points not necessarily related to a pivot could indicate unusual market activity. By setting up alerts for high-volume points, you can be alerted when the market is showing unusual participation, which might signify important upcoming price movements.
Final Thoughts:
This script is primarily designed to help traders spot significant price levels (pivots) along with the volume that validates these levels. It's a useful tool for identifying potential reversal points or important support and resistance areas. By using the alerts, you can automate the process of monitoring these levels and volume surges, ensuring you don't miss important opportunities.
Indicators and strategies
Simple Breakout + EMA 9Overview
This technical indicator is designed to identify potential entry points in trending markets by combining EMA (Exponential Moving Average) crossovers with price action confirmation. The indicator works across all timeframes and is particularly effective in capturing the beginning of strong trend movements.
Technical Components
Key Components
-- made by @immortaltraderA on twitter --
EMA9 (9-period Exponential Moving Average)
Price action analysis
Lower high pattern recognition
Closing price confirmation
Entry Conditions
The indicator generates a buy signal when ALL of the following conditions are met in sequence:
Price moves above the EMA9
A lower high forms after the initial EMA9 crossover
Price breaks above the lower high
First signal confirmation after these conditions are met
Exit Conditions
The position should be closed when:
Price closes below the EMA9
Must wait for the candle to complete its close for confirmation
Implementation Guidelines
Signal Generation Process
Monitor EMA9 crossovers
After an upward crossover, track price action for lower high formation
When a lower high is broken, generate entry signal
Monitor closing prices relative to EMA9 for exit signals
Risk Management
Entry Points:
Wait for candle close above the breakout level
Confirm volume is supporting the movement
Stop Loss Considerations:
Consider placing stops below the most recent swing low
Alternative: Place stop below the EMA9 with buffer
Position Sizing:
Base position size on the distance to stop loss
Consider using fixed risk percentage per trade
Red & Green Zone ReversalOverview
The “Red & Green Zone Reversal” indicator is designed to visually highlight potential reversal zones on your chart by using a combination of Bollinger Bands and the Relative Strength Index (RSI).
It overlays on the chart and provides background color cues—red for oversold conditions and green for overbought conditions—along with corresponding alert triggers.
Key Components
Overlay: The indicator is set to overlay the chart, meaning its visual cues (colored backgrounds) are drawn directly on the price chart.
Bollinger Bands Calculation
Period: A 20-period simple moving average (SMA) is calculated from the closing prices.
Standard Deviation Multiplier: A multiplier of 2.0 is applied.
Bands Defined:
Basis: The 20-period SMA.
Deviation: Calculated as 2 times the standard deviation over the same period.
Upper Band: Basis plus the deviation.
Lower Band: Basis minus the deviation.
RSI Calculation
Period: The RSI is computed over a 14-period span using the closing prices.
Thresholds:
Oversold Threshold: 30 (used for the red zone condition).
Overbought Threshold: 70 (used for the green zone condition).
Zone Conditions
Red Zone (Oversold):
Criteria: The price is below the lower Bollinger Band and the RSI is below 30.
Purpose: Highlights a situation where the asset may be deeply oversold, signaling a potential reversal to the upside.
Green Zone (Overbought):
Criteria: The price is above the upper Bollinger Band and the RSI is above 70.
Purpose: Indicates that the asset may be overbought, potentially signaling a reversal to the downside.
Visual and Alert Components
Background Coloring:
Red Background: Applied when the red zone condition is met (using a semi-transparent red).
Green Background: Applied when the green zone condition is met (using a semi-transparent green).
Alerts:
Red Alert: An alert condition titled “Deep Oversold Alert” is triggered with the message “Deep Oversold Signal triggered!” when the red zone criteria are satisfied.
Green Alert: Similarly, an alert condition titled “Deep Overbought Alert” is triggered with the message “Deep Overbought Signal triggered!” when the green zone criteria are met.
Important Disclaimers
Not Financial Advice:
This indicator is provided for informational and analytical purposes only. It does not constitute trading advice or a recommendation to buy or sell any asset. Traders should use it as one of several tools in their analysis and should perform their own due diligence.
Risk Management:
Trading inherently involves risk. Past performance is not indicative of future results. Always implement appropriate risk management and use stop losses where necessary.
Summary
In summary, the “Red & Green Zone Reversal” indicator uses Bollinger Bands and RSI to detect extreme market conditions. It visually marks oversold (red) and overbought (green) conditions directly on the chart and offers alert conditions to help traders monitor these potential reversal points.
Enjoy!!
Sector/Industry Relative StrengthOverview
The Sector/Industry Relative Strength (RS) Indicator is a powerful tool designed to help traders and investors analyze the performance of sectors and industries relative to the broader market (SPY). It provides real-time insights into sector and industry strength, helping you identify leading and lagging areas of the market.
Key Features
Sector and Industry Analysis:
Automatically detects the sector and industry of the current symbol.
Displays the corresponding sector and industry ETF.
Relative Strength (STS) Calculation:
Calculates the Sector/Industry Trend Strength (STS) by comparing the sector or industry ETF to SPY over the past 20 days.
STS is expressed as a percentile (0-100), indicating how strong the sector/industry ETF has been relative to SPY over the past 20 days.
Example: An STS of 70 means that during the past 20 days, the ETF’s relative strength against SPY was stronger than 70% of those days.
Sector Rank:
Ranks the current sector ETF against a predefined list of major sector ETFs.
Highlights whether the sector is outperforming or underperforming SPY (green if outperforming, red if underperforming).
Customizable Display:
Choose which elements to display (e.g., sector, industry, ETFs, STS, sector rank).
Customize table position, size, text alignment, and colors.
Real-Time Performance:
Tracks daily price changes for sector and industry ETFs.
Displays percentage change from open to close.
How to Use
Add the Indicator:
Apply the indicator to any stock or ETF chart.
The script will automatically detect the sector and industry of the selected symbol.
Interpret the Data:
Sector/Industry: Displays the current sector and industry.
ETF: Shows the corresponding sector and industry ETF.
STS (Sector/Industry Trend Strength): A percentile score (0-100) indicating the relative strength of the sector/industry ETF compared to SPY over the past 20 days.
Sector Rank: Ranks the sector ETF against other major sectors (e.g., "3/12" means the sector is ranked 3rd out of 12).
Customize the Display:
Use the input settings to:
Show/hide specific elements (e.g., sector, industry, ETFs, STS, sector rank).
Adjust the table position, size, and text alignment.
Change colors for positive/negative changes.
Make Informed Decisions:
Use the STS score and sector rank to identify potential trading opportunities.
Focus on sectors and industries with high STS scores and strong rankings (green).
Input Parameters
Table Settings:
Table Position: Choose where to display the table (Top Left, Top Right, Bottom Left, Bottom Right).
Table Size: Adjust the size of the table (Tiny, Small, Normal, Large).
Text Color: Customize the text color.
Background Color: Set the table background color.
Display Options:
Show ETFs: Toggle the display of sector and industry ETFs.
Show STS: Toggle the display of the Sector/Industry Trend Strength (STS) score.
Show Sector/Industry: Toggle the display of sector and industry information.
Show Sector Rank: Toggle the display of the sector rank.
Parameters:
Sector Rank Time Length: Set the number of days used for calculating the sector rank (default: 20).
Example Use Cases
Sector Rotation:
Identify sectors with high STS scores and strong rankings (green) to allocate capital.
Avoid sectors with low STS scores and weak rankings (red).
Industry Analysis:
Compare the STS scores of different industries within the same sector.
Use the STS score to gauge relative strength and identify potential opportunities.
Market Timing:
Use the STS score and sector rank to time entries and exits in sector-specific ETFs.
Combine with other technical indicators for confirmation.
Peak Reaction Zones by BigBeluga updated script with alerts Peak Reaction Zones Script - Description and Usage
Thanks to BIgBeluga for this script. I have added alert function to this script and change default setting parameters, which I think works better in 15 min chart, however user can play and update setting as per user requirements.
This Pine Script is designed to help traders identify potential breakout zones in the market. It automatically calculates reaction zones based on the highest and lowest prices over a specified lookback period. These zones can then be used as references to track significant price movements, with alerts for when breakouts occur.
The script plots two reaction zones:
High Zone (Orange): The upper level defined by the highest price over a specified lookback period.
Low Zone (Blue): The lower level defined by the lowest price over a specified lookback period.
Additionally, alerts are triggered when price breaks above or below these zones, providing real-time notifications of potential market movements.
Key Inputs:
Lookback Period (lookback):
This input determines the number of bars (periods) to look back for calculating the highest and lowest prices.
Default: 72
Zone Width Multiplier (multiplier):
This input is a multiplier that adjusts the width of the zones based on the Average True Range (ATR). A higher multiplier widens the zone.
Default: 1
High Zone Color (high_col):
The color of the high zone, typically orange for the upper zone.
Default: orange
Low Zone Color (low_col):
The color of the low zone, typically blue for the lower zone.
Default: blue
How the Script Works:
Zone Calculation:
The script calculates the highest and lowest prices over a user-defined lookback period.
These prices define the high zone and low zone, respectively.
The width of each zone is adjusted using the ATR (Average True Range) and the multiplier input.
Plotting the Zones:
Once the zones are calculated, the script plots two horizontal lines representing the high zone (upper) and low zone (lower).
Dashed lines are also drawn to show the boundaries of the zones, and labels display the price values for both zones.
Set Alerts:
You can set alerts in TradingView based on the alert conditions that are programmed in the script.
Set Alerts:
Right-click on the chart and select "Add Alert."
In the "Condition" field, choose the alert options related to your script, such as:
"Price broke above the low zone"
"Price broke below the high zone"
Choose your preferred alert frequency (e.g., "Once per bar").
Set your notification method (e.g., pop-up, email, webhook).
Click "Create" to set up the alert.
Adjust the Settings:
You can modify the lookback period and multiplier to change the sensitivity of the zones.
Change the colors for the high zone and low zone for better visibility if needed.
Monitor Breakouts:
The script will plot the zones and create labels whenever a breakout occurs, and alerts will trigger when the price crosses the zones as described.
Pivot Points High Low & Missed Reversal Levels [LuxAlgo]//@version=5
indicator("Pivot Points High Low & Missed Reversal Levels ", overlay=true, max_labels_count=500, max_lines_count=500, max_bars_back=500)
length = input(50, 'Pivot Length')
show_reg = input.bool(true, 'Regular Pivots', inline='inline1')
reg_ph_css = input.color(#ef5350, 'High', inline='inline1')
reg_pl_css = input.color(#26a69a, 'Low', inline='inline1')
show_miss = input.bool(true, 'Missed Pivots', inline='inline2')
miss_ph_css = input.color(#ef5350, 'High', inline='inline2')
miss_pl_css = input.color(#26a69a, 'Low', inline='inline2')
label_css = input.color(color.white, 'Text Label Color')
// Initialize variables
var line zigzag = na
var line ghost_level = na
var max = 0., var min = 0.
var max_x1 = 0, var min_x1 = 0
var follow_max = 0., var follow_max_x1 = 0
var follow_min = 0., var follow_min_x1 = 0
var os = 0, var py1 = 0., var px1 = 0
// Pivot calculations
n = bar_index
ph = ta.pivothigh(length, length)
pl = ta.pivotlow(length, length)
max := math.max(high , max)
min := math.min(low , min)
follow_max := math.max(high , follow_max)
follow_min := math.min(low , follow_min)
if max > max
max_x1 := n-length
follow_min := low
if min < min
min_x1 := n-length
follow_max := high
if follow_min < follow_min
follow_min_x1 := n-length
if follow_max > follow_max
follow_max_x1 := n-length
// Line and label updates
line.set_x2(ghost_level , n)
if ph
if show_miss
if os == 1
label.new(min_x1, min, '👻', color=miss_pl_css, style=label.style_label_up, size=size.small,
tooltip=str.tostring(min, '#.####'))
zigzag := line.new(px1, py1, min_x1, min, color=miss_ph_css, style=line.style_dashed)
px1 := min_x1, py1 := min
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_pl_css, 50), width=2)
else if ph < max
label.new(max_x1, max, '👻', color=miss_ph_css, style=label.style_label_down, size=size.small,
tooltip=str.tostring(max, '#.####'))
label.new(follow_min_x1, follow_min, '👻', color=miss_pl_css, style=label.style_label_up, size=size.small,
tooltip=str.tostring(min, '#.####'))
zigzag := line.new(px1, py1, max_x1, max, color=miss_pl_css, style=line.style_dashed)
px1 := max_x1, py1 := max
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_ph_css, 50), width=2)
zigzag := line.new(px1, py1, follow_min_x1, follow_min, color=miss_ph_css, style=line.style_dashed)
px1 := follow_min_x1, py1 := follow_min
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_pl_css, 50), width=2)
if show_reg
label.new(n-length, ph, '▼', textcolor=label_css, color=reg_ph_css, style=label.style_label_down, size=size.small,
tooltip=str.tostring(ph, '#.####'))
zigzag := line.new(px1, py1, n-length, ph, color=miss_pl_css, style=ph < max or os == 1 ? line.style_dashed : line.style_solid)
py1 := ph, px1 := n-length, os := 1, max := ph, min := ph
if pl
if show_miss
if os == 0
label.new(max_x1, max, '👻', color=miss_ph_css, style=label.style_label_down, size=size.small,
tooltip=str.tostring(max, '#.####'))
zigzag := line.new(px1, py1, max_x1, max, color=miss_pl_css, style=line.style_dashed)
px1 := max_x1, py1 := max
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_ph_css, 50), width=2)
else if pl > min
label.new(follow_max_x1, follow_max, '👻', color=miss_ph_css, style=label.style_label_down, size=size.small,
tooltip=str.tostring(max, '#.####'))
label.new(min_x1, min, '👻', color=miss_pl_css, style=label.style_label_up, size=size.small,
tooltip=str.tostring(min, '#.####'))
zigzag := line.new(px1, py1, min_x1, min, color=miss_ph_css, style=line.style_dashed)
px1 := min_x1, py1 := min
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_pl_css, 50), width=2)
zigzag := line.new(px1, py1, follow_max_x1, follow_max, color=miss_ph_css, style=line.style_dashed)
px1 := follow_max_x1, py1 := follow_max
if not na(ghost_level)
line.delete(ghost_level)
ghost_level := line.new(px1, py1, px1, py1, color=color.new(reg_pl_css, 50), width=2)
if show_reg
label.new(n-length, pl, '▲', textcolor=label_css, color=reg_pl_css, style=label.style_label_up, size=size.small,
tooltip=str.tostring(pl, '#.####'))
zigzag := line.new(px1, py1, n-length, pl, color=miss_ph_css, style=pl > min or os == 0 ? line.style_dashed : line.style_solid)
py1 := pl, px1 := n-length, os := 0, max := pl, min := pl
// Handle last bar
var label lbl = na
if barstate.islast
x = 0, y = 0.
prices = array.new_float(0)
prices_x = array.new_int(0)
for i = 0 to n-px1-1
array.push(prices, os == 1 ? low : high )
array.push(prices_x, n-i)
if not na(lbl)
label.delete(lbl)
if os == 1
y := array.min(prices)
x := array.get(prices_x, array.indexof(prices, y))
if show_miss
lbl := label.new(x, y, '👻', color=miss_pl_css, style=label.style_label_up, size=size.small,
tooltip=str.tostring(y, '#.####'))
else
y := array.max(prices)
x := array.get(prices_x, array.indexof(prices, y))
if show_miss
lbl := label.new(x, y, '👻', color=miss_ph_css, style=label.style_label_down, size=size.small,
tooltip=str.tostring(y, '#.####'))
if show_miss
line.delete(line.new(px1, py1, x, y, color=os == 1 ? miss_ph_css : miss_pl_css, style=line.style_dashed) )
line.delete(line.new(x, y, n, y, color=color.new(os == 1 ? miss_ph_css : miss_pl_css, 50), width=2) )
SOC AI 2.0The SOC AI 2.0 indicator is designed as a tool to assist traders in analyzing market trends and making informed decisions. It incorporates advanced algorithms and methodologies to provide insights based on historical market data.
Important Notes:
Not Financial Advice: The insights and signals generated by this indicator are for informational purposes only. They should not be considered financial, investment, or trading advice.
Risk of Loss: Trading and investing involve significant risk of loss. Users should conduct their own research, consult with a professional advisor, and only trade with funds they can afford to lose.
No Guarantee of Performance: Past performance of the indicator or any market is not indicative of future results. The accuracy of the signals and forecasts cannot be guaranteed.
User Responsibility: The final decision to trade, buy, or sell lies solely with the user. The creators of SOC AI 2.0 are not responsible for any financial losses incurred.
By using this indicator, you acknowledge and accept these terms and agree to trade responsibly. For optimal use, consider combining SOC AI 2.0 with complementary tools such as RSI, Stochastic RSI, and volume indicator .
Happy trading!
Revenue & Net IncomeRevenue & Net Income Indicator
This indicator provides a clear visual representation of a company's revenue and net income, with the flexibility to switch between Trailing Twelve Months (TTM) and Quarterly data. Values are automatically converted into billions and displayed in both an area chart and a dynamic table.
Features:
TTM & Quarterly Data: Easily toggle between financial periods.
Intuitive Visuals: Semi-transparent area charts make trends easy to spot.
Smart Number Formatting: Revenue below 1B is shown with two decimals (e.g., "0.85B"), while larger values use one decimal (e.g., "1.2B").
Customizable Table: Displays the most recent revenue and net income figures, with adjustable position and text size.
Light Mode: Switch table text to black with a white header for better readability on light backgrounds.
This indicator is freely available and open-source on TradingView for all. It is designed to help traders enhance their market analysis and strategic decision-making.
Squeeze Momentum Indicator Strategy [LazyBear + PineIndicators]The Squeeze Momentum Indicator Strategy (SQZMOM_LB Strategy) is an automated trading strategy based on the Squeeze Momentum Indicator developed by LazyBear, which itself is a modification of John Carter's "TTM Squeeze" concept from his book Mastering the Trade (Chapter 11). This strategy is designed to identify low-volatility phases in the market, which often precede explosive price movements, and to enter trades in the direction of the prevailing momentum.
Concept & Indicator Breakdown
The strategy employs a combination of Bollinger Bands (BB) and Keltner Channels (KC) to detect market squeezes:
Squeeze Condition:
When Bollinger Bands are inside the Keltner Channels (Black Crosses), volatility is low, signaling a potential upcoming price breakout.
When Bollinger Bands move outside Keltner Channels (Gray Crosses), the squeeze is released, indicating an expansion in volatility.
Momentum Calculation:
A linear regression-based momentum value is used instead of traditional momentum indicators.
The momentum histogram is color-coded to show strength and direction:
Lime/Green: Increasing bullish momentum
Red/Maroon: Increasing bearish momentum
Signal Colors:
Black: Market is in a squeeze (low volatility).
Gray: Squeeze is released, and volatility is expanding.
Blue: No squeeze condition is present.
Strategy Logic
The script uses historical volatility conditions and momentum trends to generate buy/sell signals and manage positions.
1. Entry Conditions
Long Position (Buy)
The squeeze just released (Gray Cross after Black Cross).
The momentum value is increasing and positive.
The momentum is at a local low compared to the past 100 bars.
The price is above the 100-period EMA.
The closing price is higher than the previous close.
Short Position (Sell)
The squeeze just released (Gray Cross after Black Cross).
The momentum value is decreasing and negative.
The momentum is at a local high compared to the past 100 bars.
The price is below the 100-period EMA.
The closing price is lower than the previous close.
2. Exit Conditions
Long Exit:
The momentum value starts decreasing (momentum lower than previous bar).
Short Exit:
The momentum value starts increasing (momentum higher than previous bar).
Position Sizing
Position size is dynamically adjusted based on 8% of strategy equity, divided by the current closing price, ensuring risk-adjusted trade sizes.
How to Use This Strategy
Apply on Suitable Markets:
Best for stocks, indices, and forex pairs with momentum-driven price action.
Works on multiple timeframes but is most effective on higher timeframes (1H, 4H, Daily).
Confirm Entries with Additional Indicators:
The author recommends ADX or WaveTrend to refine entries and avoid false signals.
Risk Management:
Since the strategy dynamically sizes positions, it's advised to use stop-losses or risk-based exits to avoid excessive drawdowns.
Final Thoughts
The Squeeze Momentum Indicator Strategy provides a systematic approach to trading volatility expansions, leveraging the classic TTM Squeeze principles with a unique linear regression-based momentum calculation. Originally inspired by John Carter’s method, LazyBear's version and this strategy offer a refined, adaptable tool for traders looking to capitalize on market momentum shifts.
ValueAtTime█ OVERVIEW
This library is a Pine Script® programming tool for accessing historical values in a time series using UNIX timestamps . Its data structure and functions index values by time, allowing scripts to retrieve past values based on absolute timestamps or relative time offsets instead of relying on bar index offsets.
█ CONCEPTS
UNIX timestamps
In Pine Script®, a UNIX timestamp is an integer representing the number of milliseconds elapsed since January 1, 1970, at 00:00:00 UTC (the UNIX Epoch ). The timestamp is a unique, absolute representation of a specific point in time. Unlike a calendar date and time, a UNIX timestamp's meaning does not change relative to any time zone .
This library's functions process series values and corresponding UNIX timestamps in pairs , offering a simplified way to identify values that occur at or near distinct points in time instead of on specific bars.
Storing and retrieving time-value pairs
This library's `Data` type defines the structure for collecting time and value information in pairs. Objects of the `Data` type contain the following two fields:
• `times` – An array of "int" UNIX timestamps for each recorded value.
• `values` – An array of "float" values for each saved timestamp.
Each index in both arrays refers to a specific time-value pair. For instance, the `times` and `values` elements at index 0 represent the first saved timestamp and corresponding value. The library functions that maintain `Data` objects queue up to one time-value pair per bar into the object's arrays, where the saved timestamp represents the bar's opening time .
Because the `times` array contains a distinct UNIX timestamp for each item in the `values` array, it serves as a custom mapping for retrieving saved values. All the library functions that return information from a `Data` object use this simple two-step process to identify a value based on time:
1. Perform a binary search on the `times` array to find the earliest saved timestamp closest to the specified time or offset and get the element's index.
2. Access the element from the `values` array at the retrieved index, returning the stored value corresponding to the found timestamp.
Value search methods
There are several techniques programmers can use to identify historical values from corresponding timestamps. This library's functions include three different search methods to locate and retrieve values based on absolute times or relative time offsets:
Timestamp search
Find the value with the earliest saved timestamp closest to a specified timestamp.
Millisecond offset search
Find the value with the earliest saved timestamp closest to a specified number of milliseconds behind the current bar's opening time. This search method provides a time-based alternative to retrieving historical values at specific bar offsets.
Period offset search
Locate the value with the earliest saved timestamp closest to a defined period offset behind the current bar's opening time. The function calculates the span of the offset based on a period string . The "string" must contain one of the following unit tokens:
• "D" for days
• "W" for weeks
• "M" for months
• "Y" for years
• "YTD" for year-to-date, meaning the time elapsed since the beginning of the bar's opening year in the exchange time zone.
The period string can include a multiplier prefix for all supported units except "YTD" (e.g., "2W" for two weeks).
Note that the precise span covered by the "M", "Y", and "YTD" units varies across time. The "1M" period can cover 28, 29, 30, or 31 days, depending on the bar's opening month and year in the exchange time zone. The "1Y" period covers 365 or 366 days, depending on leap years. The "YTD" period's span changes with each new bar, because it always measures the time from the start of the current bar's opening year.
█ CALCULATIONS AND USE
This library's functions offer a flexible, structured approach to retrieving historical values at or near specific timestamps, millisecond offsets, or period offsets for different analytical needs.
See below for explanations of the exported functions and how to use them.
Retrieving single values
The library includes three functions that retrieve a single stored value using timestamp, millisecond offset, or period offset search methods:
• `valueAtTime()` – Locates the saved value with the earliest timestamp closest to a specified timestamp.
• `valueAtTimeOffset()` – Finds the saved value with the earliest timestamp closest to the specified number of milliseconds behind the current bar's opening time.
• `valueAtPeriodOffset()` – Finds the saved value with the earliest timestamp closest to the period-based offset behind the current bar's opening time.
Each function has two overloads for advanced and simple use cases. The first overload searches for a value in a user-specified `Data` object created by the `collectData()` function (see below). It returns a tuple containing the found value and the corresponding timestamp.
The second overload maintains a `Data` object internally to store and retrieve values for a specified `source` series. This overload returns a tuple containing the historical `source` value, the corresponding timestamp, and the current bar's `source` value, making it helpful for comparing past and present values from requested contexts.
Retrieving multiple values
The library includes the following functions to retrieve values from multiple historical points in time, facilitating calculations and comparisons with values retrieved across several intervals:
• `getDataAtTimes()` – Locates a past `source` value for each item in a `timestamps` array. Each retrieved value's timestamp represents the earliest time closest to one of the specified timestamps.
• `getDataAtTimeOffsets()` – Finds a past `source` value for each item in a `timeOffsets` array. Each retrieved value's timestamp represents the earliest time closest to one of the specified millisecond offsets behind the current bar's opening time.
• `getDataAtPeriodOffsets()` – Finds a past value for each item in a `periods` array. Each retrieved value's timestamp represents the earliest time closest to one of the specified period offsets behind the current bar's opening time.
Each function returns a tuple with arrays containing the found `source` values and their corresponding timestamps. In addition, the tuple includes the current `source` value and the symbol's description, which also makes these functions helpful for multi-interval comparisons using data from requested contexts.
Processing period inputs
When writing scripts that retrieve historical values based on several user-specified period offsets, the most concise approach is to create a single text input that allows users to list each period, then process the "string" list into an array for use in the `getDataAtPeriodOffsets()` function.
This library includes a `getArrayFromString()` function to provide a simple way to process strings containing comma-separated lists of periods. The function splits the specified `str` by its commas and returns an array containing every non-empty item in the list with surrounding whitespaces removed. View the example code to see how we use this function to process the value of a text area input .
Calculating period offset times
Because the exact amount of time covered by a specified period offset can vary, it is often helpful to verify the resulting times when using the `valueAtPeriodOffset()` or `getDataAtPeriodOffsets()` functions to ensure the calculations work as intended for your use case.
The library's `periodToTimestamp()` function calculates an offset timestamp from a given period and reference time. With this function, programmers can verify the time offsets in a period-based data search and use the calculated offset times in additional operations.
For periods with "D" or "W" units, the function calculates the time offset based on the absolute number of milliseconds the period covers (e.g., `86400000` for "1D"). For periods with "M", "Y", or "YTD" units, the function calculates an offset time based on the reference time's calendar date in the exchange time zone.
Collecting data
All the `getDataAt*()` functions, and the second overloads of the `valueAt*()` functions, collect and maintain data internally, meaning scripts do not require a separate `Data` object when using them. However, the first overloads of the `valueAt*()` functions do not collect data, because they retrieve values from a user-specified `Data` object.
For cases where a script requires a separate `Data` object for use with these overloads or other custom routines, this library exports the `collectData()` function. This function queues each bar's `source` value and opening timestamp into a `Data` object and returns the object's ID.
This function is particularly useful when searching for values from a specific series more than once. For instance, instead of using multiple calls to the second overloads of `valueAt*()` functions with the same `source` argument, programmers can call `collectData()` to store each bar's `source` and opening timestamp, then use the returned `Data` object's ID in calls to the first `valueAt*()` overloads to reduce memory usage.
The `collectData()` function and all the functions that collect data internally include two optional parameters for limiting the saved time-value pairs to a sliding window: `timeOffsetLimit` and `timeframeLimit`. When either has a non-na argument, the function restricts the collected data to the maximum number of recent bars covered by the specified millisecond- and timeframe-based intervals.
NOTE : All calls to the functions that collect data for a `source` series can execute up to once per bar or realtime tick, because each stored value requires a unique corresponding timestamp. Therefore, scripts cannot call these functions iteratively within a loop . If a call to these functions executes more than once inside a loop's scope, it causes a runtime error.
█ EXAMPLE CODE
The example code at the end of the script demonstrates one possible use case for this library's functions. The code retrieves historical price data at user-specified period offsets, calculates price returns for each period from the retrieved data, and then populates a table with the results.
The example code's process is as follows:
1. Input a list of periods – The user specifies a comma-separated list of period strings in the script's "Period list" input (e.g., "1W, 1M, 3M, 1Y, YTD"). Each item in the input list represents a period offset from the latest bar's opening time.
2. Process the period list – The example calls `getArrayFromString()` on the first bar to split the input list by its commas and construct an array of period strings.
3. Request historical data – The code uses a call to `getDataAtPeriodOffsets()` as the `expression` argument in a request.security() call to retrieve the closing prices of "1D" bars for each period included in the processed `periods` array.
4. Display information in a table – On the latest bar, the code uses the retrieved data to calculate price returns over each specified period, then populates a two-row table with the results. The cells for each return percentage are color-coded based on the magnitude and direction of the price change. The cells also include tooltips showing the compared daily bar's opening date in the exchange time zone.
█ NOTES
• This library's architecture relies on a user-defined type (UDT) for its data storage format. UDTs are blueprints from which scripts create objects , i.e., composite structures with fields containing independent values or references of any supported type.
• The library functions search through a `Data` object's `times` array using the array.binary_search_leftmost() function, which is more efficient than looping through collected data to identify matching timestamps. Note that this built-in works only for arrays with elements sorted in ascending order .
• Each function that collects data from a `source` series updates the values and times stored in a local `Data` object's arrays. If a single call to these functions were to execute in a loop , it would store multiple values with an identical timestamp, which can cause erroneous search behavior. To prevent looped calls to these functions, the library uses the `checkCall()` helper function in their scopes. This function maintains a counter that increases by one each time it executes on a confirmed bar. If the count exceeds the total number of bars, indicating the call executes more than once in a loop, it raises a runtime error .
• Typically, when requesting higher-timeframe data with request.security() while using barmerge.lookahead_on as the `lookahead` argument, the `expression` argument should be offset with the history-referencing operator to prevent lookahead bias on historical bars. However, the call in this script's example code enables lookahead without offsetting the `expression` because the script displays results only on the last historical bar and all realtime bars, where there is no future data to leak into the past. This call ensures the displayed results use the latest data available from the context on realtime bars.
Look first. Then leap.
█ EXPORTED TYPES
Data
A structure for storing successive timestamps and corresponding values from a dataset.
Fields:
times (array) : An "int" array containing a UNIX timestamp for each value in the `values` array.
values (array) : A "float" array containing values corresponding to the timestamps in the `times` array.
█ EXPORTED FUNCTIONS
getArrayFromString(str)
Splits a "string" into an array of substrings using the comma (`,`) as the delimiter. The function trims surrounding whitespace characters from each substring, and it excludes empty substrings from the result.
Parameters:
str (series string) : The "string" to split into an array based on its commas.
Returns: (array) An array of trimmed substrings from the specified `str`.
periodToTimestamp(period, referenceTime)
Calculates a UNIX timestamp representing the point offset behind a reference time by the amount of time within the specified `period`.
Parameters:
period (series string) : The period string, which determines the time offset of the returned timestamp. The specified argument must contain a unit and an optional multiplier (e.g., "1Y", "3M", "2W", "YTD"). Supported units are:
- "Y" for years.
- "M" for months.
- "W" for weeks.
- "D" for days.
- "YTD" (Year-to-date) for the span from the start of the `referenceTime` value's year in the exchange time zone. An argument with this unit cannot contain a multiplier.
referenceTime (series int) : The millisecond UNIX timestamp from which to calculate the offset time.
Returns: (int) A millisecond UNIX timestamp representing the offset time point behind the `referenceTime`.
collectData(source, timeOffsetLimit, timeframeLimit)
Collects `source` and `time` data successively across bars. The function stores the information within a `Data` object for use in other exported functions/methods, such as `valueAtTimeOffset()` and `valueAtPeriodOffset()`. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
source (series float) : The source series to collect. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: (Data) A `Data` object containing collected `source` values and corresponding timestamps over the allowed time range.
method valueAtTime(data, timestamp)
(Overload 1 of 2) Retrieves value and time data from a `Data` object's fields at the index of the earliest timestamp closest to the specified `timestamp`. Callable as a method or a function.
Parameters:
data (series Data) : The `Data` object containing the collected time and value data.
timestamp (series int) : The millisecond UNIX timestamp to search. The function returns data for the earliest saved timestamp that is closest to the value.
Returns: ( ) A tuple containing the following data from the `Data` object:
- The stored value corresponding to the identified timestamp ("float").
- The earliest saved timestamp that is closest to the specified `timestamp` ("int").
valueAtTime(source, timestamp, timeOffsetLimit, timeframeLimit)
(Overload 2 of 2) Retrieves `source` and time information for the earliest bar whose opening timestamp is closest to the specified `timestamp`. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
source (series float) : The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timestamp (series int) : The millisecond UNIX timestamp to search. The function returns data for the earliest bar whose timestamp is closest to the value.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : (simple string) Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple containing the following data:
- The `source` value corresponding to the identified timestamp ("float").
- The earliest bar's timestamp that is closest to the specified `timestamp` ("int").
- The current bar's `source` value ("float").
method valueAtTimeOffset(data, timeOffset)
(Overload 1 of 2) Retrieves value and time data from a `Data` object's fields at the index of the earliest saved timestamp closest to `timeOffset` milliseconds behind the current bar's opening time. Callable as a method or a function.
Parameters:
data (series Data) : The `Data` object containing the collected time and value data.
timeOffset (series int) : The millisecond offset behind the bar's opening time. The function returns data for the earliest saved timestamp that is closest to the calculated offset time.
Returns: ( ) A tuple containing the following data from the `Data` object:
- The stored value corresponding to the identified timestamp ("float").
- The earliest saved timestamp that is closest to `timeOffset` milliseconds before the current bar's opening time ("int").
valueAtTimeOffset(source, timeOffset, timeOffsetLimit, timeframeLimit)
(Overload 2 of 2) Retrieves `source` and time information for the earliest bar whose opening timestamp is closest to `timeOffset` milliseconds behind the current bar's opening time. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
source (series float) : The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timeOffset (series int) : The millisecond offset behind the bar's opening time. The function returns data for the earliest bar's timestamp that is closest to the calculated offset time.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple containing the following data:
- The `source` value corresponding to the identified timestamp ("float").
- The earliest bar's timestamp that is closest to `timeOffset` milliseconds before the current bar's opening time ("int").
- The current bar's `source` value ("float").
method valueAtPeriodOffset(data, period)
(Overload 1 of 2) Retrieves value and time data from a `Data` object's fields at the index of the earliest timestamp closest to a calculated offset behind the current bar's opening time. The calculated offset represents the amount of time covered by the specified `period`. Callable as a method or a function.
Parameters:
data (series Data) : The `Data` object containing the collected time and value data.
period (series string) : The period string, which determines the calculated time offset. The specified argument must contain a unit and an optional multiplier (e.g., "1Y", "3M", "2W", "YTD"). Supported units are:
- "Y" for years.
- "M" for months.
- "W" for weeks.
- "D" for days.
- "YTD" (Year-to-date) for the span from the start of the current bar's year in the exchange time zone. An argument with this unit cannot contain a multiplier.
Returns: ( ) A tuple containing the following data from the `Data` object:
- The stored value corresponding to the identified timestamp ("float").
- The earliest saved timestamp that is closest to the calculated offset behind the bar's opening time ("int").
valueAtPeriodOffset(source, period, timeOffsetLimit, timeframeLimit)
(Overload 2 of 2) Retrieves `source` and time information for the earliest bar whose opening timestamp is closest to a calculated offset behind the current bar's opening time. The calculated offset represents the amount of time covered by the specified `period`. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
source (series float) : The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
period (series string) : The period string, which determines the calculated time offset. The specified argument must contain a unit and an optional multiplier (e.g., "1Y", "3M", "2W", "YTD"). Supported units are:
- "Y" for years.
- "M" for months.
- "W" for weeks.
- "D" for days.
- "YTD" (Year-to-date) for the span from the start of the current bar's year in the exchange time zone. An argument with this unit cannot contain a multiplier.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple containing the following data:
- The `source` value corresponding to the identified timestamp ("float").
- The earliest bar's timestamp that is closest to the calculated offset behind the current bar's opening time ("int").
- The current bar's `source` value ("float").
getDataAtTimes(timestamps, source, timeOffsetLimit, timeframeLimit)
Retrieves `source` and time information for each bar whose opening timestamp is the earliest one closest to one of the UNIX timestamps specified in the `timestamps` array. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
timestamps (array) : An array of "int" values representing UNIX timestamps. The function retrieves `source` and time data for each element in this array.
source (series float) : The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple of the following data:
- An array containing a `source` value for each identified timestamp (array).
- An array containing an identified timestamp for each item in the `timestamps` array (array).
- The current bar's `source` value ("float").
- The symbol's description from `syminfo.description` ("string").
getDataAtTimeOffsets(timeOffsets, source, timeOffsetLimit, timeframeLimit)
Retrieves `source` and time information for each bar whose opening timestamp is the earliest one closest to one of the time offsets specified in the `timeOffsets` array. Each offset in the array represents the absolute number of milliseconds behind the current bar's opening time. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
timeOffsets (array) : An array of "int" values representing the millisecond time offsets used in the search. The function retrieves `source` and time data for each element in this array. For example, the array ` ` specifies that the function returns data for the timestamps closest to one day and one week behind the current bar's opening time.
source (float) : (series float) The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple of the following data:
- An array containing a `source` value for each identified timestamp (array).
- An array containing an identified timestamp for each offset specified in the `timeOffsets` array (array).
- The current bar's `source` value ("float").
- The symbol's description from `syminfo.description` ("string").
getDataAtPeriodOffsets(periods, source, timeOffsetLimit, timeframeLimit)
Retrieves `source` and time information for each bar whose opening timestamp is the earliest one closest to a calculated offset behind the current bar's opening time. Each calculated offset represents the amount of time covered by a period specified in the `periods` array. Any call to this function cannot execute more than once per bar or realtime tick.
Parameters:
periods (array) : An array of period strings, which determines the time offsets used in the search. The function retrieves `source` and time data for each element in this array. For example, the array ` ` specifies that the function returns data for the timestamps closest to one day, week, and month behind the current bar's opening time. Each "string" in the array must contain a unit and an optional multiplier. Supported units are:
- "Y" for years.
- "M" for months.
- "W" for weeks.
- "D" for days.
- "YTD" (Year-to-date) for the span from the start of the current bar's year in the exchange time zone. An argument with this unit cannot contain a multiplier.
source (float) : (series float) The source series to analyze. The function stores each value in the series with an associated timestamp representing its corresponding bar's opening time.
timeOffsetLimit (simple int) : Optional. A time offset (range) in milliseconds. If specified, the function limits the collected data to the maximum number of bars covered by the range, with a minimum of one bar. If the call includes a non-empty `timeframeLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
timeframeLimit (simple string) : Optional. A valid timeframe string. If specified and not empty, the function limits the collected data to the maximum number of bars covered by the timeframe, with a minimum of one bar. If the call includes a non-na `timeOffsetLimit` value, the function limits the data using the largest number of bars covered by the two ranges. The default is `na`.
Returns: ( ) A tuple of the following data:
- An array containing a `source` value for each identified timestamp (array).
- An array containing an identified timestamp for each period specified in the `periods` array (array).
- The current bar's `source` value ("float").
- The symbol's description from `syminfo.description` ("string").
My Price Action ToolkitThe Price Action Toolkit Lite is a comprehensive indicator designed to enhance your chart analysis with advanced price action tools. This powerful toolkit combines multiple technical analysis concepts to provide traders with a clear visualization of market structure, liquidity levels, order blocks, and trend lines. By integrating these elements, the indicator aims to offer a holistic view of price action, helping traders identify potential entry and exit points, as well as key levels of interest in the market.
ICT Liquidity Levels [TakingProphets]Overview
This indicator is designed to dynamically identify and display key liquidity levels—areas where market participants are likely to engage. By analyzing price swing points, it highlights potential support and resistance zones that can signal reversals or breakouts. The script distinguishes between buyside and sellside liquidity levels, presenting them with customizable visual cues and labels for immediate clarity.
How It Works
Swing Point Detection:
The indicator uses a pivot-based method (with a configurable “Base Swing Strength”) to detect swing highs and lows. Each detected swing is evaluated for its “swing size” (percentage price movement), and if it exceeds a user-defined threshold, the level is classified as major.
Level Creation and Classification:
Overview
Built on core ICT principles, this indicator identifies key liquidity zones—areas where market imbalances can lead to liquidity sweeps. By dynamically analyzing swing points, it offers traders a real-time view of where liquidity is clustering, allowing for a deeper understanding of market structure. 🚀
How It Works
Swing Point Detection 🔍
• Uses a pivot-based method with a configurable “Base Swing Strength” to detect significant price swings.
• Calculates the swing size (percentage change) to flag zones that exceed the “Major Level Threshold” as major liquidity zones.
Level Creation & Classification 🛠️
• Buyside Liquidity Levels (BSL):
Identified from swing highs, marking zones where buying liquidity clusters.
• Sellside Liquidity Levels (SSL):
Identified from swing lows, highlighting zones of concentrated selling liquidity.
• Each zone is stored with its price, bar index, and classification (major or standard) before being drawn as a horizontal line on the chart.
Dynamic Level Management 🔄
• Extension: Liquidity lines automatically extend from their detection point to the current bar.
• Consolidation: When levels are close in price, the script merges them—updating labels (e.g., “REQH” or “REQL”) to denote unified liquidity zones.
• Traded-Through Detection: Adjusts or removes levels if the market moves beyond them, based on your settings.
• Age-Based Cleanup: Inactive zones are automatically removed after a set number of bars to maintain clarity.
Customization Options ⚙️
Visual Settings:
• Choose from solid, dashed, or dotted line styles and adjust line width.
• Option to display labels with customizable placement (left or right) for optimal clarity.
Color & Opacity:
• Set distinct colors for buyside and sellside liquidity zones.
• Configure opacity for zones that have been traded through, keeping them visible yet de-emphasized.
Detection & Cleanup Parameters:
• Adjust “Base Swing Strength” to control pivot detection sensitivity.
• Set the “Major Level Threshold %” to filter for significant liquidity zones.
• Decide whether to retain or remove zones once price moves through them.
• Define how many bars should pass before inactive zones are automatically deleted.
How to Use 🚀
Apply the Indicator:
Simply add the script to your chart—it automatically detects and marks key liquidity zones based on recent price action.
Adjust Inputs:
Fine-tune parameters like swing strength, threshold percentages, and visual settings to match the asset’s characteristics and your trading strategy.
Interpret the Visuals:
• Major Liquidity Zones:
Highlighted with thicker lines and distinct labels (e.g., “Major BSL/SSL”), indicating areas of heightened liquidity concentration.
• Consolidated Zones:
Merged labels (e.g., “REQH/REQL”) denote unified liquidity zones where clustering is significant.
• Traded-Through Zones:
Changes in opacity signal that the market has moved beyond a previously identified liquidity zone.
Underlying ICT Concepts 💡
Liquidity Pools & Sweeps:
Focused on identifying where liquidity is concentrated, the indicator aligns with ICT methodologies that highlight zones crucial for liquidity sweeps.
Pivot Analysis for Liquidity:
Enhances traditional pivot detection to spotlight liquidity clusters, providing a deeper insight into market structure.
Real-Time Adaptation:
With continuous updates and built-in cleanup, the indicator ensures that liquidity zones accurately reflect current market conditions.
Pay Attention CandleThis is an attempt to detect the so called Pay Attention Candles from RexDog Trading System (RDTS). (They are not clearly defined by any specific set in stone rule, so this is just my interpretation)
You can turn on and off the bar highlight/triangles if chart gets too busy and you want only one of the indication types.
The way this is defined as evident in the code is - it looks at the candle size (without the wicks!!! only open to close) to decide whether it is larger than ATR mutlipied by a multiplier (1.5 by default here - you can adjust)
ATR period can also be adjusted but it's set to 9 by default.
Enjoy.
Triple Timeframe Stochastic Oscillator (Averaged)This custom Triple Timeframe Stochastic Oscillator indicator combines stochastic calculations from three user-defined timeframes into a single view, averaging the %K and %D lines for each timeframe to produce one representative line per timeframe. Users can manually set the timeframes (e.g., daily, weekly, monthly), as well as the length and smoothing periods for each stochastic calculation, providing flexibility for multi-timeframe analysis. The indicator plots three distinct lines in red, blue, and green, with overbought (80) and oversold (20) levels marked, helping traders identify momentum and potential reversal points across different time perspectives.
Timeframe 1: Red
Timeframe 2: Blue
Timeframe 3: Green
1 Bar Rate of Change Display"The real-time display shows the price range between the high and low of the last bar.
It is used to avoid stocks that do not generate margins excluding fees or those that are traded too frequently in low time frames. It is useful for quickly clicking through multiple stocks to find suitable day trading candidates."
Sniper TradingSniper Trader Indicator Overview
Sniper Trader is a comprehensive trading indicator designed to assist traders by providing valuable insights and alerting them to key market conditions. The indicator combines several technical analysis tools and provides customizable inputs for different strategies and needs.
Here’s a detailed breakdown of all the components and their functions in the Sniper Trader indicator:
1. MACD (Moving Average Convergence Divergence)
The MACD is a trend-following momentum indicator that helps determine the strength and direction of the current trend. It consists of two lines:
MACD Line (Blue): Calculated by subtracting the long-term EMA (Exponential Moving Average) from the short-term EMA.
Signal Line (Red): The EMA of the MACD line, typically set to 9 periods.
What does it do?
Buy Signal: When the MACD line crosses above the signal line, it generates a buy signal.
Sell Signal: When the MACD line crosses below the signal line, it generates a sell signal.
Zero Line Crossings: Alerts are triggered when the MACD line crosses above or below the zero line.
2. RSI (Relative Strength Index)
The RSI is a momentum oscillator used to identify overbought or oversold conditions in the market.
Overbought Level (Red): The level above which the market might be considered overbought, typically set to 70.
Oversold Level (Green): The level below which the market might be considered oversold, typically set to 30.
What does it do?
Overbought Signal: When the RSI crosses above the overbought level, it’s considered a signal that the asset may be overbought.
Oversold Signal: When the RSI crosses below the oversold level, it’s considered a signal that the asset may be oversold.
3. ATR (Average True Range)
The ATR is a volatility indicator that measures the degree of price movement over a specific period (14 bars in this case). It provides insights into how volatile the market is.
What does it do?
The ATR value is plotted on the chart and provides a reference for potential market volatility. It's used to detect flat zones, where the price may not be moving significantly, potentially indicating a lack of trends.
4. Support and Resistance Zones
The Support and Resistance Zones are drawn by identifying key swing highs and lows over a user-defined look-back period.
Support Zone (Green): Identifies areas where the price has previously bounced upwards.
Resistance Zone (Red): Identifies areas where the price has previously been rejected or reversed.
What does it do?
The indicator uses swing highs and lows to define support and resistance zones and highlights these areas on the chart. This helps traders identify potential price reversal points.
5. Alarm Time
The Alarm Time feature allows you to set a custom time for the indicator to trigger an alarm. The time is based on Eastern Time and can be adjusted directly in the inputs tab.
What does it do?
It triggers an alert at a user-defined time (for example, 4 PM Eastern Time), helping traders close positions or take specific actions at a set time.
6. Market Condition Display
The Market Condition Display shows whether the market is in a Bullish, Bearish, or Flat state based on the MACD line’s position relative to the signal line.
Bullish (Green): The market is in an uptrend.
Bearish (Red): The market is in a downtrend.
Flat (Yellow): The market is in a range or consolidation phase.
7. Table for Key Information
The indicator includes a customizable table that displays the current market condition (Bull, Bear, Flat). The table is placed at a user-defined location (top-left, top-right, bottom-left, bottom-right), and the appearance of the table can be adjusted for text size and color.
8. Background Highlighting
Bullish Reversal: When the MACD line crosses above the signal line, the background is shaded green to highlight the potential for a trend reversal to the upside.
Bearish Reversal: When the MACD line crosses below the signal line, the background is shaded red to highlight the potential for a trend reversal to the downside.
Flat Zone: A flat zone is identified when volatility is low (ATR is below the average), and the background is shaded orange to signal periods of low market movement.
Key Features:
Customizable Time Inputs: Adjust the alarm time based on your local time zone.
User-Friendly Table: Easily view market conditions and adjust display settings.
Comprehensive Alerts: Receive alerts for MACD crossovers, RSI overbought/oversold conditions, flat zones, and the custom alarm time.
Support and Resistance Zones: Drawn automatically based on historical price action.
Trend and Momentum Indicators: Utilize the MACD and RSI for identifying trends and market conditions.
How to Use Sniper Trader:
Set Your Custom Time: Adjust the alarm time to match your trading schedule.
Monitor Market Conditions: Check the table for real-time market condition updates.
Use MACD and RSI Signals: Watch for MACD crossovers and RSI overbought/oversold signals.
Watch for Key Zones: Pay attention to the support and resistance zones and background highlights to identify market turning points.
Set Alerts: Use the built-in alerts to notify you of buy/sell signals or when it’s time to take action at your custom alarm time.
Ronnie's DikFat Attack - Moving Average Angle/Slope PositionRonnie's DikFat Attack - True Moving Average Angle/Slope Position
Overview
This TradingView indicator, written in Pine Script version 5, injects energy into your chart analysis by calculating and displaying the angles of four moving averages (MAs). It empowers you to customize each MA—choosing both type and length—to suit your trading strategy perfectly.
How It Works
1. User Inputs:
Under the “MA Settings” group, the script offers an intuitive interface where you can define four different moving averages. Each MA can be set to one of several types (SMA, EMA, SMMA, VWMA, Hull, WMA, or TEMA) and assigned a specific length (number of bars).
2. Dynamic Moving Average Calculation:
A dedicated function ( getMA ) selects and computes the appropriate moving average using TradingView’s built-in functions (like ta.ema , ta.sma , etc.). This yields four customized MA series based on your inputs.
3. Calculating the Angle of Momentum:
The script employs a robust function ( calcAngle ) that measures the change between consecutive values of each MA to determine its slope. This slope is then converted into an angle in degrees using the arctangent function, providing a clear and vivid depiction of trend strength and direction.
4. Visualizing the Angles:
Each moving average’s angle is plotted with its own distinct color, enhancing visual clarity. A horizontal line at 0° acts as a reference point, marking the divide between upward and downward momentum.
Potential Uses
Trend Analysis:
The angle measurement offers a dynamic perspective on trend strength. Steep positive angles suggest vigorous upward movement, while steep negative angles indicate strong downward trends.
Signal Confirmation:
By comparing the angles of multiple moving averages, you can quickly spot momentum shifts and crossover points, which may serve as powerful entry or exit signals.
Tailored Strategy Customization:
The flexibility to choose various MA types and lengths allows this tool to adapt seamlessly to different timeframes and trading styles, enhancing its usefulness in diverse market conditions.
Dynamic Reversal ZonesDynamic Reversal Zones – Indicator Overview and Strategy
(Thanks to BigBeluga for the "Range Breakout " script. I used it to inspire the addition of a range breakout functionality)
This comprehensive indicator combines two powerful tools: Dynamic Reversal Zones and Range Breakout. It is designed to help traders identify dynamic support and resistance zones, spot breakout opportunities, and capture reversal signals with clear visual cues. By leveraging both the dynamic zones and the breakout channel, you can gain a deeper understanding of market structure and set up high-probability trades.
Dynamic Reversal Zones
How It Works – Band Calculations:
Primary Bands (High Band and Low Band):
The indicator calculates a base using a simple moving average (SMA) over a user-defined period. A multiple of the standard deviation is then added and subtracted from this base to generate the high band and low band. These levels represent key areas where price has historically encountered resistance (high band) or support (low band).
Secondary Bands (Upper Band and Lower Band):
A second set of bands is calculated using a shorter SMA (the "media"). By adding and subtracting the corresponding standard deviation, the indicator forms the upper band and lower band. These secondary bands help refine the dynamic zones, pinpointing more precise reversal areas.
Signal Generation:
SELL Signal:
A sell signal is triggered when the price overshoots the upper zones (either the high band or upper band) and then reverses by closing below these levels with a bearish candle. This behavior suggests an overextension on the upside and a potential reversal.
BUY Signal:
Conversely, a buy signal occurs when the price falls below the lower zones and then recovers, with a bullish candle that closes above both the low band and the lower band. This indicates that the price has oversold and is likely to reverse upward.
How to Use Dynamic Reversal Zones:
Identify Reversal Opportunities:
Use the dynamically calculated bands as support and resistance levels. Look for price overextensions that then reverse back within the zones to identify potential trade entries.
Entry and Exit Strategies:
For BUY entries, consider entering after a confirmed bullish reversal when the price recovers from oversold conditions. For SELL entries, wait for a bearish reversal from an overextended high. Placing stop losses just beyond the respective zone boundaries helps manage risk.
Confluence with Other Tools:
Enhance your trading by confirming signals with momentum indicators (e.g., RSI, MACD), volume analysis, or higher timeframe trendlines. Additionally, combining these zones with pivot points or Fibonacci retracements can refine your entry and exit levels.
Range Breakout
How It Works – Channel-Based Calculations:
Dynamic Channel Formation:
The Range Breakout component creates a dynamic channel based on an ATR (Average True Range) calculation. It automatically establishes upper and lower bands, along with a midline, by applying a multiplier to a smoothed ATR. These boundaries define the current price range and help identify breakout opportunities.
Breakout Detection and Reset:
When the price breaks above the upper band or below the lower band—or if a certain number of bars occur outside the channel—the indicator resets the channel using the current price as the new center. This dynamic reset allows traders to monitor evolving price ranges and adapt to changing market conditions.
Visual Signals:
Channel Plot Appearance:
The channel is drawn on the chart with customizable color and transparency settings. Users can control the appearance of the channel plots (midline, upper, and lower bands) through dedicated inputs, ensuring that the indicator blends seamlessly with your chart style.
Breakout Signals and Fakeouts:
The indicator also marks breakout signals when the price reverses after testing the channel boundaries. Additionally, it can highlight potential fakeout scenarios where the price briefly breaks the channel without sustaining the move. These visual signals help traders distinguish between genuine breakouts and false moves.
How to Use Range Breakout:
Identifying Opportunities:
Watch for candles that test or exceed the channel boundaries and then reverse, as this can indicate a breakout followed by a retest of the channel. Such setups may provide opportunities to enter trades at attractive risk-reward levels.
Complementary Tool:
When used together with the Dynamic Reversal Zones, the Range Breakout component adds another layer of confirmation. For instance, a reversal signal from the dynamic zones that coincides with a channel breakout or retest may offer enhanced trade validation.
Customization & Best Practices
Customization:
Both sections of the indicator offer a wide range of adjustable parameters—including periods, multipliers, line styles, colors, and opacities—allowing you to tailor the tool to various markets and timeframes, whether you are scalping or swing trading.
Confluence Setups:
For increased reliability, combine the signals from these components with other technical indicators (such as RSI, MACD, volume, and trendlines). Confirming breakouts, reversals, and fakeout scenarios using multiple methods can significantly improve your trade outcomes.
Risk Management:
Always apply sound risk management techniques. Use stop losses just beyond the dynamic zones or channel boundaries to protect against false signals. Backtest different configurations to determine the optimal settings for your trading style.
By integrating the Dynamic Reversal Zones and Range Breakout into a single indicator, traders gain a comprehensive view of market structure—enabling them to spot high-probability reversal and breakout opportunities. Experiment with the settings, combine these tools with complementary technical analysis methods, and always adhere to strict risk management principles for the best trading results.
Happy Trading!
[GYTS] FiltersToolkit LibraryFiltersToolkit Library
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- 1. INTRODUCTION --------- 🌸
💮 What Does This Library Contain?
This library is a curated collection of high-performance digital signal processing (DSP) filters and auxiliary functions designed specifically for financial time series analysis. It includes a shortlist of our favourite and best performing filters — each rigorously tested and selected for their responsiveness, minimal lag and robustness in diverse market conditions. These tools form an integral part of the GoemonYae Trading System (GYTS), chosen for their unique characteristics in handling market data.
The library contains two main categories:
1. Smoothing filters (low-pass filters and moving averages) for e.g. denoising, trend following
2. Detrending tools (high-pass and band-pass filters, known as "oscillators") for e.g. mean reversion
This collection is finely tuned for practical trading applications and is therefore not meant to be exhaustive. However, will continue to expand as we discover and validate new filtering techniques. I welcome collaboration and suggestions for novel approaches.
🌸 ——— 2. ADDED VALUE ——— 🌸
💮 Unified syntax and comprehensive documentation
The FiltersToolkit Library brings together a wide array of valuable filters under a unified, intuitive syntax. Each function is thoroughly documented, with clear explanations and academic sources that underline the mathematical rigour behind the methods. This level of documentation not only facilitates integration into trading strategies but also helps underlying the underlying concepts and rationale.
💮 Optimised performance and readability
The code prioritizes computational efficiency while maintaining readability. Key optimizations include:
- Minimizing redundant calculations in recursive filters
- Smart coefficient caching
- Efficient state management
- Vectorized operations where applicable
💮 Enhanced functionality and flexibility
Some filters in this library introduce extended functionality beyond the original publications. For instance, the MESA Adaptive Moving Average (MAMA) and Ehlers’ Combined Bandpass Filter incorporate multiple variations found in the literature, thereby providing traders with flexible tools that can be fine-tuned to different market conditions.
🌸 ——— 3. THE FILTERS ——— 🌸
💮 Hilbert Transform Function
This function implements the Hilbert Transform as utilised by John Ehlers. It converts a real-valued time series into its analytic signal, enabling the extraction of instantaneous phase and frequency information—an essential step in adaptive filtering.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 Homodyne Discriminator
By leveraging the Hilbert Transform, this function computes the dominant cycle period through a Homodyne Discriminator. It extracts the in-phase and quadrature components of the signal, facilitating a robust estimation of the underlying cycle characteristics.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 MESA Adaptive Moving Average (MAMA)
An advanced dual-stage adaptive moving average, this function outputs both the MAMA and its companion FAMA. It combines adaptive alpha computation with elements from Kaufman’s Adaptive Moving Average (KAMA) to provide a responsive and reliable trend indicator.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 BiQuad Filters
A family of second-order recursive filters offering exceptional control over frequency response:
- High-pass filter for detrending
- Low-pass filter for smooth trend following
- Band-pass filter for cycle isolation
The quality factor (Q) parameter allows fine-tuning of the resonance characteristics, making these filters highly adaptable to different market conditions.
Source: Robert Bristow-Johnson's Audio EQ Cookbook, implemented by @The_Peaceful_Lizard
💮 Relative Vigor Index (RVI)
This filter evaluates the strength of a trend by comparing the closing price to the trading range. Operating similarly to a band-pass filter, the RVI provides insights into market momentum and potential reversals.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Cyber Cycle
The Cyber Cycle filter emphasises market cycles by smoothing out noise and highlighting the dominant cyclical behaviour. It is particularly useful for detecting trend reversals and cyclical patterns in the price data.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Butterworth High Pass Filter
Inspired by the classical Butterworth design, this filter achieves a maximally flat magnitude response in the passband while effectively removing low-frequency trends. Its design minimises phase distortion, which is vital for accurate signal interpretation.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 2-Pole SuperSmoother
Employing a two-pole design, the SuperSmoother filter reduces high-frequency noise with minimal lag. It is engineered to preserve trend integrity while offering a smooth output even in noisy market conditions.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 3-Pole SuperSmoother
An extension of the 2-pole design, the 3-pole SuperSmoother further attenuates high-frequency noise. Its additional pole delivers enhanced smoothing at the cost of slightly increased lag.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Adaptive Directional Volatility Moving Average (ADXVma)
This adaptive moving average adjusts its smoothing factor based on directional volatility. By combining true range and directional movement measurements, it remains exceptionally flat during ranging markets and responsive during directional moves.
Source: Various implementations across platforms, unified and optimized
💮 Ehlers Combined Bandpass Filter with Automated Gain Control (AGC)
This sophisticated filter merges a highpass pre-processing stage with a bandpass filter. An integrated Automated Gain Control normalises the output to a consistent range, while offering both regular and truncated recursive formulations to manage lag.
Source: John F. Ehlers – “Truncated Indicators” (2020), “Cycle Analytics for Traders” (2013)
💮 Voss Predictive Filter
A forward-looking filter that predicts future values of a band-limited signal in real time. By utilising multiple time-delayed feedback terms, it provides anticipatory coupling and delivers a short-term predictive signal.
Source: John Ehlers - "A Peek Into The Future" (TASC 2019-08)
💮 Adaptive Autonomous Recursive Moving Average (A2RMA)
This filter dynamically adjusts its smoothing through an adaptive mechanism based on an efficiency ratio and a dynamic threshold. A double application of an adaptive moving average ensures both responsiveness and stability in volatile and ranging markets alike. Very flat response when properly tuned.
Source: @alexgrover (2019)
💮 Ultimate Smoother (2-Pole)
The Ultimate Smoother filter is engineered to achieve near-zero lag in its passband by subtracting a high-pass response from an all-pass response. This creates a filter that maintains signal fidelity at low frequencies while effectively filtering higher frequencies at the expense of slight overshooting.
Source: John Ehlers - TASC 2024-04 "The Ultimate Smoother"
Note: This library is actively maintained and enhanced. Suggestions for additional filters or improvements are welcome through the usual channels. The source code contains a list of tested filters that did not make it into the curated collection.
Volume BaseVolume Base Indicator
Description:
The Volume Base indicator is designed to help traders identify significant price levels based on volume and price action. This tool utilizes pivot points to highlight swing highs and lows, providing visual cues for potential support and resistance areas.
Key Features:
Pivot Lookback: Customize the lookback period for identifying swing highs and lows, allowing for flexibility based on your trading strategy.
Swing Area Options: Choose between "Wick Extremity" and "Full Range" to define the area of interest for swing points, catering to different trading styles.
Intrabar Precision: Enable intrabar precision to analyze volume data on a lower timeframe, enhancing the accuracy of your signals.
Volume Filtering: Filter areas based on either the count of occurrences or the total volume, helping you focus on the most relevant price levels.
Visual Customization: Adjust colors and styles for swing highs, swing lows, and their respective areas to suit your personal preferences and improve chart readability.
Dynamic Labels and Zones: Automatically generated labels and zones for swing highs and lows provide clear visual indicators of potential market reversals or continuations.
How to Use:
Set the Lookback Period: Adjust the pivot lookback period to match your trading timeframe.
Select Swing Area Type: Choose whether to focus on the wick extremity or the full range of the swing.
Enable Intrabar Precision: If desired, turn on intrabar precision for more detailed volume analysis.
Filter Settings: Decide whether to filter by count or volume and set your threshold value accordingly.
Analyze the Chart: Observe the plotted swing highs and lows, along with their respective zones, to make informed trading decisions.
Disclaimer: This indicator is for educational purposes only and should not be considered financial advice. Always conduct your own research and analysis before making trading decisions.
LDO Support and Resistance with Trend LinesUnderstanding the Indicator on Your Chart
Support Lines (Green): These horizontal lines represent price levels where LDO is likely to find buying interest, preventing further declines. They turn a semi-transparent green when the price is above them and blue when below.
Resistance Lines (Blue): These horizontal lines indicate price levels where selling pressure may halt upward movements. They turn a semi-transparent blue when the price is below them and green when above.
Trend Lines (Blue for Resistance, Green for Support): Diagonal lines show the overall trend direction. Blue trend lines indicate resistance (price may struggle to rise above), and green trend lines indicate support (price may find a floor).
Pivots: Small triangles appear above or below candles to mark pivot highs (resistance) and pivot lows (support), helping you identify key turning points.
Customizing the Indicator
You can tweak the indicator’s behavior through the settings panel. Here’s what each input does:
Show Trend Lines? (Default: True)
Enables or disables the display of trend lines on the chart. Set to false to hide trend lines if you only want support/resistance levels.
Choose Higher Time Frame
Select a higher timeframe (e.g., 1H, 4H, 1D) to display support and resistance levels from that timeframe on your current chart (e.g., 5M or 15M).
Pivot Length Settings (Current and Higher Timeframe):
Pivot Length Left Hand Side (Current/HTF): Adjusts how many bars to the left the indicator looks to identify pivot lows (default: 15 for current, 20 for HTF).
Pivot Length Right Hand Side (Current/HTF): Adjusts how many bars to the right the indicator looks to identify pivot highs (default: 10 for current, 15 for HTF).
Increase these values for fewer, more significant pivots; decrease for more frequent pivots.
Pivot Sources (Trend 1 and Trend 2 Pivots):
Select the price source (e.g., low, high) for calculating pivot lows and highs. Default is low for pivot lows and high for pivot highs.
Line Width Settings:
Lower Time Frame Line Width (Default: 5): Sets the thickness of support/resistance lines on the current timeframe.
Higher Time Frame Line Width (Default: 18): Sets the thickness of support/resistance lines on the higher timeframe.
Show Support & Resistance? (Default: True)
Enables or disables the display of horizontal support and resistance lines. Set to false to hide them if you only want trend lines.
Alert Settings (Under “Alerts” Group):
Enable Trend Line Alerts? (Default: True): Turns alerts on or off for trend line hits.
Alert on Resistance Trend Lines? (Default: True): Enables alerts when the price hits resistance trend lines.
Alert on Support Trend Lines? (Default: True): Enables alerts when the price hits support trend lines.
Alert Message: Customize the alert message format (default: “Price hit trend line at {0}”, where {0} is replaced by the price).
Setting Up Alerts
Enable Alerts in the Indicator:
In the indicator settings, ensure “Enable Trend Line Alerts?” is set to true, and choose whether to alert on resistance or support trend lines.
Create a TradingView Alert:
Click the “Alerts” button (bell icon) at the top of the chart.
Select “Create Alert” and choose this indicator from the “Condition” dropdown.
Set the alert frequency (e.g., once per bar, only once), notification method (e.g., email, popup), and save the alert.
Test the Alerts:
Breakouts with timefilter [LuciTech]Here's the updated description with "colors" replaced by "colours" throughout, maintaining the original structure and content:
Breaking Point 2.0
This is a technical analysis overlay indicator designed to identify breakout levels based on pivot highs and lows, with a focus on price action during customizable time windows using London time (UK). It draws horizontal lines at pivot points and plots signals when price breaks above or below these levels, offering traders a tool to monitor potential bullish or bearish movements. The indicator includes options for time filtering and displaying only the most recent breakout.
Features
The Pivot Breakout Lines display horizontal lines at detected pivot highs (bullish) and pivot lows (bearish), coloured green and red by default. These lines extend from the pivot point to the breakout bar and can be set to show only the latest breakout.
The Breakout Signals mark bullish breakouts with an upward triangle below the bar and bearish breakouts with a downward triangle above the bar, using customizable colours.
The Time Filter restricts signals and lines to a specific window (default: 14:30–15:00 UK), which can be toggled on or off. A shaded background highlights this period when enabled.
How It Works
The indicator calculates pivot highs and lows using a user-defined lookback period (default: 5 bars). When price closes above a pivot high, it triggers a bullish signal and draws a line from the pivot to the breakout bar. When price closes below a pivot low, it triggers a bearish signal with a corresponding line.
If the time filter is active, signals and lines only appear within the specified window. Outside this period—or if the filter is disabled—they appear based solely on price action. The indicator maintains up to three recent pivots in memory, removing older ones as new pivots form.
Alerts are available for both bullish and bearish breakouts, triggered when signals occur.
Settings
Length controls the lookback period for pivot detection (default: 5).
Colours Bull/Bear sets the colours for bullish (default: green) and bearish (default: red) lines and signals.
Show Last Breakout toggles whether only the most recent breakout line and signal are displayed (default: false).
Time Filter enables or disables the time restriction (default: true).
Fill Background toggles a shaded area during the time window (default: true), with a customizable colour.
Time Settings define the start hour/minute and end hour/minute for the filter (default: 14:30–15:00).
Interpretation
The Pivot Breakout Lines highlight levels where price has previously reversed, potentially acting as support or resistance. A breakout above a pivot high may suggest bullish momentum, while a breakout below a pivot low may indicate bearish pressure.
The Breakout Signals provide visual cues for these events, useful for timing entries or exits. When "Show Last Breakout" is enabled, the chart focuses on the most recent signal, reducing clutter.
The Time Filter and background shading help traders concentrate on specific trading sessions, such as high-volatility periods. When disabled, the indicator tracks breakouts across all times.
EMA 8/13/21 Golden TriangleDescription:
The "EMA Golden Triangle" indicator is a powerful tool for identifying potential trend reversals and continuations, based on the principles of Exponential Moving Averages (EMAs) and the revered Fibonacci sequence. This indicator plots three key EMAs:
EMA 8 (Red): A fast-moving average, highly responsive to recent price changes.
EMA 13 (Orange): A medium-term average, balancing responsiveness and stability.
EMA 21 (Yellow): A slower-moving average, representing the longer-term trend.
Fibonacci and Trading:
EMA lengths (8, 13, 21) are derived from the Fibonacci sequence, often observed in financial markets. Traders use Fibonacci numbers and ratios to identify potential support/resistance, retracements, and extensions. Using these Fibonacci numbers for the EMAs aims to align the indicator with potential market turning points.
How to Use the Indicator:
The indicator identifies "Golden Triangle" formations:
Bullish Golden Triangle: EMA 8 > EMA 13 > EMA 21, and EMA 8 and EMA 13 crossover EMA 21. Signals a potential uptrend. A green triangle appears below the bar, with a light green background.
Bearish Golden Triangle: EMA 8 < EMA 13 < EMA 21, and EMA 8 and EMA 13 cross under EMA 21. Signals a potential downtrend. A red triangle appears above the bar, with a light red background.
This indicator can be particularly useful on lower timeframes for scalping and day trading, where quick reactions to price changes are crucial. On these timeframes:
Lower Timeframes (1-min, 5-min, 15-min):
More Signals: More frequent Golden Triangles, but also more false signals.
Price Action: Confirming candlestick patterns.
Support/Resistance: Avoid significant levels that could invalidate the signal.
Volume: Higher volume strengthens the signal.
Other Indicators: Use RSI, MACD, or Supertrend for confirmation.
Tight Stop Losses: Essential due to potential whipsaws.
Backtest Thoroughly: Test with historical data before live trading.
Alerts:
Built-in alerts for bullish and bearish formations.
Disclaimer:
No indicator is perfect. Past performance doesn't guarantee future results. Use proper risk management and integrate this indicator into a broader strategy.