Daily High/Low Levels with mitigationThis Pine Script script defines a TradingView indicator named "Daily High/Low Levels" designed to track and display the daily high and low levels of a trading session, with added functionality for marking levels as mitigated when certain conditions are met. Here's a breakdown of its functionality:
Key Features
Session Start Time: The script allows you to specify a custom session start time in 24-hour format. This ensures the levels align with your trading session preferences.
Daily Highs and Lows:
Tracks the high and low levels for each session.
Retains the highs and lows for a configurable number of previous days.
Visualization:
Creates horizontal lines for each session's high and low levels.
Supports customization of line colors and styles.
Mitigation Tracking:
Monitors whether a high or low level has been "mitigated" (touched or exceeded by subsequent price action).
Changes the line style and color to indicate mitigation.
Provides an alert when mitigation occurs.
Configurable Extensions:
Lines can be extended beyond mitigation or stopped at the bar index where mitigation occurs, depending on user preference.
Efficient Array Management:
Uses arrays to manage daily highs, lows, their respective indices, and lines.
Ensures the size of stored data does not exceed the configured limit (daysToTrack).
Alerts:
Sends alerts when high or low levels are mitigated, which can be used for trading decisions.
Inputs
Session Start Hour/Minute: Defines when a new session starts.
Days to Track: Sets the number of previous days to display high/low levels.
Colors: Allows customization of line colors for unmitigated and mitigated levels.
Extend Lines: Toggles whether lines should extend past the mitigation point.
Code Highlights
New Session Detection: The script detects the start of a new session based on the configured session start time and resets daily highs/lows.
Line Management: Horizontal rays are created for highs and lows, and mitigated lines are updated with a dashed style and faded color.
Mitigation Logic: The script checks whether current price action exceeds stored high or low levels and updates their status and appearance accordingly.
Memory Management: Ensures the size of the arrays (highs, lows, lines) does not exceed the configured daysToTrack, deleting the oldest elements as necessary.
This indicator is highly customizable and useful for traders who want to track and analyze daily support and resistance levels, incorporating mitigation as a dynamic feature.
Chart patterns
RagiBaba's 3:1 Risk-to-Reward Tool with LeverageThis indicator allows you to visualize a 3:1 risk-to-reward ratio for your trades on the chart. It automatically calculates and displays the Stop Loss and Take Profit levels based on your input for:
Entry Price
Trade Amount ($)
Risk Amount ($)
Leverage (x)
You can adjust the following settings:
Trade Direction: Choose between a Long or Short position.
Leverage: Enter the leverage value (e.g., 25x).
Entry Price: Set the price at which you plan to enter the trade.
Risk and Reward: Input the amount of money you're willing to risk and the desired reward (automatically calculated as 3 times your risk).
Label Position: Choose the label position for Entry, Stop, and Target (left, center, or right on the chart).
Each line has a corresponding label showing the price for Entry, Stop Loss, and Take Profit. The labels can be positioned on the left, center, or right side of the chart for better readability.
This tool helps you manage your trades by giving you clear visual cues for your entry, stop loss, and take profit levels with the option to adjust for leverage.
Cabal Dev IndicatorThis is a TradingView Pine Script (version 6) that creates a technical analysis indicator called the "Cabal Dev Indicator." Here's what it does:
1. Core Functionality:
- It calculates a modified version of the Stochastic Momentum Index (SMI), which is a momentum indicator that shows where the current close is relative to the high/low range over a period
- The indicator combines elements of stochastic oscillator calculations with exponential moving averages (EMA)
2. Key Components:
- Uses configurable input parameters for:
- Percent K Length (default 15)
- Percent D Length (default 3)
- EMA Signal Length (default 15)
- Smoothing Period (default 5)
- Overbought level (default 40)
- Oversold level (default -40)
3. Calculation Method:
- Calculates the highest high and lowest low over the specified period
- Finds the difference between current close and the midpoint of the high-low range
- Applies EMA smoothing to both the range and relative differences
- Generates an SMI value and further smooths it using a simple moving average (SMA)
- Creates an EMA signal line based on the smoothed SMI
4. Visual Output:
- Plots the smoothed SMI line in green
- Plots an EMA signal line in red
- Shows overbought and oversold levels as gray horizontal lines
- Fills the areas above the overbought level with light red
- Fills the areas below the oversold level with light green
This indicator appears designed to help traders identify potential overbought and oversold conditions in the market, as well as momentum shifts, which could be used for trading decisions.
Would you like me to explain any specific part of the indicator in more detail?
Harmonic Pattern Detector (75 patterns)Harmonic Pattern Detector offers a record amount of "Harmonic Patterns" in one script, with 75 different patterns detected, together with up to 99 different swing lengths.
🔶 USAGE
Harmonic Patterns are detected from several different ZigZag lines, derived from Swings with different lengths (shorter - longer term)
Depending on the settings ' Minimum/Maximum Swing Length ', the user will see more or less patterns from shorter and/or longer-term swing points.
🔹 Fibonacci Ratio
Certain patterns have only one ratio for a specific retrace/extension instead of one upper and one lower limit. In this case, we add a ' Tolerance ', which adds a percentage tolerance below/above the ratio, creating two limits.
A higher number may show more patterns but may become less valid.
Hoovering over points B, C, and D will show a tooltip with the concerning limits; adjusted limits will be seen if applicable.
Tooltips in settings will also show which patterns the Fibonacci Ratio applies to.
🔹 Triangle Area Ratio
Using Heron's formula , the triangle area is calculated after the X-Y axis is normalized.
Users can filter patterns based on the ratio of the smallest triangle to the largest triangle.
A lower Triangle Area Ratio number leads to more symmetrical patterns but may appear less frequently.
🔶 DETAILS
Harmonic patterns are based on geometric patterns, where the retracement/extension of a swing point must be located between specific Fibonacci ratios of the previous swing/leg. Different Harmonic Patterns require unique ratios to become valid patterns.
In the above example there is a valid 'Max Butterfly' pattern where:
Point B is located between 0.618 - 0.886 retracement level of the X-A leg
Point C is located between 0.382 - 0.886 retracement level of the A-B leg
Point D is located between 1.272 - 2.618 extension level of the B-C leg
Point D is located between 1.272 - 1.618 extension level of the X-A leg
Harmonic Pattern Detector uses ZigZag lines, where swing highs and swing lows alternate. Each ZigZag line is checked for valid Harmonic Patterns . When multiple types of Harmonic Patterns are valid for the same sequence, the pattern will be named after the first one found.
Different swing lengths form different ZigZag lines.
By evaluating different ZigZag lines (up to 99!), shorter—and longer-term patterns can be drawn on the same chart.
🔹 Blocks
The patterns are organized into blocks that can be toggled on or off with a single click.
When a block is enabled, the user can still select which specific patterns within that block are enabled or disabled.
🔹 Visuals
Besides color settings, labels can show pattern names or arrows at point D of the pattern.
Note this will happen 1 bar after validation because one extra bar is needed for confirmation.
An option is included to show only arrows without the patterns.
🔹 Updated Patterns
When a Swing Low is followed by a lower low or a Swing High followed by a higher high , triggering a pattern identical to a previous one except with a different point D, the pattern will be updated. The previous C-D line will be visible as a dashed line to highlight the event. Only the last dashed line is shown when this happens more than once.
🔹 Optimization
The script only verifies the last leg in the initial phase, significantly reducing the time spent on pattern validation. If this leg doesn't align with a potential Harmonic Pattern , the pattern is immediately disregarded. In the subsequent phase, the remaining patterns are quickly scrutinized to ensure the next leg is valid. This efficient process continues, with only valid patterns progressing to the next phase until all sequences have been thoroughly examined.
This process can check up to 99 ZigZag lines for 75 different Harmonic Patterns , showcasing its high capacity and versatility.
🔹 Ratios
The following table shows the different ratios used for each Harmonic Pattern .
' min ' and ' max ' are used when only one limit is provided instead of 2. This limit is given a percentage tolerance above and below, customizable by the setting ' Tolerance - Fibonacci Ratio '.
For example a ratio of 0.618 with a tolerance of 1% would result in:
an upper limit of 0.624
a lower limit of 0.612
|-------------------|------------------------|------------------------|-----------------------|-----------------------|
| NAME PATTERN | BCD (BD) | ABC (AC) | XAB (XB) | XAD (XD) |
| | min max | min max | min max | min max |
|-------------------|------------------------|------------------------|-----------------------|-----------------------|
| 'ABCD' | 1.272 - 1.618 | 0.618 - 0.786 | | |
| '5-0' | 0.5 *min - 0.5 *max | 1.618 - 2.24 | 1.13 - 1.618 | |
| 'Max Gartley' | 1.128 - 2.236 | 0.382 - 0.886 | 0.382 - 0.618 | 0.618 - 0.786 |
| 'Gartley' | 1.272 - 1.618 | 0.382 - 0.886 | 0.618*min - 0.618*max | 0.786*min - 0.786*max |
| 'A Gartley' | 1.618*min - 1.618*max | 1.128 - 2.618 | 0.618 - 0.786 | 1.272*min - 1.272*max |
| 'NN Gartley' | 1.128 - 1.618 | 0.382 - 0.886 | 0.618*min - 0.618*max | 0.786*min - 0.786*max |
| 'NN A Gartley' | 1.618*min - 1.618*max | 1.128 - 2.618 | 0.618 - 0.786 | 1.272*min - 1.272*max |
| 'Bat' | 1.618 - 2.618 | 0.382 - 0.886 | 0.382 - 0.5 | 0.886*min - 0.886*max |
| 'Alt Bat' | 2.0 - 3.618 | 0.382 - 0.886 | 0.382*min - 0.382*max | 1.128*min - 1.128*max |
| 'A Bat' | 2.0 - 2.618 | 1.128 - 2.618 | 0.382 - 0.618 | 1.128*min - 1.128*max |
| 'Max Bat' | 1.272 - 2.618 | 0.382 - 0.886 | 0.382 - 0.618 | 0.886*min - 0.886*max |
| 'NN Bat' | 1.618 - 2.618 | 0.382 - 0.886 | 0.382 - 0.5 | 0.886*min - 0.886*max |
| 'NN Alt Bat' | 2.0 - 4.236 | 0.382 - 0.886 | 0.382*min - 0.382*max | 1.128*min - 1.128*max |
| 'NN A Bat' | 2.0 - 2.618 | 1.128 - 2.618 | 0.382 - 0.618 | 1.128*min - 1.128*max |
| 'NN A Alt Bat' | 2.618*min - 2.618*max | 1.128 - 2.618 | 0.236 - 0.5 | 0.886*min - 0.886*max |
| 'Butterfly' | 1.618 - 2.618 | 0.382 - 0.886 | 0.786*min - 0.786*max | 1.272 - 1.618 |
| 'Max Butterfly' | 1.272 - 2.618 | 0.382 - 0.886 | 0.618 - 0.886 | 1.272 - 1.618 |
| 'Butterfly 113' | 1.128 - 1.618 | 0.618 - 1.0 | 0.786 - 1.0 | 1.128*min - 1.128*max |
| 'A Butterfly' | 1.272*min - 1.272*max | 1.128 - 2.618 | 0.382 - 0.618 | 0.618 - 0.786 |
| 'Crab' | 2.24 - 3.618 | 0.382 - 0.886 | 0.382 - 0.618 | 1.618*min - 1.618*max |
| 'Deep Crab' | 2.618 - 3.618 | 0.382 - 0.886 | 0.886*min - 0.886*max | 1.618*min - 1.618*max |
| 'A Crab' | 1.618 - 2.618 | 1.128 - 2.618 | 0.276 - 0.446 | 0.618*min - 0.618*max |
| 'NN Crab' | 2.236 - 4.236 | 0.382 - 0.886 | 0.382 - 0.618 | 1.618*min - 1.618*max |
| 'NN Deep Crab' | 2.618 - 4.236 | 0.382 - 0.886 | 0.886*min - 0.886*max | 1.618*min - 1.618*max |
| 'NN A Crab' | 1.128 - 2.618 | 1.128 - 2.618 | 0.236 - 0.447 | 0.618*min - 0.618*max |
| 'NN A Deep Crab' | 1.128*min - 1.128*max | 1.128 - 2.618 | 0.236 - 0.382 | 0.618*min - 0.618*max |
| 'Cypher' | 1.272 - 2.00 | 1.13 - 1.414 | 0.382 - 0.618 | 0.786*min - 0.786*max |
| 'New Cypher' | 1.272 - 2.00 | 1.414 - 2.14 | 0.382 - 0.618 | 0.786*min - 0.786*max |
| 'Anti New Cypher' | 1.618 - 2.618 | 0.467 - 0.707 | 0.5 - 0.786 | 1.272*min - 1.272*max |
| 'Shark 1' | 1.618 - 2.236 | 1.128 - 1.618 | 0.382 - 0.618 | 0.886*min - 0.886*max |
| 'Shark 1 Alt' | 1.618 - 2.618 | 0.618 - 0.886 | 0.446 - 0.618 | 1.128*min - 1.128*max |
| 'Shark 2' | 1.618 - 2.236 | 1.128 - 1.618 | 0.382 - 0.618 | 1.128*min - 1.128*max |
| 'Shark 2 Alt' | 1.618 - 2.618 | 0.618 - 0.886 | 0.446 - 0.618 | 0.886*min - 0.886*max |
| 'Leonardo' | 1.128 - 2.618 | 0.382 - 0.886 | 0.5*min - 0.5*max | 0.786*min - 0.786*max |
| 'NN A Leonardo' | 2.0*min - 2.0*max | 1.128 - 2.618 | 0.382 - 0.886 | 1.272*min - 1.272*max |
| 'Nen Star' | 1.272 - 2.0 | 1.414 - 2.14 | 0.382 - 0.618 | 1.272*min - 1.272*max |
| 'Anti Nen Star' | 1.618 - 2.618 | 0.467 - 0.707 | 0.5 - 0.786 | 0.786*min - 0.786*max |
| '3 Drives' | 1.272 - 1.618 | 0.618 - 0.786 | 1.272 - 1.618 | 1.618 - 2.618 |
| 'A 3 Drives' | 0.618 - 0.786 | 1.272 - 1.618 | 0.618 - 0.786 | 0.13 - 0.886 |
| '121' | 0.382 - 0.786 | 1.128 - 3.618 | 0.5 - 0.786 | 0.382 - 0.786 |
| 'A 121' | 1.272 - 2.0 | 0.5 - 0.786 | 1.272 - 2.0 | 1.272 - 2.618 |
| '121 BG' | 0.618 - 0.707 | 1.128 - 1.733 | 0.5 - 0.577 | 0.447 - 0.786 |
| 'Black Swan' | 1.128 - 2.0 | 0.236 - 0.5 | 1.382 - 2.618 | 1.128 - 2.618 |
| 'White Swan' | 0.5 - 0.886 | 2.0 - 4.237 | 0.382 - 0.786 | 0.238 - 0.886 |
| 'NN White Swan' | 0.5 - 0.886 | 2.0 - 4.236 | 0.382 - 0.724 | 0.382 - 0.886 |
| 'Sea Pony' | 1.618 - 2.618 | 0.382 - 0.5 | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Navarro 200' | 0.886 - 3.618 | 0.886 - 1.128 | 0.382 - 0.786 | 0.886 - 1.128 |
| 'May-00' | 0.5 - 0.618 | 1.618 - 2.236 | 1.128 - 1.618 | 0.5 - 0.618 |
| 'SNORM' | 0.9 - 1.1 | 0.9 - 1.1 | 0.9 - 1.1 | 0.618 - 1.618 |
| 'COL Poruchik' | 1.0 *min - 1.0 *max | 0.382 - 2.618 | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Henry – David' | 0.618 - 0.886 | 0.44 - 0.618 | 0.128 - 2.0 | 0.618 - 1.618 |
| 'DAVID VM 1' | 1.618 - 1.618 | 0.382*min - 0.382*max | 0.128 - 1.618 | 0.618 - 3.618 |
| 'DAVID VM 2' | 1.618 - 1.618 | 0.382*min - 0.382*max | 1.618 - 3.618 | 0.618 - 7.618 |
| 'Partizan' | 1.618*min - 1.618*max | 0.382*min - 0.382*max | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Partizan 2' | 1.618 - 2.236 | 1.128 - 1.618 | 0.128 - 3.618 | 1.618 - 3.618 |
| 'Partizan 2.1' | 1.618*min - 1.618*max | 1.128*min - 1.128*max | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Partizan 2.2' | 2.236*min - 2.236*max | 1.128*min - 1.128*max | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Partizan 2.3' | 1.618*min - 1.618*max | 0.618 - 1.618 | 0.128 - 3.618 | 0.618 - 3.618 |
| 'Partizan 2.4' | 2.236*min - 2.236*max | 1.618*min - 1.618*max | 0.128 - 3.618 | 0.618 - 3.618 |
| 'TOTAL' | 1.272 - 3.618 | 0.382 - 2.618 | 0.276 - 0.786 | 0.618 - 1.618 |
| 'TOTAL NN' | 1.272 - 4.236 | 0.382 - 2.618 | 0.236 - 0.786 | 0.618 - 1.618 |
| 'TOTAL 1' | 1.272 - 2.618 | 0.382 - 0.886 | 0.382 - 0.786 | 0.786 - 0.886 |
| 'TOTAL 2' | 1.618 - 3.618 | 0.382 - 0.886 | 0.382 - 0.786 | 1.128 - 1.618 |
| 'TOTNN 2NN' | 1.618 - 4.236 | 0.382 - 0.886 | 0.382 - 0.786 | 1.128 - 1.618 |
| 'TOTAL 3' | 1.272 - 2.618 | 1.128 - 2.618 | 0.276 - 0.618 | 0.618 - 0.886 |
| 'TOTNN 3NN' | 1.272 - 2.618 | 1.128 - 2.618 | 0.236 - 0.618 | 0.618 - 0.886 |
| 'TOTAL 4' | 1.618 - 2.618 | 1.128 - 2.618 | 0.382 - 0.786 | 1.128 - 1.272 |
| 'BG 1' | 2.618*min - 2.618*max | 0.382*min - 0.382*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 2' | 2.237*min - 2.237*max | 0.447*min - 0.447*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 3' | 2.0 *min - 2.0 *max | 0.5 *min - 0.5 *max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 4' | 1.618*min - 1.618*max | 0.618*min - 0.618*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 5' | 1.414*min - 1.414*max | 0.707*min - 0.707*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 6' | 1.272*min - 1.272*max | 0.786*min - 0.786*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 7' | 1.171*min - 1.171*max | 0.854*min - 0.854*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
| 'BG 8' | 1.128*min - 1.128*max | 0.886*min - 0.886*max | 0.128 - 0.886 | 1.0 *min - 1.0 *max |
|-------------------|------------------------|------------------------|-----------------------|-----------------------|
🔶 SETTINGS
🔹 Swings
Minimum Swing Length: Minimum length used for the swing detection.
Maximum Swing Length: Maximum length used for the swing detection.
🔹 Patterns
Toggle Pattern Block
Toggle separate pattern in each Pattern Block
🔹 Tolerance
Fibonacci Ratio: Adds a percentage tolerance below/above the ratio when only one ratio applies, creating two limits.
Triangle Area Ratio: Filters patterns based on the ratio of the smallest triangle to the largest triangle.
🔹 Display
Labels: Display Pattern Names, Arrows or nothing
Patterns: Display or not
Last Line: Display previous C-D line when updated
🔹 Style
Colors: Pattern Lines/Names/Arrows - background color of patterns
Text Size: Text Size of Pattern Names/Arrows
🔹 Calculation
Calculated Bars: Allows the usage of fewer bars for performance/speed improvement
Normalized True Range - Grouped by WeekdaysThis indicator helps traders analyze daily volatility patterns across different days of the week by calculating normalized price ranges.
Unlike traditional volatility measures, it uses a normalized approach by dividing the daily range (high-low) by the midpoint price and multiplying by 100, providing a percentage-based measure that's comparable across different price levels. This normalization makes it particularly useful for comparing volatility patterns across different assets or time periods.
The indicator also includes a statistical overlay that highlights extreme volatility events. By calculating the 5th and 95th percentiles of the normalized ranges within your specified date range, it creates upper and lower bounds that help identify outlier days where volatility was exceptionally high or low.
These bounds appear as horizontal lines on the chart, making it easy to spot when current volatility breaks out of its historical norms.
The data is presented in both visual and tabular formats, with a comprehensive table showing the maximum, minimum, average, and 25th percentile ranges for each day of the week. This dual presentation allows traders to both quickly spot patterns visually and access detailed statistics for deeper analysis.
The user can customize the analysis period through simple date range inputs, making it flexible for different analytical timeframes.
Precision Swing Point V2.0 - [Gozlan]"Precision Swing Point V2.0," is well-structured and aims to highlight specific conditions in the chart while factoring in time zones and user configurations. Here's a quick breakdown and a couple of improvements or fixes to consider:
Key Features:
Multi-Symbol Analysis:
Incorporates three symbols (Symbol 1, Symbol 2, and Symbol 3) and compares their open/close values to derive candle states (green/red).
Highlighting Conditions:
Green: When Symbol 2 is red and Symbol 1 is green.
Red: When Symbol 2 is green and Symbol 1 is red.
Blue: When Symbol 3 is green and Symbol 1 is red.
Custom Time Highlights:
Allows users to specify times for highlighting specific bars.
Timezone Flexibility:
Time calculations adjust based on user-defined UTC offsets.
ICT FVG [TheFundedRoad]This indicator shows you all ICT Fair value gaps on chart with midpoint line
Fair value gap is a gap in a set of 3 candles, in a bullish FVG you have 1st candle high being lower than third candle low, and in a bearish FVG you have first candle low higher than third candle high, thats how this indicator finds these fair value gaps
It draws the fair value gap from the 2nd candle forward
You can customize the color and if you want to see the midpoint or not, midpoint is 50% of the gap
Pairs trading[Maxxxz7]Pairs Trading
This script is designed to analyze and visualize the divergence or convergence of two selected financial instruments, making it an excellent tool for implementing a pairs trading strategy. Developed for the TradingView platform, it offers extensive customization options for analysis.
Key Features:
Asset Selection:
The first asset can be taken directly from the chart or specified manually.
The second asset is always selected manually.
Data Normalization:
Calculates the percentage change of both assets relative to their initial prices.
Includes an offset for better visual interpretation.
Visualization:
Plots normalized price charts for both assets.
Highlights crossovers between the assets.
Displays the spread (difference between normalized prices) graphically.
Alerts (Works only on the 30-minute timeframe):
Configurable thresholds to trigger alerts (e.g., when the difference is smaller or larger than a set value).
Alerts for crossovers of prices and exponential moving averages (EMA).
Dynamic Labels:
Automatically adds labels to mark key events: crossovers, critical spread values, and current price information.
EMA and Deviation Analysis:
Calculates EMA for each asset.
Alerts for EMA crossovers.
Wick Length Display + Alert conditionsDescription of the Wick Length Display (Advanced) script
Originality and purpose of the script
The Wick Length Display (Advanced) script is an innovative tool for traders who want to gain detailed insights into the length of candle wicks. It stands out for its versatility and user-friendly customization options. It combines precise technical calculations with visual representation to provide important information about market movements and dynamics right on the chart.
Functionality
The script calculates and displays the length of the upper and lower wicks of each candle on the chart. It also provides additional visual cues such as:
• “Bull pressure”: When green candles do not have upper wicks, this indicates strong buying pressure.
• “Bear pressure”: When red candles do not have lower wicks, this indicates strong selling pressure.
• Threshold conditions: Only displays wicks that exceed a certain threshold (optional).
• Display in pips: Allows you to display wick lengths in pips, which is useful for forex traders.
How it works
The script analyzes each candle using the following calculations:
1. Wick length calculation:
◦ Upper wick length = High - (top of the body)
◦ Lower wick length = (bottom of the body) - Low
2. Display conditions:
◦ It distinguishes between bullish and bearish candles.
◦ It checks if the calculated wicks exceed the defined thresholds before displaying them.
3. Dynamic labels:
◦ Labels are placed above or below the respective candles.
◦ Size, color and type of labels are fully customizable.
4. Limitation of labels:
◦ To ensure clarity, a maximum number of labels is defined.
Usage
1. Customization:
◦ Open the script in the Pine Script Editor in TradingView.
◦ Use the input options to customize parameters such as color selection, label size, thresholds and other details according to your requirements.
2. Enable thresholds:
◦ Enable thresholds to show labels only for relevant wicks (default is 6).
◦ Define the minimum wick lengths for bullish (green) and bearish (red) candles.
3. Show in pips:
◦ Enable the “Show wick length in pips” option to show the results in pips (especially suitable for Forex).
4. Edit pressure labels:
◦ Turn the “Bull Pressure” and “Bear Pressure” features on or off depending on your analysis settings.
Concepts behind the calculations
• Technical market analysis: Wick lengths can indicate buying or selling pressure and provide important information on market psychology.
• Thresholds and filtering: The script uses thresholds to avoid visual overload and highlight only essential data.
• Label display: Dynamic labels improve chart readability and give the user instant feedback on market developments.
Usage
This script is great for:
• Intraday trading: Analyzing short-term movements using wick lengths.
• Forex trading: Tracking market momentum using the pip indicator.
• Swing trading: Identifying buying or selling pressure in key markets.
• Visual support: Ideal for traders who prefer a graphical display.
Description of the Wick Length Display (Advanced) script
Originality and purpose of the script
The Wick Length Display (Advanced) script is an innovative tool for traders who want to gain detailed insights into the length of candle wicks. It stands out for its versatility and user-friendly customization options. It combines precise technical calculations with visual representation to provide important information about market movements and dynamics right on the chart.
Functionality
The script calculates and displays the length of the upper and lower wicks of each candle on the chart. It also provides additional visual cues such as:
• “Bull pressure”: When green candles do not have upper wicks, this indicates strong buying pressure.
• “Bear pressure”: When red candles do not have lower wicks, this indicates strong selling pressure.
• Threshold conditions: Only displays wicks that exceed a certain threshold (optional).
• Display in pips: Allows you to display wick lengths in pips, which is useful for forex traders.
How it works
The script analyzes each candle using the following calculations:
1. Wick length calculation:
◦ Upper wick length = High - (top of the body)
◦ Lower wick length = (bottom of the body) - Low
2. Display conditions:
◦ It distinguishes between bullish and bearish candles.
◦ It checks if the calculated wicks exceed the defined thresholds before displaying them.
3. Dynamic labels:
◦ Labels are placed above or below the respective candles.
◦ Size, color and type of labels are fully customizable.
4. Limitation of labels
Alert conditions:
Alerts are triggered when the wick length of a bullish or bearish candle exceeds the defined thresholds.
Alert function:
alert() is used to issue messages with a frequency of once per candle when the conditions are met.
How to set up alerts
Save the script and add it to your chart.
Open the alert settings in TradingView.
Select the script's custom message as a trigger.
Adjust the frequency and notification type (popup, email, etc.).
Now you have a powerful tool with visual analysis and alert function!
New Bar AlertThis is probably the simplest indicator on Tradingview, it generates an alert on every new bar.
Useful for strategies where you only need chart attention at the new bar, see if you have a setup.
Helps not having to stare at the charts, the alert will tell you when it's time to take a look.
Works on all timeframes but in order to keep your sanity, best used on higher timeframes, 5mins and up.
ImbalancesThis Pine Script is a trading indicator designed to identify imbalances in the market, specifically on candlestick charts. An imbalance refers to situations where there is a significant difference between buyers and sellers, which can create gaps or areas of inefficiency in the price. These imbalances often act as zones where price may return to "fill" or correct these inefficiencies.
1. Identifying Imbalances
The script analyzes candlestick patterns to detect imbalances based on the relationship between the highs, lows, and closes of consecutive candles. Specifically, it looks for:
Top Imbalances (Bearish): Areas where selling pressure has dominated, causing inefficiencies in the price. These are represented by patterns like multiple consecutive bearish candles or bearish gaps.
Bottom Imbalances (Bullish): Areas where buying pressure has dominated, leading to bullish gaps or inefficiencies.
When an imbalance is detected, the script highlights the area using visual boxes on the chart.
2. Visual Representation
The indicator uses colored boxes to show imbalances directly on the chart:
Top (Bearish) Imbalances: Highlighted using shades of red.
Bottom (Bullish) Imbalances: Highlighted using shades of green.
The boxes are further categorized into three states based on their level of mitigation:
Unmitigated: The imbalance has not been "filled" by price yet.
Partially Mitigated: Price has entered the imbalance zone but not completely filled it.
Fully Mitigated: Price has completely filled the imbalance zone.
3. Mitigation Logic
The concept of mitigation refers to the price revisiting an imbalance zone to correct the inefficiency:
If price fully or partially revisits an imbalance zone, the box's color changes to indicate the mitigation level (e.g., from unmitigated to partially/fully mitigated).
Fully mitigated boxes may be removed or recolored, depending on user preferences.
4. User Customization
The script provides several inputs to customize its behavior:
Enable or disable top and bottom imbalance detection.
Color settings: Users can define different colors for unmitigated, partially mitigated, and fully mitigated imbalances.
Mitigation display options: Users can choose whether to show fully mitigated imbalances on the chart or remove them.
5. Key Calculations
Imbalance Size: The size of the imbalance is calculated as the price difference between a candle's high and low across the relevant pattern.
Pattern Detection: The script checks for specific candlestick patterns (e.g., three consecutive bearish candles) to identify potential imbalances.
6. Practical Use Case
This indicator is useful for traders who:
Rely on supply and demand zones for their trading strategies.
Look for areas where price is likely to return (retesting unmitigated imbalances can signal potential trade setups).
Want to visually track market inefficiencies over time.
In Summary
The "Imbalances" indicator highlights and tracks price inefficiencies on candlestick charts. It marks zones where buying or selling pressure was dominant, and it dynamically updates these zones based on price action to indicate their mitigation status. This tool is particularly helpful for traders who use price action and market structure in their strategies.
Perfect Hammer Pattern Indicators and Alerts# Perfect Hammer Pattern Indicators and Alerts
This indicator identifies a specific and precise hammer candlestick pattern formation that can signal potential trend reversals or continuation setups. Unlike traditional hammer pattern indicators, this script focuses on exact wick measurements to identify high-probability trade setups.
## Pattern Specifications
### Bullish Setup Requirements
- Two consecutive green (bullish) candles
- Both candles must have NO lower wick (perfect bottom)
- Both candles must have an upper wick (showing buying pressure)
- Previous candle must be red (bearish) for context
- Marked with a green 'H' below the pattern
### Bearish Setup Requirements
- Two consecutive red (bearish) candles
- Both candles must have NO upper wick (perfect top)
- Both candles must have a lower wick (showing selling pressure)
- Previous candle must be green (bullish) for context
- Marked with a red 'H' above the pattern
## Trading Logic
This pattern is particularly effective because it shows clear control by either buyers (bullish pattern) or sellers (bearish pattern):
- In the bullish pattern, the absence of lower wicks indicates strong buying pressure preventing prices from falling below the open, while the upper wicks show profit-taking at highs
- In the bearish pattern, the absence of upper wicks shows strong selling pressure capping any upward movement, while the lower wicks indicate some buying support below
## Alerts
The indicator includes two alert conditions:
1. Bullish Pattern Alert: Triggers when two perfect bullish hammers appear after a bearish candle
2. Bearish Pattern Alert: Triggers when two perfect bearish hammers appear after a bullish candle
## Usage Tips
- Best used on timeframes 15 minutes and above
- Consider using in conjunction with key support/resistance levels
- Volume confirmation can increase pattern reliability
- The pattern may signal either trend continuation or reversal - always consider the larger market context
## Notes
- This indicator focuses on precise hammer formations rather than approximate patterns
- The requirement for consecutive perfect hammers makes this a relatively rare but high-probability setup
- Visual markers ('H') provide easy pattern identification on charts
Moving Average with Buy/Sell SignalsBINANCE:BTCUSD
Pine Script Brief: "44 Moving Average with Buy/Sell Signals"
This Pine Script is designed to generate buy and sell signals based on the interaction of the price with the 44-period Simple Moving Average (SMA). It also considers the closing behavior of the last five candles to further refine the conditions for generating signals. The script is intended for use in technical analysis for trading strategies on platforms like TradingView.
Features:
44-Period Simple Moving Average (SMA):
The script calculates and plots the 44-period SMA of the closing price on the chart, providing a trend-following indicator.
The SMA is used as a key level to determine when price action is "touching" or interacting with the moving average.
Buy and Sell Signal Logic:
Buy Signal:
The candle is green (close > open).
The candle's high and low are around the 44 SMA, indicating the candle is "touching" or near the moving average.
At least 2 of the last 5 candles must have closed above the 44 SMA.
The 44 SMA is positioned below the midpoint of the current candle.
Sell Signal:
The candle is red (close < open).
The candle's high and low are around the 44 SMA.
At least 2 of the last 5 candles must have closed below the 44 SMA.
The 44 SMA is positioned above the midpoint of the current candle.
Label Plotting:
The script uses the plotSignal function to plot buy and sell labels directly on the chart. The labels are plotted at the low of a green candle (for buy signals) and the high of a red candle (for sell signals).
Labels are color-coded for quick identification: green for buy and red for sell.
EMA for Smoothing (Optional):
An optional Exponential Moving Average (EMA) is plotted for additional trend smoothing, allowing users to visualize another moving average for possible trend-following strategies.
The length of the EMA is customizable, and it is plotted on the chart alongside the 44 SMA.
Alert Conditions:
Alerts can be set up for both buy and sell signals, notifying the user when these conditions are met. The alerts are triggered whenever the script detects a valid buy or sell signal.
Customizable Inputs:
The script allows customization of the following:
Smoothing Length: For the optional EMA line.
Tolerance: For adjusting the proximity check (candle touching the 44 SMA).
Styling: The color and text of the buy and sell labels can be customized.
Usage:
This script can be used by traders who want to identify possible entry and exit points based on price interaction with the 44-period moving average, combined with the behavior of previous candles. It is suitable for trend-following strategies and can be used in conjunction with other indicators to refine trading decisions.
Key Benefits:
Provides visual signals (buy/sell) directly on the chart.
Considers both immediate price action and historical trends (previous candles).
Offers customization for moving averages and labels.
Alerts can be set for automated notifications.
This Pine Script helps traders make informed decisions by combining the reliability of moving averages with price action and historical candle behavior, enhancing trading strategies based on trend-following principles.
Asset MaxGain MinLoss Tracker [CHE]Asset MaxGain MinLoss Tracker – Your Tool to Discover the Best Trading Opportunities
Introduction
Hello dear traders,
Today, I'd like to introduce you to a fantastic tool: the Asset MaxGain MinLoss Tracker . This indicator is designed to help you identify the best trading opportunities in the market by analyzing the maximum gain and adjusted maximum loss potentials of various assets.
Why Use This Indicator?
1. Time-Saving Analysis
Instead of spending hours sifting through different charts, this indicator provides you with key metrics for up to 10 assets at a glance.
2. Compare Multiple Assets Simultaneously
Monitor and compare multiple assets to discover which ones offer the highest profit potential and the lowest risk of loss.
3. Customizable Settings
Adjust the observation period and select the assets you want to analyze according to your trading strategy.
4. Clear Visual Representation
Data is presented in an easy-to-read table directly on your chart, highlighting assets with the highest maximum gain and the lowest adjusted maximum loss.
How to Use It in Everyday Trading
Step 1: Setting Up the Indicator
Select Your Assets: Choose up to 10 assets you wish to track. These can be cryptocurrencies, stocks, forex pairs, etc.
Configure the Trading Period Length: Set the number of bars (candles) over which you want to calculate the maximum gain and adjusted maximum loss. This allows you to tailor the analysis to your preferred time frame, whether it's short-term trading or long-term investing.
Step 2: Interpreting the Results
Maximum Gain (%): This value shows the potential upside of each asset over the selected period. A higher percentage indicates a greater potential for profit if the asset's price moves upward.
Adjusted Maximum Loss (%): This figure represents the potential downside risk, adjusted to give a more accurate reflection of loss potential. A lower percentage means less risk of significant loss.
Category Highlighting: Assets are categorized based on their performance:
High Gain & Low Loss: Assets that have both the highest max gain and the lowest adjusted max loss.
High Gain: Assets with the highest max gain.
Low Loss: Assets with the lowest adjusted max loss.
Step 3: Making Trading Decisions
Identify Opportunities: Focus on assets categorized as High Gain & Low Loss for the most favorable risk-to-reward scenarios.
Risk Management: Use the adjusted maximum loss to assess and mitigate potential risks associated with each asset.
Portfolio Diversification: Allocate your investments across assets with varying levels of gain and loss potentials to diversify your portfolio effectively.
Practical Example
Imagine you're monitoring the following assets:
Asset 1: BTCUSD
Asset 2: ETHUSD
Asset 3: ADAUSD
Asset 4: XRPUSD
After applying the indicator:
BTCUSD shows a high maximum gain but also a high adjusted maximum loss.
ETHUSD has both a high maximum gain and a low adjusted maximum loss, categorizing it as High Gain & Low Loss.
ADAUSD indicates a low maximum gain but the lowest adjusted maximum loss.
XRPUSD reflects moderate values in both categories.
Decision Making:
Primary Focus: ETHUSD may be your top choice due to its high reward and lower risk.
Risk-Averse Option: ADAUSD could be considered if you prioritize minimizing losses.
Balanced Approach: Diversify by investing in both ETHUSD and ADAUSD.
Understanding the Core Functionality
While you don't need to delve deep into the code to use the indicator effectively, understanding its core function can enhance your confidence in the tool.
The Main Function: Calculating Max Gain and Adjusted Max Loss
The heart of the indicator is a function that calculates two critical metrics for each asset:
Maximum Gain (sym_MaxGain):
Purpose: Measures the highest potential profit over the selected period.
How It Works: It finds the lowest price (sym_minlow) within the period and calculates the percentage increase to the current high price. This shows how much you could have gained if you bought at the lowest point.
Adjusted Maximum Loss (sym_AdjustedMaxLoss):
Purpose: Provides an adjusted measure of the potential loss, giving a more realistic risk assessment.
How It Works: It identifies the highest price (sym_maxhigh) within the period and calculates the percentage decrease to the current low price. This value is adjusted to account for the diminishing impact as losses approach 100%.
Simplified Explanation of the Function
Data Retrieval: For each asset (sym), the function retrieves the high and low prices over the specified timeframe.
Calculations:
Find Highest and Lowest Prices: Determines sym_maxhigh and sym_minlow within the tracking period.
Compute Max Gain: Calculates the potential gain from sym_minlow to the current high.
Compute Max Loss: Calculates the potential loss from sym_maxhigh to the current low.
Adjust Max Loss: Adjusts the max loss calculation to prevent distortion as losses near 100%.
Output: Returns both sym_MaxGain and sym_AdjustedMaxLoss for further analysis.
Benefits of Understanding the Function
Transparency: Knowing how these values are calculated can increase your trust in the indicator's outputs.
Customization: If you're familiar with coding, you might tailor the function to suit specific trading strategies.
Enhanced Analysis: Understanding the underlying calculations allows you to interpret the results more effectively, aiding in better decision-making.
Conclusion
The Asset MaxGain MinLoss Tracker is a powerful tool that can significantly enhance your trading efficiency and effectiveness by:
Providing Quick Insights: Save time by getting immediate access to essential performance metrics of multiple assets.
Assisting in Risk Management: Use the adjusted maximum loss to understand and mitigate potential risks.
Supporting Strategic Decisions: Identify assets with the best risk-to-reward ratios to optimize your trading strategy.
Take advantage of this indicator to elevate your trading game and make more informed decisions with confidence.
Thank you for your time, and happy trading!
Disclaimer:
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
This indicator is inspired by the "Max Gain" indicator. A special thanks to Skipper86 for his relentless effort, creativity, and contributions to the TradingView community, which served as a foundation for this work.
Risk-Reward Labels Minimal with OffsetIndicator Explanation
The indicator “Risk-Reward Labels Minimal with Offset” is designed to assist traders in managing risk and potential rewards. It displays the Stop-Loss (SL) and Take-Profit (TP) levels for both long and short positions based on identified support and resistance levels.
Key Features:
1. Risk-Reward Ratio: Traders can adjust the risk-reward ratio to define the relationship between potential losses and potential gains (e.g., 1:1 or 1:2).
2. Risk Distance: The distance (in pips) is set to determine where to place the SL and TP levels.
3. Labels with Offset: SL and TP labels can be shifted by an offset (bars), allowing for better visualization.
4. Support and Resistance Levels: The indicator dynamically calculates support and resistance. When a support or resistance level is broken, the corresponding labels are deleted.
5. Display in Range Markets: If the market is ranging or lacks a clear trend, both long and short labels are displayed. This allows traders to identify potential entry opportunities in both directions, even when the market is not clearly trending.
6. Deletion Logic: If the price falls below support or rises above resistance, the relevant SL and TP labels are removed. However, in a Range situation, the possibility of seeing both long and short labels remains, increasing flexibility and helping to avoid false signals.
Order BlockOverview:
The Order Block Indicator is designed to help traders identify key bullish and bearish order blocks on their charts. Order blocks are significant price zones where institutional activity may have occurred, often leading to strong reversals or continuations. This indicator visually highlights these blocks and provides alerts for potential trade opportunities.
Key Features
Bullish Order Blocks (Yellow):
Identifies bullish structures where price signals a potential upward movement.
Highlighted in bright yellow to stand out on your chart.
Bearish Order Blocks (Pink):
Detects bearish structures where price suggests a possible downward movement.
Highlighted in pink for easy identification.
Alerts for Order Blocks:
Sends a notification whenever a bullish or bearish order block is detected.
Keeps you informed of key market zones even when you’re away from the screen.
How It Works
Bullish Order Block Criteria
The last candle (close ) is bullish (close > open).
The second last candle (close ) is bearish (close < open).
The bullish candle’s close is above the high of the bearish candle.
The bearish candle’s close is above the low of the third last candle.
The bearish candle’s low is below the low of the third last candle.
The current candle’s low is above the bearish candle’s high.
These conditions combine to identify strong bullish zones.
Bearish Order Block Criteria
The last candle (close ) is bearish (close < open).
The second last candle (close ) is bullish (close > open).
The bearish candle’s close is below the low of the bullish candle.
The third last candle’s high is above the bullish candle’s close.
The bullish candle’s high is above the high of the third last candle.
The current candle’s high is below the bullish candle’s low.
This logic highlights potential bearish zones.
How to Use It
Add the Indicator to Your Chart:
Use it on any timeframe to spot bullish or bearish order blocks.
Visual Assistance:
Yellow bars indicate bullish order blocks.
Pink bars represent bearish order blocks.
Set Alerts:
Configure alerts to notify you when a bullish or bearish order block appears.
Customization
Colors: Easily change the colors for bullish and bearish order blocks.
Alerts: Adjust alert messages to suit your trading preferences.
Disclaimer:
This indicator is a technical analysis tool and should be used alongside other strategies and market analysis. It does not guarantee profits and carries trading risks. Always trade responsibly.
Prometheus Markov ChainThe Prometheus Markov Chain Indicator is a custom-built tool designed to predict potential future price movements using a Markov Chain approach. A Markov Chain is a statistical model that assumes the probability of moving to a future state depends solely on the current state. In this indicator, states represent price movement classifications—bullish, bearish, or neutral—and are determined based on historical price changes (percentage returns). The indicator builds a transition matrix to calculate probabilities of transitioning from one state to another, enabling traders to identify patterns and forecast likely price actions.
Core Functionality and Transition Matrix
The transition matrix is the backbone of the Markov Chain. It captures the frequency of transitions between states in the historical price data and normalizes these counts into probabilities. For example, if the price was in a bearish state and transitioned to a bullish state 3 out of 10 times, the probability of transitioning from bearish to bullish would be 0.3. The matrix is created dynamically using the stateFunc function to classify states, which can use either dynamic thresholds (highest and lowest returns over a lookback period) or a user-defined percent return threshold. Below is the snippet that updates the transition matrix:
transitionMatrix = matrix.new(dimension, dimension, 0.0)
for i = 0 to array.size(vec) - 2
fromState = array.get(vec, i)
toState = array.get(vec, i + 1)
transitionMatrix.set(fromState, toState, transitionMatrix.get(fromState, toState) + 1)
for i = 0 to dimension - 1
rowSum = 0.0
for j = 0 to dimension - 1
rowSum += transitionMatrix.get(i, j)
for j = 0 to dimension - 1
prob = transitionMatrix.get(i, j) / rowSum
transitionMatrix.set(i, j, prob)
This snippet iterates through historical price movements, counts state transitions, and then normalizes each row of the matrix so that the sum of probabilities for all possible transitions from a given state equals 1.
How the Indicator Predicts Future States
After constructing the transition matrix, the indicator calculates the current state of the price based on the latest percentage return and then uses the matrix to compute probabilities for transitioning to other states. The state with the highest probability is predicted as the next state, which is displayed on the chart using color-coded labels: green for bullish and red for bearish. The following snippet demonstrates how the current state and predictions are calculated:
current_chng = (close - close ) / close
var int current_state = na
if not use_custom_thresh
highest_chng = ta.highest(current_chng, int(size) * 2)
lowest_chng = ta.lowest(current_chng, int(size) * 2)
current_state := stateFunc(current_chng, highest_chng, lowest_chng)
else
current_state := stateFunc(current_chng, custom_thresh)
predicted_probs = array.new(dimension, 0.0)
for j = 0 to dimension - 1
array.set(predicted_probs, j, transitionMatrix.get(current_state, j))
The indicator evaluates which state has the highest transition probability (highest_prob) and places corresponding labels on the chart. For example, if the next state is predicted to be bullish, a green "Bullish" label is placed below the current bar. This predictive functionality helps traders anticipate potential reversals or continuations in price trends based on historical behavior patterns.
Usage:
Here we see the indicator at work on $PLTR. The states predicted are bullish then bearish. In this example we then see price move in a way that verifies those predictions.
On this 4 Hour NASDAQ:AMZN chart we see predictions play out in a short trade style. States quickly move from one to another but not without giving traders a way to take advantage.
This is the perspective we aim to provide. We encourage traders to not follow indicators blindly. No indicator is 100% accurate. This one can give you a different perspective market state. We encourage any comments about desired updates or criticism!
Crypto Arbitrage Scanner [CryptoSea]Crypto Arbitrage Scanner
The Crypto Arbitrage Scanner is an advanced tool designed to help traders identify arbitrage opportunities across multiple cryptocurrency exchanges. With the ability to compare prices, volumes, and differences in price, this indicator is a must-have for any trader seeking to exploit cross-exchange inefficiencies in real time.
Key Features
Multi-Exchange Price and Volume Comparison: Tracks data from multiple major cryptocurrency exchanges, including BINANCE, COINBASE, KUCOIN, and others, allowing traders to easily compare prices and volume across platforms.
Customizable Difference Metrics: Allows users to toggle between displaying price differences in percentages or absolute dollar values, depending on the preferred metric for arbitrage analysis.
Sorting and Filtering Options: Includes user-defined sorting options to order the data by Price, Volume, or Difference, helping to prioritize potential arbitrage opportunities based on the trader's chosen criteria.
Difference and Volume Thresholds: Users can specify the minimum volume and price difference thresholds, ensuring that only significant arbitrage opportunities are highlighted.
Real-Time Alerts: Built-in alert conditions notify users when arbitrage opportunities exceed their defined price difference thresholds, helping traders respond instantly to market movements.
The Crypto Arb Scanner displays a table of prices, volumes, and price differences across selected exchanges. Each exchange is listed along with the current close price, volume, and the difference in price compared to the average price across all exchanges. Highlighting is used to indicate significant differences that may present arbitrage opportunities.
In the example below, we can see a highlighted opportunity in green showing that the price is below the user inputed thresold.
How it Works
Data Collection: Gathers real-time volume and price data from various exchanges using a streamlined process, allowing for a detailed comparison.
Average Price Calculation: Computes the average price across all valid exchanges to identify where price discrepancies occur, providing a clear picture of arbitrage potential.
Sorting Mechanism: Utilizes custom sorting based on user preferences, making it easy to quickly analyze and identify key opportunities.
Dynamic Highlighting and Alerts: Price differences that exceed user-defined thresholds are highlighted, and alerts can be triggered for these arbitrage opportunities, allowing for a timely response.
Application
Arbitrage Trading: The Crypto Arb Scanner is ideal for traders looking to exploit price differences across exchanges, enabling efficient arbitrage opportunities.
Market Efficiency Analysis: Offers insights into the consistency of prices across exchanges, which can help gauge the efficiency and liquidity of the markets being traded.
Customizable Alerts: Set alerts based on price differences or volume, allowing traders to stay informed about changes without constantly monitoring the markets.
The Crypto Arbitrage Scanner is a powerful addition to any trader's toolkit, offering comprehensive features to detect arbitrage opportunities with confidence. With real-time monitoring, customizable metrics, and a user-friendly interface, this tool allows traders to make informed decisions and capitalize on inefficiencies across exchanges.
Enhanced Kaufman Adaptive Moving Average (KAMA) with Bollinger B# Enhanced Kaufman Adaptive Moving Average (KAMA) with Bollinger Bands
## Overview
This indicator combines the Kaufman Adaptive Moving Average (KAMA) with Bollinger Bands to create a comprehensive trading system. It provides adaptive trend following capabilities while measuring market volatility and potential reversal points.
## Key Features
- Adaptive moving average that adjusts to market conditions
- Dynamic Bollinger Bands for volatility measurement
- Color-coded KAMA line indicating trend direction
- Integrated buy/sell signals based on multiple confirmations
- Customizable parameters for both KAMA and Bollinger Bands
- Optional bar confirmation wait feature
- Built-in alert conditions for trade signals
## Main Components
### 1. Kaufman Adaptive Moving Average (KAMA)
- Adapts to market volatility using an efficiency ratio
- Changes color based on trend direction (green for uptrend, red for downtrend)
- Adjustable parameters for fine-tuning:
- Base Length: Controls the main calculation period (default: 10)
- Fast EMA Length: For rapid market response (default: 2)
- Slow EMA Length: For stable market conditions (default: 30)
### 2. Bollinger Bands
- Standard deviation-based volatility bands
- Customizable length and standard deviation multiplier
- Includes expansion threshold for volatility measurement
- Components:
- Upper Band: Upper volatility threshold
- Middle Band: Simple moving average
- Lower Band: Lower volatility threshold
## Signal Generation
### Buy Signals
Generated when:
1. KAMA color changes from red to green
2. Price closes above KAMA
3. Price closes above the middle Bollinger Band
4. Signals are marked with:
- Green triangles below the candles
- "B" labels for easy identification
### Sell Signals
Generated when:
1. KAMA color changes from green to red
2. Price closes below KAMA
3. Price closes below the middle Bollinger Band
4. Signals are marked with:
- Red triangles above the candles
- "S" labels for easy identification
## Customizable Parameters
### KAMA Settings
- Base Length (1-50)
- Fast EMA Length (1-10)
- Slow EMA Length (10-50)
- Source Price Selection
- Direction Highlight Toggle
- Bar Confirmation Option
### Bollinger Bands Settings
- Length (default: 20)
- Standard Deviation Multiplier (default: 2.0)
- Expansion Threshold (0.1-3.0)
## Alert Functionality
Built-in alerts for:
- Buy signals with customizable messages
- Sell signals with customizable messages
## Best Practices
### Timeframe Selection
- Works well on multiple timeframes
- Recommended for 15m to 4h charts for optimal signal generation
- Higher timeframes provide more reliable trend signals
### Parameter Optimization
- Adjust KAMA lengths based on trading style:
- Shorter lengths for day trading
- Longer lengths for swing trading
- Fine-tune BB multiplier based on market volatility
- Consider waiting for bar confirmation in volatile markets
### Risk Management
- Use in conjunction with other indicators for confirmation
- Consider market conditions and volatility when trading signals
- Implement proper position sizing and stop-loss levels
## Technical Notes
- Written in Pine Script™ v6
- Overlay indicator (displays on price chart)
- Compatible with all TradingView-supported markets
- Resource-efficient implementation for smooth performance
## Disclaimer
This indicator is provided under the Mozilla Public License 2.0. While it can be a valuable tool for technical analysis, it should not be used as the sole basis for trading decisions. Always combine with proper risk management and additional analysis methods.
4-Frame Trend CountThis script tracks the current close vs the close from 4 time frames prior to spot a trend reversal after 9 consecutive up or down moves.
Richs Market StructureThis Pine Script indicator, "Last Bullish High & Lowest Low Tracker with Timeframe Background and Fill", is designed to visually track bullish and bearish trends based on price action on the current chart and a user-defined timeframe. It provides dynamic line plotting, area fills, and background coloring to represent trend alignment between the current chart and the selected timeframe.
Features and Functionalities
Tracks Bullish Highs and Bearish Lows:
The script identifies:
Bullish High: The highest price reached after a bullish (green) candle.
Bearish Low: The lowest price reached after a bearish (red) candle.
It dynamically updates these levels based on the price movements.
Line Plotting:
Current Chart Lines:
The Plotted Bullish High line (green/red) indicates the last bullish high.
The Lowest Low line (green/red) indicates the last bearish low.
Selected Timeframe Lines:
A separate set of lines is plotted for the user-defined timeframe (e.g., daily, weekly):
A Bullish High Line for the selected timeframe (lighter green).
A Lowest Low Line for the selected timeframe (lighter red).
Dynamic Area Fills:
The area between the Plotted Bullish High and Lowest Low is filled:
Green Fill: When both lines are green (indicating a bullish alignment).
Red Fill: When both lines are red (indicating a bearish alignment).
For the selected timeframe:
The area between the timeframe-specific Bullish High and Lowest Low is similarly filled with lighter colors.
Background Color Based on Timeframe Alignment:
The background color represents the trend alignment on the selected timeframe:
Green Background: When the timeframe’s Bullish High is rising and Lowest Low is rising (bullish trend).
Red Background: When the timeframe’s Bullish High is falling and Lowest Low is falling (bearish trend).
What It’s For
This indicator is designed for traders who want to:
Visualize Trends Across Timeframes:
It helps identify when the current chart’s trend aligns with a higher timeframe trend (e.g., daily, weekly).
Useful for multi-timeframe analysis.
Spot Bullish and Bearish Trends:
The color-coded lines and fills clearly show the dominant trend on both the current chart and the selected timeframe.
Plan Trades Based on Trend Alignment:
When the current chart and selected timeframe show the same trend:
Both lines and fills turn green (bullish).
Both lines and fills turn red (bearish).
This alignment is a potential signal for entering long or short trades.
Identify Reversals and Divergences:
Divergence between the current chart and timeframe trends (e.g., green on one, red on the other) may indicate trend weakening or reversal.
Visual Elements
Lines:
Solid lines (current chart): Represent the Plotted Bullish High and Lowest Low.
Dashed/lighter lines (selected timeframe): Represent the timeframe-specific Bullish High and Lowest Low.
Fills:
Green/Red fills highlight trend zones:
On the current chart (darker).
On the selected timeframe (lighter).
Background:
The entire chart background turns green or red based on the selected timeframe’s trend alignment.
Summary
This indicator is ideal for traders who want a clear visual representation of price trends and multi-timeframe alignment. It simplifies trend-following strategies by providing:
Easy-to-interpret fills and background colors.
Clear bullish and bearish zones.
Multi-timeframe trend confirmation.
Breaks and Retests - Free990Strategy Description: "Breaks and Retests - Free990"
The "Breaks and Retests - Free990" strategy is based on identifying breakout and retest opportunities for potential entries in both long and short trades. The idea is to detect price breakouts above resistance levels or below support levels, and subsequently identify retests that confirm the breakout levels. The strategy offers an automated approach to enter trades after a breakout followed by a retest, which serves as a confirmation of trend continuation.
Key Components:
Support and Resistance Detection:
The strategy calculates pivot levels based on historical price movements to define support and resistance areas. A lookback range is used to determine these key levels.
Breakouts and Retests:
The system identifies when a breakout occurs above a resistance level or below a support level.
It then waits for a retest of the previously broken level as confirmation, which is often a better entry opportunity.
Trade Direction Selection:
Users can choose between "Long Only," "Short Only," or "Both" directions for trading based on their market view.
Stop Loss and Trailing Stop:
An initial stop loss is placed at a defined percentage away from the entry.
The trailing stop loss is activated after the position gains a specified percentage in profit.
Long Entry:
A long entry is triggered if the price breaks above a resistance level and subsequently retests that level successfully.
The entry condition checks if the breakout was confirmed and if a retest was valid.
The long entry is only executed if the user-selected direction is either "Long Only" or "Both."
Short Entry:
A short entry is triggered if the price breaks below a support level and subsequently retests that level.
The short entry is only executed if the user-selected direction is either "Short Only" or "Both."
sell_condition checks whether the support has been broken and whether the retest condition is valid.
An initial stop loss is placed when the trade is opened to limit the risk if the trade moves against the position.
The stop loss is calculated based on a user-defined percentage (stop_loss_percent) of the entry price.
pinescript
Copy code
stop_loss_price := strategy.position_avg_price * (1 - stop_loss_percent / 100)
For long positions, the stop loss is placed below the entry price.
For short positions, the stop loss is placed above the entry price.
Trailing Stop:
When a position achieves a certain profit threshold (profit_threshold_percent), the trailing stop mechanism is activated.
For long positions, the trailing stop follows the highest price reached, ensuring that some profit is locked in if the price reverses.
For short positions, the trailing stop follows the lowest price reached.
Code Logic for Trailing Stop:
Exit Execution:
The strategy exits the position when the price hits the calculated stop loss level.
This includes both the initial stop loss and the trailing stop that adjusts as the trade progresses.
Code Logic for Exit:
Summary:
Breaks and Retests - Free990 uses support and resistance levels to identify breakouts, followed by retests for confirmation.
Entry Points: Triggered when a breakout is confirmed and a retest occurs, for both long and short trades.
Exit Points:
Initial Stop Loss: Limits risk for both long and short trades.
Trailing Stop Loss: Locks in profits as the price moves in favor of the position.
This strategy aims to capture the momentum after breakouts and minimize losses through effective use of stop loss and trailing stops. It gives the flexibility of selecting trade direction and ensures trades are taken with confirmation through the retest, which helps to reduce false breakouts.
Original Code by @HoanGhetti
Price Action Dynamics Oscillator (PADO)1 minute ago
Price Action Dynamics Oscillator (PADO)
Indicator Overview and Technical Deep Dive
Concept and Philosophy
The Price Action Dynamics Oscillator (PADO) is a sophisticated technical analysis tool designed to provide multi-dimensional insights into market behavior by decomposing price action into manipulation and distribution metrics. The indicator goes beyond traditional momentum or trend indicators by introducing a nuanced approach to understanding market microstructure.
Key Architectural Components
1. Timeframe and Depth Selection
Pivot Depth Options:
Short Term (Length: 12 periods)
Intermediate Term (Length: 20 periods)
Long Term (Length: 100 periods)
This flexible configuration allows traders to adapt the indicator's sensitivity to different market conditions and trading styles.
2. Core Calculation Methodology
Manipulation Metrics
Calculates manipulation differently for green (bullish) and red (bearish) candles
Normalized against Average True Range (ATR) for consistent comparison across different volatility environments
Green Candle Manipulation: (Open - Low) / ATR
Red Candle Manipulation: (High - Open) / ATR
Distribution Metrics
Measures the directional strength and potential momentum shift
Green Candle Distribution: (Close - Open)
Red Candle Distribution: (Open - Close)
3. Normalization and Smoothing
Uses Simple Moving Average (SMA) for smoothing
Dynamic length calculation based on price range distance
Ensures minimum SMA length of 2 to prevent calculation errors
Unique Features
Visualization Toggles
Traders can selectively display:
Manipulation data
Distribution data
Long-term reference lines
Valuation metrics
Strategy signals
Valuation Comparative Analysis
Compares current manipulation and distribution metrics to 1000-bar long-term averages
Color-coded visualization for quick interpretation
Blue: Manipulation above average
Purple: Manipulation below average
Orange: Distribution above average
Yellow: Distribution below average
Strategy Deployment
Generates a composite strategy signal by comparing manipulation and distribution valuations
Uses Exponential Moving Average (EMA) for smoother signal generation
Incorporates volatility bands for context-aware signal interpretation
Quadrant Analysis
Classifies market state into four quadrants based on manipulation and distribution valuations:
Q1: Low Manipulation, High Distribution
Q2: High Manipulation, High Distribution
Q3: Low Manipulation, Low Distribution
Q4: High Manipulation, Low Distribution
Each quadrant is color-coded to provide visual market state representation.
Warning Signals
Manipulation Warning: When strategy crosses below low volatility band
Distribution Warning: When strategy crosses above high volatility band
Visual Indicators
Bar coloration based on strategy momentum
Multiple color states representing different market dynamics
Recommended Use Cases
Intraday and swing trading
Multi-timeframe market analysis
Volatility and momentum assessment
Trend reversal and continuation identification
Potential Limitations
Complexity might require significant trader education
Performance can vary across different market conditions
Requires careful parameter optimization
Recommended Settings
Best used on liquid markets with clear price action
Ideal for:
Forex
Futures
Large-cap stocks
Cryptocurrency pairs
Customization and Optimization
Traders should:
Backtest across multiple assets
Adjust timeframe settings
Calibrate visualization toggles
Use in conjunction with other technical indicators
Licensing
Mozilla Public License 2.0
Open-source and modification-friendly
Conclusion
The PADO represents an advanced approach to market analysis, blending traditional technical analysis with innovative metrics for deeper market understanding.
PADO Quadrant Color Analysis: Deep Dive
Quadrant Color Scheme Breakdown
Quadrant 1: Lime Green Background (RGB: 0, 255, 21, 90)
Condition: val_manip < 1 AND val_distr > 1
Market Interpretation:
Low Manipulation Pressure
High Distribution Activity
Potential Scenario:
Smart money might be gradually distributing positions
Trading Implications:
Caution for current trend followers
Potential preparation for trend change
Increased probability of consolidation or reversal
Quadrant 2: Bright Blue Background (RGB: 0, 191, 255, 90)
Condition: val_manip > 1 AND val_distr > 1
Market Interpretation:
High Manipulation Pressure
High Distribution Activity
Potential Scenario:
Strong institutional involvement
Potential market transition phase
Significant volume and momentum
Trading Implications:
High volatility expected
Increased market uncertainty
Potential for sharp price movements
Requires careful risk management
Quadrant 3: Light Gray Background (RGB: 252, 252, 252, 90)
Condition: val_manip < 1 AND val_distr < 1
Market Interpretation:
Low Manipulation Pressure
Low Distribution Activity
Potential Scenario:
Market consolidation
Reduced institutional activity
Potential low-volatility period
Trading Implications:
Range-bound market
Reduced trading opportunities
Potential setup for future breakout
Ideal for mean reversion strategies
Quadrant 4: Light Yellow Background (Hex: #f6ff0019)
Condition: val_manip > 1 AND val_distr < 1
Market Interpretation:
High Manipulation Pressure
Low Distribution Activity
Potential Scenario:
Accumulation of positions
Trading Implications:
Increased probability of directional move soon
Color Psychology and Technical Significance
Color Selection Rationale
Lime Green (Q1): Represents potential growth and transition
Bright Blue (Q2): Signifies high energy and institutional activity
Light Gray (Q3): Indicates neutrality and consolidation
Transparent Green (Q4): Suggests emerging trend potential
Advanced Interpretation Guidelines
Color Transition Analysis
Observe how the quadrant colors change
Rapid color shifts might indicate:
Market regime changes
Shifts in institutional sentiment
Potential trend acceleration or reversal
Technical Implementation Notes
Calculation Snippet
pinescriptCopyq1 = (val_manip < 1) and (val_distr > 1)
q2 = (val_manip > 1) and (val_distr > 1)
q3 = (val_manip < 1) and (val_distr < 1)
q4 = (val_manip > 1) and (val_distr < 1)
bgcolor(q1 ? color.rgb(0, 255, 21, 90):
q2 ? color.rgb(0, 191, 255, 90):
q3 ? color.rgb(252, 252, 252, 90):
q4 ? #f6ff0019:na)
Alpha Channel (Transparency)
90 and 0x19 values ensure background color doesn't overwhelm chart
Allows underlying price action to remain visible
Subtle visual cue without significant chart obstruction
Practical Trading Recommendations
Never Trade Solely on Quadrant Colors
Use as a complementary analysis tool
Combine with other technical and fundamental indicators
Timeframe Considerations
Validate quadrant signals across multiple timeframes
Longer timeframes provide more reliable signals
Risk Management
Set appropriate stop-loss levels
Use position sizing strategies
Be prepared for false signals
Recommended Workflow
Identify current quadrant
Assess overall market context
Confirm with other indicators
Execute with proper risk management