Yearly Profit BackgroundDescription:
The Yearly Profit Background indicator is a powerful tool designed to help traders quickly visualize the profitability of each calendar year on their charts. By analyzing the annual performance of an asset, this indicator colors the background of each completed year green if the year was profitable (close > open) or red if it resulted in a loss (close < open). This visual representation allows traders to identify long-term trends and historical performance at a glance.
Key Features:
Annual Profit Calculation: Automatically calculates the yearly performance based on the opening price of January 1st and the closing price of December 31st.
Visual Background Coloring: Highlights each completed year with a green (profit) or red (loss) background, making it easy to spot trends.
Customizable Transparency: The background colors are set at 90% transparency, ensuring they don’t obstruct your chart analysis.
Optional Price Plots: Displays the annual opening (blue line) and closing (orange line) prices for additional context.
How to Use:
Add the indicator to your chart.
Observe the background colors for each completed year:
Green: The year was profitable.
Red: The year resulted in a loss.
Use the optional price plots to analyze annual opening and closing levels.
Ideal For:
Long-term investors analyzing historical performance.
Traders looking to identify multi-year trends.
Anyone interested in visualizing annual market cycles.
Why Use This Indicator?
Understanding the annual performance of an asset is crucial for making informed trading decisions. The Yearly Profit Background indicator simplifies this process by providing a clear, visual representation of yearly profitability, helping you spot patterns and trends that might otherwise go unnoticed.
Индикаторы и стратегии
Fibonacci 3-D🟩 The Fibonacci 3-D indicator is a visual tool that introduces a three-dimensional approach to Fibonacci projections, leveraging market geometry. Unlike traditional Fibonacci tools that rely on two points and project horizontal levels, this indicator leverages slopes derived from three points to introduce a dynamic element into the calculations. The Fibonacci 3-D indicator uses three user-defined points to form a triangular structure, enabling multi-dimensional projections based on the relationships between the triangle’s sides.
This triangular framework forms the foundation for the indicator’s calculations, with each slope (⌳AB, ⌳AC, and ⌳BC) representing the rate of price change between its respective points. By incorporating these slopes into Fibonacci projections, the indicator provides an alternate approach to identifying potential support and resistance levels. The Fibonacci 3-D expands on traditional methods by integrating both historical price trends and recent momentum, offering deeper insights into market dynamics and aligning with broader market geometry.
The indicator operates across three modes, each defined by the triangular framework formed by three user-selected points (A, B, and C):
1-Dimensional (1-D): Fibonacci levels are based on a single side of the triangle, such as AB, AC, or BC. The slope of the selected side determines the angle of the projection, allowing users to analyze linear trends or directional price movements.
2-Dimensional (2-D): Combines two slopes derived from the sides of the triangle, such as AB and BC or AC and BC. This mode adds depth to the projections, accounting for both historical price swings and recent market momentum.
3-Dimensional (3-D): Integrates all three slopes into a unified projection. This mode captures the full geometric relationship between the points, revealing a comprehensive view of geometric market structure.
🌀 THEORY & CONCEPT 🌀
The Fibonacci 3-D indicator builds on the foundational principles of traditional Fibonacci analysis while expanding its scope to capture more intricate market structures. At its core, the indicator operates based on three user-selected points (A, B, and C), forming the vertices of a triangle that provides the structural basis for all calculations. This triangle determines the slopes, projections, and Fibonacci levels, aligning with the unique geometric relationships between the chosen points. By introducing multiple dimensions and leveraging this triangular framework, the indicator enables a deeper examination of price movements.
1️⃣ First Dimension (1-D)
In technical analysis, traditional Fibonacci retracement and extension tools operate as one-dimensional instruments. They rely on two price points, often a swing high and a swing low, to calculate and project horizontal levels at predefined Fibonacci ratios. These levels identify potential support and resistance zones based solely on the price difference between the selected points.
A one-dimensional Fibonacci showing levels derived from two price points (B and C).
The Fibonacci 3-D indicator extends this one-dimensional concept by introducing Ascending and Descending projection options. These options calculate the levels to align with the directional movement of price, creating sloped projections instead of purely horizontal levels.
1-D mode with an ascending projection along the ⌳BC slope aligned to the market's slope. Potential support is observed at 0.236 and 0.382, while resistance appears at 1.0 and 0.5.
2️⃣ Second Dimension (2-D)
The second dimension incorporates a second side of the triangle, introducing relationships between two slopes (e.g., ⌳AB and ⌳BC) to form a more dynamic three-point structure (A, B, and C) on the chart. This structure enables the indicator to move beyond the single-axis (price) calculations of traditional Fibonacci tools. The sides of the triangle (AB, AC, BC) represent slopes calculated as the rate of price change over time, capturing distinct components of market movement, such as trend direction and momentum.
2-D mode of the Fibonacci 3-D indicator using the ⌳AC slope with a descending projection. The Fibonacci projections align closely with observed market behavior, providing support at 0.236 and resistance at 0.618. Unlike traditional zigzag setups, this configuration uses two swing highs (A and B) and a swing low (C). The alignment along the descending slope highlights the geometric relationships between selected points in identifying potential support and resistance levels.
3️⃣ Third Dimension (3-D)
The third dimension expands the analysis by integrating all three slopes into a unified calculation, encompassing the entire triangle structure formed by points A, B, and C. Unlike the second dimension, which analyzes pairwise slope relationships, the 3-D mode reflects the combined geometry of the triangle. Each slope contributes a distinct perspective: AB and AC provide historical context, while BC emphasizes the most recent price movement and is given greater weight in the calculations to ensure projections remain responsive to current dynamics.
Using this integrated framework, the 3-D mode dynamically adjusts Fibonacci projections to balance long-term patterns and short-term momentum. The projections extend outward in alignment with the triangle’s geometry, offering a comprehensive framework for identifying potential support and resistance zones and capturing market structures beyond the scope of simpler 1-D or 2-D modes.
Three-dimensional Fibonacci projection using the ⌳AC slope, aligning closely with the market's directional movement. The projection highlights key levels: resistance at 0.0 and 0.618, and support at 1.0, 0.786, and 0.382.
By leveraging all three slopes simultaneously, the 3-D mode introduces a level of complexity particularly suited for volatile or non-linear markets. The weighted slope calculations ensure no single price movement dominates the analysis, allowing the projections to adapt dynamically to the broader market structure while remaining sensitive to recent momentum.
Three-dimensional ascending projection. In 3D mode, the indicator integrates all three slopes to calculate the angle of projection for the Fibonacci levels. The resulting projections adapt dynamically to the overall geometry of the ABC structure, aligning with the market’s current direction.
🔂 Interactions: Dimensions. Slope Source, Projections, and Orientation
The Dimensions , Projections , and Orientation settings work together to define Fibonacci projections within the triangular framework. Each setting plays a specific role in the geometric analysis of price movements.
♾️ Dimension determines which of the three modes (1-D, 2-D, or 3-D) is used for Fibonacci projections. In 1-D mode, the projections are based on a single side of the triangle, such as AB, AC, or BC. In 2-D mode, two sides are combined, producing levels based on their geometric relationship. The 3-D mode integrates all three sides of the triangle, calculating projections using weighted averages that emphasize the BC side for its relevance to recent price movement while maintaining historical context from the AB and AC sides.
A one-dimensional Fibonacci projection using the ⌳AB slope with a neutral projection. Important levels of interaction are highlighted: repeated resistance at Level 1.0 and repeated support at Levels 0.5 and 0.618. The projection aligns horizontally, reflecting the relationship between points A, B, and C while identifying recurring zones of market structure.
🧮 Slope Source determines which side of the triangle (AB, AC, or BC) serves as the foundation for Fibonacci projections. This selection directly impacts the calculations by specifying the slope that anchors the geometric relationships within the chosen Dimension mode (1-D, 2-D, or 3-D).
In 1-D mode, the selected Source defines the single side used for the projection. In 2-D and 3-D modes, the Source works in conjunction with other settings to refine projections by integrating the selected slope into the multi-dimensional framework.
One-dimensional Fibonacci projection using the ⌳AC Slope Source and Ascending projection. The projection continues on the AC slope line.
🎯 Projection controls the direction and alignment of Fibonacci levels. Neutral projections produce horizontal levels, similar to traditional Fibonacci tools. Ascending and Descending projections adjust the levels along the calculated slope to reflect market trends. These options allow the indicator’s outputs to align with different market behaviors.
An ascending projection along the ⌳BC slope aligns with resistance levels at 1.0, 0.618, and 0.236. The geometric relationship between points A, B, and C illustrates how the projection adapts to market structure, identifying resistance zones that may not be captured by traditional Fibonacci tools.
🧭 Orientation modifies the alignment of the setup area defined by points A, B, and C, which influences Fibonacci projections in 2-D and 3-D modes. In Default mode, the triangle aligns naturally based on the relative positions of points B and C. In Inverted mode, the geometric orientation of the setup area is reversed, altering the slope calculations while preserving the projection direction specified in the Projection setting. In 1-D mode, Orientation has no effect since only one side is used for the projection.
Adjusting the Orientation setting provides alternative views of how Fibonacci levels align with the market's structure. By recalibrating the triangle’s setup, the inverted orientation can highlight different relationships between the sides, providing additional perspectives on support and resistance zones.
2-D inverted. The ⌳AC slope defines the projection, and the inverted orientation adjusts the alignment of the setup area, altering the angles used in level calculations. Key levels are highlighted: resistance at 0.786, strong support at 0.5 and 0.236, and a resistance-turned-support interaction at 0.618.
🛠️ CONFIGURATION AND SETTINGS 🛠️
The Fibonacci 3-D indicator includes configurable settings to adjust its functionality and visual representation. These options include customization of the dimensions (1-D, 2-D, or 3-D), slope calculations, orientations, projections, Fibonacci levels, and visual elements.
When adding the indicator to a new chart, select three reference points (A, B, and C). These are usually set to recent swing points. All three points can be easily changed at any time by clicking on the reference point and dragging it to a new location.
By default, all settings are set to Auto . The indicator uses an internal algorithm to estimate the projections based on the orientation and relative positions of the reference points. However, all values can be overridden to reflect the user's interpretation of the current market geometry.
⚙️ Core Settings
Dimensions : Defines how many sides of the triangle formed by points A, B, and C are incorporated into the calculations for Fibonacci projections. This setting determines the level of complexity and detail in the analysis. 1-D : Projects levels along the angle of a single user-selected side of the triangle.
2-D : Projects levels based on a composite slope derived from the angles of two sides of the triangle.
3-D : Projects levels based on a composite slope derived from all three sides of the triangle (A-B, A-C, and B-C), providing a multi-dimensional projection that adapts to both historical and recent market movements.
Slope Source : Determines which side of the triangle is used as the basis for slope calculations. A–B: The slope between points A and B. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
A–C: The slope between points A and C. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
B--C: The slope between points B and C. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
Orientation : Defines the triangle's orientation formed by points A, B, and C, influencing slope calculations. Auto : Automatically determines orientation based on the relative positions of points B and C. If point C is to the right of point B, the orientation is "normal." If point C is to the left, the orientation is inverted.
Inverted : Reverses the orientation set in "Auto" mode. This flips the triangle, reversing slope calculations ⌳AB becomes ⌳BA).
Projection : Determines the direction of Fibonacci projections: Auto : Automatically determines projection direction based on the triangle formed by A, B, and C.
Ascending : Projects the levels upward.
Neutral : Projects the levels horizontally, similar to traditional Fibonacci retracements.
Descending : Projects the levels downward.
⚙️ Fibonacci Level Settings Show or hide specific levels.
Level Value : Adjust Fibonacci ratios for each level. The 0.0 and 1.0 levels are fixed.
Color : Set level colors.
⚙️ Visibility Settings Show Setup : Toggle the display of the setup area, which includes the projected lines used in calculations.
Show Triangle : Toggle the display of the triangle formed by points A, B, and C.
Triangle Color : Set triangle line colors.
Show Point Labels : Toggle the display of labels for points A, B, and C.
Show Left/Right Labels : Toggle price labels on the left and right sides of the chart.
Fill % : Adjust the fill intensity between Fibonacci levels (0% for no fill, 100% for full fill).
Info : Set the location or hide the Slope Source and Dimension. If Orientation is Inverted , the Slope Source will display with an asterisk (*).
⚙️ Time-Price Points : Set the time and price for points A, B, and C, which define the Fibonacci projections.
A, B, and C Points : User-defined time and price coordinates that form the foundation of the indicator's calculations.
Interactive Adjustments : Changes made to points on the chart automatically synchronize with the settings panel and update projections in real time.
Notes
Unlike traditional Fibonacci tools that include extensions beyond 1.0 (e.g., 1.618 or 2.618), the Fibonacci 3-D indicator restricts Fibonacci levels to the range between 0.0 and 1.0. This is because the projections are tied directly to the proportional relationships along the sides of the triangle formed by points A, B, and C, rather than extending beyond its defined structure.
The indicator's calculations dynamically sort the user-defined A, B, and C points by time, ensuring point A is always the earliest, point C the latest, and point B the middle. This automatic sorting allows users to freely adjust the points directly on the chart without concern for their sequence, maintaining consistency in the triangular structure.
🖼️ ADDITIONAL CHART EXAMPLES 🖼️
Three-dimensional ⌳AC slope is used with an ascending projection, even as the broader market trend moves downward. Despite the apparent contradiction, the projected Fibonacci levels align closely with price action, identifying zones of support and resistance. These levels highlight smaller countertrend movements, such as pullbacks to 0.382 and 0.236, followed by continuations at resistance levels like 0.618 and 0.786.
In 2-D mode, an ascending projection based on the BC slope highlights the market's geometric structure. A setup triangle, defined by a swing high (A), a swing low (B), and another swing high (C), reveals Fibonacci projections aligning with support at 0.236, 0.382, and 0.5, and resistance at 0.618, 0.786, and 1.0, as shown by the green and red arrows. This demonstrates the ability to uncover dynamic support and resistance levels not calculated in traditional Fibonacci tools.
In 2-D mode with an ascending projection from the ⌳AB slope, price movement is contained within the 0.5 and 0.786 levels. The 0.5 level serves as support, while the 0.786 level acts as resistance, with price action consistently interacting with these boundaries.
An AC (2-D) ascending projection is derived from two swing highs (A and B) and a swing low (C), reflecting a non-linear market structure that deviates from traditional zigzag patterns. The ascending projection aligns closely with the market's upward trajectory, forming a channel between the 0.0 and 0.5 Fibonacci levels. Note how price action interacts with the projected levels, showing support at 0.236 and 0.382, with the 0.5 level acting as a mid-channel equilibrium.
Two-dimensional ascending Fibonacci projection using the ⌳AC slope. Arrows highlight resistance at 0.786 and support at 0.0 and 0.236. The projection follows the ⌳AC slope, reflecting the geometric relationship between points A, B, and C to identify these levels.
Three-dimensional Fibonacci projection using the ⌳AC slope, aligned with the actual market's directional trend. By removing additional Fibonacci levels, the image emphasizes key areas: resistance at Level 0.0 and support at Levels 1.0 and 0.5. The projection dynamically follows the ⌳AC slope, adapting to the market's structure as defined by points A, B, and C.
A three-dimensional configuration uses the ⌳AB slope as the baseline for projections while incorporating the geometric influence of point C. Only the 0.0 and 0.618 levels are enabled, emphasizing the relationship between support at 0.0 and resistance at 0.618. Unlike traditional Fibonacci tools, which operate in a single plane, this setup reveals levels that rely on the triangular relationship between points A, B, and C. The third dimension allows for projections that align more closely with the market’s structure and reflect its multi-dimensional geometry.
The Fibonacci 3-D indicator can adapt to non-traditional point selection. Point A serves as a swing low, while points B and C are swing highs, forming an unconventional configuration. ⌳The BC slope is used in 2-D mode with an inverted orientation, flipping the projection direction and revealing resistance at Level 0.786 and support at Levels 0.618 and 0.5.
⚠️ DISCLAIMER ⚠️
The Fibonacci 3-D indicator is a visual analysis tool designed to illustrate Fibonacci relationships. While the indicator employs precise mathematical and geometric formulas, no guarantee is made that its calculations will align with other Fibonacci tools or proprietary methods. Like all technical and visual indicators, the Fibonacci projections generated by this tool may appear to visually align with key price zones in hindsight. However, these projections are not intended as standalone signals for trading decisions. This indicator is intended for educational and analytical purposes, complementing other tools and methods of market analysis.
🧠 BEYOND THE CODE 🧠
The Fibonacci 3-D indicator, like other xxattaxx indicators , is designed to encourage both education and community engagement. Your feedback and insights are invaluable to refining and enhancing the Fibonacci 3-D indicator. We look forward to the creative applications, adaptations, and observations this tool inspires within the trading community.
hector mena Breakout Trading with ATR, RSI and MA CrossTitle: Breakout Trading Strategy with ATR, RSI, and Moving Average Cross
Description (English):
This script combines key technical indicators—ATR (Average True Range), RSI (Relative Strength Index), and Moving Averages—to provide a comprehensive breakout trading strategy. It is designed to help traders identify significant breakout levels and confirm signals with momentum and trend analysis.
How It Works:
ATR for Breakout Levels:
The ATR is used to calculate dynamic breakout levels by adjusting the highest resistance and lowest support levels with a customizable multiplier. This ensures that breakout levels adapt to market volatility.
RSI for Momentum Confirmation:
The RSI identifies overbought and oversold conditions, providing an additional layer of confirmation for breakouts. A breakout accompanied by an RSI signal can indicate stronger momentum.
Moving Average Cross for Trend Validation:
Two simple moving averages (short-term and long-term) are included to validate the trend. A crossover suggests a potential change in trend, aligning with breakout signals.
Why Combine These Indicators?
The ATR ensures breakout levels are realistic and volatility-adjusted.
The RSI avoids false signals by confirming if the price has momentum during a breakout.
Moving Average crossovers add trend-following confirmation, helping traders align with market direction.
The combination provides a robust framework to filter out false signals and improve the reliability of trading decisions.
Key Features:
Breakout Levels: Upper and lower breakout levels dynamically calculated using ATR.
RSI Confirmation: Visual overbought (70) and oversold (30) levels and RSI plot.
Trend Validation: Short and long-term moving averages plotted on the chart with crossover signals.
Visual Alerts: Clear "BUY" and "SELL" labels for actionable signals.
Custom Alerts: Configurable alerts for breakouts and moving average crossovers.
How to Use It:
Adjust the parameters (ATR length, multiplier, RSI length, and moving averages) based on your trading strategy.
Look for "BUY" signals when:
Price breaks above the resistance level, and RSI indicates oversold conditions.
Moving averages cross bullishly.
Look for "SELL" signals when:
Price breaks below the support level, and RSI indicates overbought conditions.
Moving averages cross bearishly.
Use alerts for automated notifications about potential trades.
Notes:
This script is intended for educational purposes. Use it alongside proper risk management techniques and backtesting.
Always test in demo mode before applying it to live trading.
Malaysian SnR [by DanielM]The Malaysian SnR (Support and Resistance) levels are a popular trading concept that identifies specific price levels on charts which are considered significant for trading decisions. Here's a breakdown of the concepts:
A Levels and V Levels: These refer to specific types of SNR levels:
A Levels: These are formed at the highest points of price movements. The indicator highlights these levels with a red line.
V Levels: These are formed at the lowest points of price movements, typically observed as valleys in chart patterns. The indicator highlights these levels with a green line.
Fresh and Unfresh Levels:
Fresh Levels: These are price levels that have not been touched by a wick since their formation. They are considered more significant because they might provide a stronger reaction when the price touches these levels again.
Unfresh Levels: These are levels that have been touched by a wick since their formation. Each time a level is tested, it is considered less significant because it might offer weaker resistance or support. A level that has been tested can become fresh again if it's crossed by a candle body.
Gaps:
A gap occurs when you have two bullish candles or two bearish candles. It is defined as the area between the close of the first candle and the open of the next one. It is marked by drawing a line at the closing price of the first candle, thus representing the level where the gap was initially observed. The indicator highlights these levels with a blue lines for bullish gaps and violet lines for bearish gaps.
Fresh vs. Unfresh Gaps:
Similar to A and V levels, gaps can be classified as fresh or unfresh. A fresh gap is one that hasn't been touched by a wick after it was created. These are often considered more significant because they may hold stronger as potential support or resistance. Unfresh gaps have been touched by a wick, and they may be considered less significant. A gap that has been tested can become fresh again if it's crossed by a candle body.
Inputs:
Number of bars to look back to detect A levels, V levels, and Gaps.
Allows users to toggle the visibility of only fresh A and V levels.
Allows users to decide whether to display gap levels or not.
Allows users to decide whether to display only fresh gaps.
Allows the users to set the maximum number of A levels, V levels and gaps on the chart.
AllDay Session TimesIndicator: Custom Session Times
This indicator is designed to assist traders by visualizing specific trading session times on the TradingView platform. It highlights two important trading sessions: the Day Session and the Evening Session, providing a visual aid that helps traders navigate the markets with greater accuracy.
Day Session Time Range:
Starts: 10:55 UTC+2
Ends: 13:30 UTC+2
Evening Session Time Range:
Starts: 16:55 UTC+2
Ends: 18:30 UTC+2
How It Works:
Colors and Backgrounds: This indicator uses background colors to differentiate the sessions. The green background appears during the Day Session, while the blue background indicates the Evening Session.
Lines: Session time ranges are also marked with clear lines on the chart, making it easier to identify the specific session periods.
Time Zone: The time zone is set to UTC+2 (Europe/Helsinki), but it can easily be adjusted to match your local time zone.
Why Use This Indicator?
This indicator is especially useful for traders who focus on specific market sessions. For example:
The Day Session might be when the market is more active, and trends are clearer.
The Evening Session could be a good time to observe market adjustments based on the events of the day and find potential trading opportunities.
By visualizing these specific time frames, the indicator helps reduce distractions and enables a more focused approach to trading.
Use Cases:
This indicator is ideal for:
Day traders and swing traders who want to focus on certain market sessions.
Technical analysts who prefer to visualize market behavior within specific time frames.
Strategy optimization and a more precise assessment of market conditions.
Features:
Visual session markers that help traders focus on key trading periods.
Easy customization of time zone and session time ranges.
Background colors and lines that improve chart readability and session tracking.
Made By AllDayEsa
Auto Wyckoff Schematic [by DanielM]This indicator is designed to automatically detect essential components of Wyckoff schematics. This tool aims to capture the critical phases of liquidity transfer from weak to strong hands, occurring before a trend reversal. While the Wyckoff method is a comprehensive and a very nuanced approach, every Wyckoff schematic is unique, making it impractical to implement all its components without undermining the detection of the pattern. Consequently, this script focuses on the essential elements critical to identifying these schematics effectively.
Key Features:
Swing Detection Sensitivity:
The sensitivity of swing detection is adjustable through the input parameter. This parameter controls the number of past bars analyzed to determine swing highs and lows, allowing users to fine-tune detection based on market volatility and timeframes.
Pattern Detection Logic:
Accumulation Schematic:
Detects consecutive lower swing lows, representing phases like Selling Climax (SC) and Spring, which often precede a trend reversal upward. After the final low is identified, a higher high is detected to confirm the upward trend initiation.
Labeled Key Points:
SC: Selling Climax, marking the beginning of the accumulation zone.
ST: Secondary Test during the schematic.
ST(b): Secondary Test in phase B.
Spring: The lowest point in the schematic, signaling a final liquidity grab.
SOS: Sign of Strength, confirming a bullish breakout.
The schematic is outlined visually with a rectangle to highlight the price range.
Distribution Schematic:
Detects consecutive higher swing highs, which indicate phases such as Buying Climax (BC) and UTAD, often leading to a bearish reversal. After the final high, a lower low is detected to confirm the downward trend initiation.
Labeled Key Points:
BC: Buying Climax, marking the beginning of the distribution zone.
ST: Secondary Test during the schematic.
UT: Upthrust.
UTAD: Upthrust After Distribution, signaling the final upward liquidity grab before a bearish trend.
SOW: Sign of Weakness, confirming a bearish breakout.
The schematic is visually outlined with a rectangle to highlight the price range.
Notes:
Simplification for Practicality: Due to the inherent complexity and variability of Wyckoff schematics, the indicator focuses only on the most essential features—liquidity transfer and key reversal signals.
Limitations: The tool does not account for all components of Wyckoff's method (e.g., minor phases or nuanced volume analysis) to maintain clarity and usability.
Unique Behavior: Every Wyckoff schematic is different, and this tool is designed to provide a simplified, generalized approach to detecting these unique patterns.
[COG] Advanced School Run StrategyAdvanced School Run Strategy (ASRS) – Explanation
Overview: The Advanced School Run Strategy (ASRS) is an intraday trading approach designed to identify breakout opportunities based on specific time and price patterns. This script applies the concepts of the Advanced School Run Strategy as outlined in Tom Hougaard's research, adapted to work seamlessly on TradingView charts. It leverages 5-minute candlestick data to set actionable breakout levels and provides traders with visual cues and alerts to make informed decisions.
Features:
Dynamic Breakout Levels: Automatically calculates high and low levels based on the market's behavior during the initial trading minutes.
Custom Visualization: Highlights breakout zones with customizable colors and transparency, providing clear visual feedback for bullish and bearish breakouts.
Configurable Alerts: Includes alert conditions for both bullish and bearish breakouts, ensuring traders never miss a trading opportunity.
Reset Logic: Resets breakout levels daily at the market open to ensure accurate signal generation for each session.
How It Works:
The script identifies key levels (high and low) after a configurable number of minutes from the market open (default: 25 minutes).
If the price breaks above the high level or below the low level, a corresponding breakout is detected.
The script draws breakout zones on the chart and triggers alerts based on the breakout direction.
All levels and signals reset at the start of each new trading session, maintaining relevance to current market conditions.
Customization Options:
Line and box colors for bullish and bearish breakouts.
Transparency levels for breakout visualizations.
Alert settings to receive notifications for detected breakouts.
Acknowledgment: This script is inspired by Tom Hougaard's Advanced School Run Strategy. The methodology has been translated into Pine Script for TradingView users, adhering to TradingView’s policies and community guidelines. This script does not redistribute proprietary content from the original research but implements the principles for educational and analytical purposes.
Fractals with Flexible Visuals and Auto HTFPurpose:
This indicator displays fractals, including significant ones, with enhanced visual
flexibility and new visualization modes.
Functionality:
- Regular Fractals of Current Timeframe: **
Displays standard fractals based on the current chart timeframe.
- Significant Fractals: **
Recognizes significant fractals through a combination of apexes from the current
timeframe and a higher timeframe (HTF).
- Fractal Filtering: **
- Please note that this option makes some fractals dissapear, but someone finds this
to be useful.
- Fractal filtering has been made separate for Regular and Significant fractals.
- HH/LL Labels: **
HH/LL and LH/HL labels are now available separately for Regular and Significant
fractals.
- Automatic HTF Switching for Significant Fractals:
Added automatic HTF thresholds, removing the need to set HTF manually when changing
the chart's timeframe.
- Marker Relocation Modes:
- Mode 0:0
The fractal appears on the bar when it is recognized, not where it forms. This
mode assists traders who want to observe recognition in real-time when developing
strategies with fractals.
- Mode 1:1
The fractal appears on the previous bar when it is recognized, not where it forms.
- Mode 2:2 (General)
The fractal appears two bars back, where it is recognized, not when.
- Other additional Modes for Significant Fractals:
May be good for experimenting with Significant fractals. The first number
indicates bars back for the current timeframe; the second number indicates
bars back for the higher timeframe.
Other modes may assist with additional filtering or be suitable for specific
pairs or timeframes.
- Visual Adjustments:
Added user settings to customize visuals according to preferences.
Acknowledgment:
This indicator's functionality has been refactored from Fractals V9 by Ricardo
Santos (with gratitude to him):
()
'RSFractals' is not used as a name prefix, reflecting that this version lacks the
Zigzag and Pattern functionalities present in 'RSFractals'. If the original author
prefers a different naming convention, they may contact me, and I will gladly make
the adjustment.
Breakout Josip strategy is focused on analyzing price movements during specific time intervals (from 9:00 AM to 12:00 PM) each day. It tracks the highest and lowest prices in that period and uses them to set targets for potential trades, placing horizontal lines based on these levels. Additionally, you're interested in tracking the success and failure of trades based on whether price breaks certain levels during this time range. The strategy also calculates various metrics like the percentage of successful trades, failed trades, and total trades during a selected time range.
Anomaly DetectorPrice Anomaly Detector
This is a script designed to identify unusual price movements. By analyzing deviations from typical price behavior, this tool helps traders spot potential trading opportunities and manage risks effectively.
---
Features
- Anomaly Detection: Flags price points that significantly deviate from the average.
- Visual Indicators: Highlights anomalies with background colors and cross markers.
- Customizable Settings: Adjust sensitivity and window size to match your trading strategy.
- Real-Time Analysis: Continuously updates anomaly signals as new data is received.
---
Usage
After adding the indicator to your chart:
1. View Anomalies: Red backgrounds and cross markers indicate detected anomalies.
2. Adjust Settings: Modify the `StdDev Threshold` and `Window Length` to change detection sensitivity.
3. Interpret Signals:
- Red Background: Anomaly detected on that bar.
- Red Cross: Specific point of anomaly.
---
Inputs
- StdDev Threshold: Higher values reduce anomaly sensitivity. Default: 2.0.
- Window Length: Larger windows smooth data, reducing false positives. Default: 20.
---
Limitations
- Approximation Method: Uses a simple method to detect anomalies, which may not capture all types of unusual price movements.
- Performance: Extremely large window sizes may impact script performance.
- Segment Detection: Does not group consecutive anomalies into segments.
---
Disclaimer : This tool is for educational purposes only. Trading involves risk, and you should perform your own analysis before making decisions. The author is not liable for any losses incurred.
Weekly Change(Green&Red) & Percentage Change(Blue&Yellow)Display bar chart of weekly price action. Use to determine the maximum price change in one week. It would be the possible strike price for a covered call option for weekly income.
Custom Support LineIt is made with the following conditions in mind.
1. At the center of the candle at the moment,
Out of the last 10 candles, the low price (L) is within 3% of each other, drawing one line at the low prices of the candles.
2. Out of the last 10 candles, the market price (O) is within 3% of each other, drawing one line at the low end of each candle.
3.Out of the last 10 candles, the closing price (C) is within 3% of each other, and one line is drawn at the lower prices of the candles.
4. Draw one line when the three lines match the above three conditions.
We wanted to create a clear support line according to the above conditions.
Last Candle Close Above/Below AlertHow it works:
The script calculates whether the close of each candle is above or below the close of the previous candle, same as the initial code.
isLastBar is checked and the last candle to be created is the only one that will receive the condition from this variable.
If a highlight is needed it will use this criteria and apply the correct color for the last candle only, and any other candle will not be colored.
If alerts are enabled they will only work for the last bar too.
How to Use:
Add this script to your TradingView chart.
Use the inputs to set the desired timeframe to analyze, whether you want an alert for candles closing above or closing below and the background colors.
The last candle will highlight yellow when the close is higher or lower than the previous candle.
Alerts will be triggered on the last candle if you enable the alert conditions.
Key Features:
Timeframe Selection: You can choose a different timeframe in the settings.
Candle Highlight: Candles that close above or below the previous candle are highlighted in yellow.
Alerts: Alerts are configurable to trigger for "Close Above" or "Close Below" conditions, based on your selection in the settings.
Candle Emotion Index (CEI)The Candle Emotion Index (CEI) is a comprehensive sentiment analysis indicator that combines three sub-oscillators—Indecision Oscillator, Fear Oscillator, and Greed Oscillator—to provide a single, unified measure of market sentiment. By analyzing bullish, bearish, and indecisive candlestick patterns, the CEI delivers a holistic view of market emotions and helps traders identify key turning points.
How It Works
Indecision Oscillator: Measures market uncertainty using Doji and Spinning Top candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Fear Oscillator: Measures bearish sentiment using Shooting Star, Hanging Man, and Bearish Engulfing candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Greed Oscillator: Measures bullish sentiment using Marubozu, Bullish Engulfing, Hammer, and Three White Soldiers candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Candle Emotion Index Calculation: The CEI is calculated as the average of the Indecision, Fear, and Greed Oscillators: CEI = (Indecision Oscillator + Fear Oscillator + Greed Oscillator) / 3
Plotting: The CEI is plotted as a single line on the chart, representing overall market sentiment.
Reference lines are added to indicate Low Emotion, Neutral, and High Emotion levels.
The Candle Emotion Index provides a unified perspective on market sentiment by blending indecision, fear, and greed into one easy-to-interpret metric. It serves as a powerful tool for traders seeking to gauge market psychology and identify high-probability trading opportunities. For best results, use the CEI in conjunction with other technical indicators to confirm signals.
Rolling CAGRRolling CAGR (Compound Annual Growth Rate) Indicator
This indicator calculates and plots the rolling Compound Annual Growth Rate (CAGR) for any selected data source. CAGR represents the mean annual growth rate of an investment over a specified time period, taking into account the effect of compounding.
Features:
• Customizable data source (default: close price)
• Adjustable time period in years
• Configurable trading days per year (252 for stocks, 365 for crypto)
• Results displayed as percentage values
• Works on daily timeframes
Input Parameters:
• Data Source: Select the price or indicator data to analyze
• Number of Years: Set the lookback period for CAGR calculation
• Trading Days in a Year: Adjust based on market type (252 for stocks, 365 for crypto)
Usage:
Perfect for analyzing long-term growth rates and comparing investment performance across different periods. The indicator provides a rolling view of compound growth, helping traders and investors understand the sustained growth rate of an asset over their chosen timeframe.
Note: This indicator is designed for daily timeframes as CAGR calculations are most meaningful over longer periods.
Formula Used:
CAGR = (End Value / Start Value)^(1/number of years) - 1
Quantitative Breakout Bands (AIBitcoinTrend)Quantitative Breakout Bands (AIBitcoinTrend) is an advanced indicator designed to adapt to dynamic market conditions by utilizing a Kalman filter for real-time data analysis and trend detection. This innovative tool empowers traders to identify price breakouts, evaluate trends, and refine their trading strategies with precision.
👽 What Are Quantitative Breakout Bands, and Why Are They Unique?
Quantitative Breakout Bands combine advanced filtering techniques (Kalman Filters) with statistical measures such as mean absolute error (MAE) to create adaptive price bands. These bands adjust to market conditions dynamically, providing insights into volatility, trend strength, and breakout opportunities.
What sets this indicator apart is its ability to incorporate both position (price) and velocity (rate of price change) into its calculations, making it highly responsive yet smooth. This dual consideration ensures traders get reliable signals without excessive lag or noise.
👽 The Math Behind the Indicator
👾 Kalman Filter Estimation:
At the core of the indicator is the Kalman Filter, a recursive algorithm used to predict the next state of a system based on past observations. It incorporates two primary elements:
State Prediction: The indicator predicts future price (position) and velocity based on previous values.
Error Covariance Adjustment: The process and measurement noise parameters refine the prediction's accuracy by balancing smoothness and responsiveness.
👾 Breakout Bands Calculation:
The breakout bands are derived from the mean absolute error (MAE) of price deviations relative to the filtered trendline:
float upperBand = kalmanPrice + bandMultiplier * mae
float lowerBand = kalmanPrice - bandMultiplier * mae
The multiplier allows traders to adjust the sensitivity of the bands to market volatility.
👾 Slope-Based Trend Detection:
A weighted slope calculation measures the gradient of the filtered price over a configurable window. This slope determines whether the market is trending bullish, bearish, or neutral.
👾 Trailing Stop Mechanism:
The trailing stop employs the Average True Range (ATR) to calculate dynamic stop levels. This ensures positions are protected during volatile moves while minimizing premature exits.
👽 How It Adapts to Price Movements
Dynamic Noise Calibration: By adjusting process and measurement noise inputs, the indicator balances smoothness (to reduce noise) with responsiveness (to adapt to sharp price changes).
Trend Responsiveness: The Kalman Filter ensures that trend changes are quickly identified, while the slope calculation adds confirmation.
Volatility Sensitivity: The MAE-based bands expand and contract in response to changes in market volatility, making them ideal for breakout detection.
👽 How Traders Can Use the Indicator
👾 Breakout Detection:
Bullish Breakouts: When the price moves above the upper band, it signals a potential upward breakout.
Bearish Breakouts: When the price moves below the lower band, it signals a potential downward breakout.
The trailing stop feature offers a dynamic way to lock in profits or minimize losses during trending moves.
👾 Trend Confirmation:
The color-coded Kalman line and slope provide visual cues:
Bullish Trend: Positive slope, green line.
Bearish Trend: Negative slope, red line.
👽 Why It’s Useful for Traders
Dynamic and Adaptive: The indicator adjusts to changing market conditions, ensuring relevance across timeframes and asset classes.
Noise Reduction: The Kalman Filter smooths price data, eliminating false signals caused by short-term noise.
Comprehensive Insights: By combining breakout detection, trend analysis, and risk management, it offers a holistic trading tool.
👽 Indicator Settings
Process Noise (Position & Velocity): Adjusts filter responsiveness to price changes.
Measurement Noise: Defines expected price noise for smoother trend detection.
Slope Window: Configures the lookback for slope calculation.
Lookback Period for MAE: Defines the sensitivity of the bands to volatility.
Band Multiplier: Controls the band width.
ATR Multiplier: Adjusts the sensitivity of the trailing stop.
Line Width: Customizes the appearance of the trailing stop line.
Disclaimer: This indicator is designed for educational purposes and does not constitute financial advice. Please consult a qualified financial advisor before making investment decisions.
Choppiness IndexThis Pine Script v6 indicator calculates the Choppiness Index over a user-defined length and segments it based on user-defined thresholds for choppy and trending market conditions. The indicator allows users to toggle the visibility of choppy, trending, and neutral segments using checkboxes.
Here's how it works:
Inputs: Users can set the length for the Choppiness Index calculation and thresholds for choppy and trending conditions. They can also choose which segments to display.
Choppiness Index Calculation: The script calculates the Choppiness Index using the ATR and the highest-high and lowest-low over the specified length.
Segment Determination: The script determines which segment the current Choppiness Index value falls into based on the thresholds. The color changes exactly at the threshold values.
Dynamic Plotting: The Choppiness Index is plotted with a color that changes based on the segment. The plot is only visible if the segment is "turned on" by the user.
Threshold Lines: Dashed horizontal lines are plotted at the choppy and trending thresholds for reference.
This indicator helps traders visualize market conditions and identify potential transitions between choppy and trending phases, with precise color changes at the threshold values.
MACD DashboardThe MACD Dashboard is an addition to my collection of various dashboards that are designed to help traders make wiser decisions.
How to Use MACD Dashboard:
Timeframe Selection: Based on your trading style and preferences, choose the relevant timeframes. In the settings, enable or disable timeframes to focus on the most relevant ones for your strategy.
Dashboard Interpretation: The MACD Dashboard displays green (🟢) and red (🔴) symbols to indicate when the MACD is in green or in the red zone. You can also leverage the MACD values on the dashboard to better interpret sentiment and its changes.
Confirmation and Strategy: Consider MACD Dashboard signals as confirmation for your trading strategy. For instance, in an uptrend, look for long opportunities when the dashboard displays consistent green symbols. Conversely, in a downtrend, focus on short opportunities when red symbols dominate.
Risk Management: As with any indicator, use the MACD Dashboard in conjunction with proper risk management techniques. Avoid trading solely based on indicator signals; instead, integrate them into a comprehensive trading plan.
Donchian Cloud-V1The Donchian Cloud-V1 is a technical analysis indicator inspired by the Ichimoku Cloud, but with a twist. It utilizes two Donchian Channel midline calculations to create a cloud-like price zone. This indicator aims to help traders identify potential areas of support and resistance, and also suggests that trades should be avoided when prices are within the cloud.
How it Works?
The Donchian Cloud-V1 calculates two Donchian Channel midlines:
Fast Donchian Channel: This midline is based on a shorter period, making it more responsive to price changes.
Slow Donchian Channel: This midline is based on a longer period, providing a smoother and more stable cloud formation.
The upper and lower bands of the traditional Donchian Channels are discarded, and the midlines become the cloud's upper and lower boundaries.
Interpretation
Price Above the Cloud: A price move above the cloud can be interpreted as a bullish signal, suggesting potential upward momentum.
Price Below the Cloud: A price move below the cloud can be interpreted as a bearish signal, suggesting potential downward momentum.
Price Within the Cloud: The indicator advises against taking any trades when the price is within the cloud itself, as the market may be unclear or ranging.
Benefits of Using the Donchian Cloud-V1
Visually Appealing: The cloud can provide a clear and concise view of potential support and resistance zones.
Customizable: The lengths of the fast and slow Donchian Channels can be adjusted to suit your trading style and preferred timeframe.
Complements Other Indicators: The Donchian Cloud-V1 can be used in conjunction with other technical indicators to strengthen trade signals.
Limitations to Consider
Lagging Indicator: Like many technical indicators, the Donchian Cloud-V1 is based on past price data and may not always perfectly predict future price movements.
False Signals: The cloud can generate false signals, especially in volatile markets.
Not a Standalone Strategy: The Donchian Cloud-V1 should ideally be used alongside other trading strategies and risk management techniques.
The Donchian Cloud-V1 is a valuable tool for traders who want to identify potential support and resistance zones and avoid making trades during periods of market uncertainty. Remember, it's important to backtest and paper trade any indicator before using it with real capital.
Trend Analysis with Volatility and MomentumVolatility and Momentum Trend Analyzer
The Volatility and Momentum Trend Analyzer is a multi-faceted TradingView indicator designed to provide a comprehensive analysis of market trends, volatility, and momentum. It incorporates key features to identify trend direction (uptrend, downtrend, or sideways), visualize weekly support and resistance levels, and offer a detailed assessment of market strength and activity. Below is a breakdown of its functionality:
1. Input Parameters
The indicator provides customizable settings for precision and adaptability:
Volatility Lookback Period: Configurable period (default: 14) for calculating Average True Range (ATR), which measures market volatility.
Momentum Lookback Period: Configurable period (default: 14) for calculating the Rate of Change (ROC), which measures the speed and strength of price movements.
Support/Resistance Lookback Period: Configurable period (default: 7 weeks) to determine critical support and resistance levels based on weekly high and low prices.
2. Volatility Analysis (ATR)
The Average True Range (ATR) is calculated to quantify the market's volatility:
What It Does: ATR measures the average range of price movement over the specified lookback period.
Visualization: Plotted as a purple line in a separate panel below the price chart, with values amplified (multiplied by 10) for better visibility.
3. Momentum Analysis (ROC)
The Rate of Change (ROC) evaluates the momentum of price movements:
What It Does: ROC calculates the percentage change in closing prices over the specified lookback period, indicating the strength and direction of market moves.
Visualization: Plotted as a yellow line in a separate panel below the price chart, with values amplified (multiplied by 10) for better visibility.
4. Trend Detection
The indicator identifies the current market trend based on momentum and the position of the price relative to its moving average:
Uptrend: Occurs when momentum is positive, and the closing price is above the simple moving average (SMA) of the specified lookback period.
Downtrend: Occurs when momentum is negative, and the closing price is below the SMA.
Sideways Trend: Occurs when neither of the above conditions is met.
Visualization: The background of the price chart changes color to reflect the detected trend:
Green: Uptrend.
Red: Downtrend.
Gray: Sideways trend.
5. Weekly Support and Resistance
Critical levels are calculated based on weekly high and low prices:
Support: The lowest price observed over the last specified number of weeks.
Resistance: The highest price observed over the last specified number of weeks.
Visualization:
Blue Line: Indicates the support level.
Orange Line: Indicates the resistance level.
Both lines are displayed on the main price chart, dynamically updating as new data becomes available.
6. Alerts
The indicator provides configurable alerts for trend changes, helping traders stay informed without constant monitoring:
Uptrend Alert: Notifies when the market enters an uptrend.
Downtrend Alert: Notifies when the market enters a downtrend.
Sideways Alert: Notifies when the market moves sideways.
7. Key Use Cases
Trend Following: Identify and follow the dominant trend to capitalize on sustained price movements.
Volatility Assessment: Measure market activity to determine potential breakouts or quiet consolidation phases.
Support and Resistance: Highlight key levels where price is likely to react, assisting in decision-making for entries, exits, or stop-loss placement.
Momentum Tracking: Gauge the strength and speed of price moves to validate trends or anticipate reversals.
8. Visualization Summary
Main Chart:
Background color-coded for trend direction (green, red, gray).
Blue and orange lines for weekly support and resistance.
Lower Panels:
Purple line for volatility (ATR).
Yellow line for momentum (ROC).
Adaptive Fractal Grid Scalping StrategyThis Pine Script v6 component implements an "Adaptive Fractal Grid Scalping Strategy" with an added volatility threshold feature.
Here's how it works:
Fractal Break Detection: Uses ta.pivothigh and ta.pivotlow to identify local highs and lows.
Volatility Clustering: Measures volatility using the Average True Range (ATR).
Adaptive Grid Levels: Dynamically adjusts grid levels based on ATR and user-defined multipliers.
Directional Bias Filter: Uses a Simple Moving Average (SMA) to determine trend direction.
Volatility Threshold: Introduces a new input to specify a minimum ATR value required to activate the strategy.
Trade Execution Logic: Places limit orders at grid levels based on trend direction and fractal levels, but only when ATR exceeds the volatility threshold.
Profit-Taking and Stop-Loss: Implements profit-taking at grid levels and a trailing stop-loss based on ATR.
How to Use
Inputs: Customize the ATR length, SMA length, grid multipliers, trailing stop multiplier, and volatility threshold through the input settings.
Visuals: The script plots fractal points and grid levels on the chart for easy visualization.
Trade Signals: The strategy automatically places buy/sell orders based on the detected fractals, trend direction, and volatility threshold.
Profit and Risk Management: The script includes logic for taking profits and setting stop-loss levels to manage trades effectively.
This strategy is designed to capitalize on micro-movements during high volatility and avoid overtrading during low-volatility trends. Adjust the input parameters to suit your trading style and market conditions.
pslibs_revisedLibrary "pslibs_revised"
f_calculate_divergence_on_close(close, mom, rsi, start_lookback, max_lookback, rsiThresholdBuy, rsiThresholdSell, minAngleDiff, run_flag)
Parameters:
close (float)
mom (float)
rsi (float)
start_lookback (int)
max_lookback (int)
rsiThresholdBuy (float)
rsiThresholdSell (float)
minAngleDiff (float)
run_flag (bool)
f_calculate_divergence_on_low(low, mom, rsi, start_lookback, max_lookback, rsiThresholdBuy, rsiThresholdSell, minAngleDiff, run_flag)
Parameters:
low (float)
mom (float)
rsi (float)
start_lookback (int)
max_lookback (int)
rsiThresholdBuy (float)
rsiThresholdSell (float)
minAngleDiff (float)
run_flag (bool)
f_calculate_reversal(close, low, high, macdFastPeriod, macdSlowPeriod, macdSignalPeriod, stochPeriod, prcKPeriod, stochOS, stochOB, run_flag)
Parameters:
close (float)
low (float)
high (float)
macdFastPeriod (simple int)
macdSlowPeriod (simple int)
macdSignalPeriod (simple int)
stochPeriod (int)
prcKPeriod (int)
stochOS (int)
stochOB (int)
run_flag (bool)
is_within_first_30_minutes()
is_last_60_minutes()
is_last_30_minutes()
func_yestday_was_postive_trend()
MARTINGALE8MARTINGALE8 Indicator: Comprehensive User Guide
Welcome to the MARTINGALE8 Indicator, your ultimate tool for implementing a customizable martingale trading strategy directly on TradingView! Whether you're a beginner trader or an experienced strategist, this indicator offers flexibility and clarity, empowering you to trade with confidence. Let’s dive into how you can make the most of it!
What Is the Martingale Principle?
The martingale strategy is a betting technique often used in gambling and trading. The idea is simple: double down on losing positions so that when a trade eventually succeeds, the profits will recover all previous losses and yield a small profit. In trading, this translates to placing incrementally larger buy orders as the price moves against your initial position, assuming the price will eventually reverse in your favor.
The martingale principle works under the asumption of mean reversion —that the price will eventually recover to a point where all accumulated losses are recouped, and a profit is made. By increasing order sizes at lower levels, the average entry price moves closer to the current price, reducing the price move required to reach profitability. However, like any strategy, it carries risks — if the price continues to move against your position without reversing, losses can escalate quickly .
What Does MARTINGALE8 Do?
The MARTINGALE8 Indicator is an open source script designed to:
Calculate multiple price levels (buy and take-profit) using a martingale strategy.
Allow full customization of entry size, order deviation, profit targets, and order multipliers.
Visualize key trading levels directly on the chart for better decision-making.
Provide helpful labels with real-time metrics like total cost, range analysis, and high-volume bar prices.
This indicator is ideal for traders looking to automate and refine their martingale-based trading approaches.
Features
1. Customizable Inputs
You have complete control over key parameters:
Start Price: Set a custom starting price, or let it default to the market price.
Entry Size: Choose your initial trade size (default: equivalent to 7.5 USDT).
Order Multiplier: Adjust the size of each subsequent order in the martingale sequence.
Order Deviation: Define the percentage deviation for each buy level.
Profit Deviation: Determine the target percentage deviation for take-profit levels.
Length: Specify the lookback period for market analysis (default: 84 bars).
2. Market Analysis
The script calculates key metrics, including:
Highest Volume Bar (HVB): Identifies the bar with the highest trading volume in the selected period.
Range Analysis: Computes the high-to-low range percentage to help you understand market volatility.
3. Martingale Levels
Automatically generates :
10 Buy Levels: Strategically placed below the starting price.
Take-Profit Level: A target above the starting price based on the profit deviation.
4. Cost Calculation
The script calculates the total cost of all orders, including a 10% buffer for safety, so you can plan your capital allocation effectively.
5. Visual Elements
The indicator draws clean and intuitive lines for:
Take-Profit Level: Highlighted in fuchsia.
Buy Levels: Clearly marked with aqua lines.
Zero Line: Your base price, shown in white.
Additional labels provide:
A summary of key metrics like total cost, entry price, and range.
Precise price values for the take-profit and lowest buy levels.
How to Use MARTINGALE8
Step 1: Add the Indicator to Your Chart
Click on the “Indicators” tab in TradingView.
Search for “MARTINGALE8” and add it to your chart.
Step 2: Configure the Inputs
Navigate to the Settings menu of the indicator and adjust the following parameters:
Start Price : Set your starting price or leave it as 0 to use the current market price.
Entry Size : Define the size of your initial trade (e.g., 7.5 USDT).
Order Multiplier : Choose how much larger each subsequent order should be.
Order Deviation : Specify the percentage distance between buy levels.
Profit Deviation : Set your desired percentage for the take-profit level.
Length : Adjust the number of bars to analyze for high volume.
Step 3: Visualize the Levels
The indicator will plot:
A white line for the base price.
Aqua lines for the buy levels.
A fuchsia line for the take-profit level.
Step 4: Monitor the Labels
Look for the summary label on the chart, which shows:
Total cost of the martingale orders.
Entry price and key market metrics (range, high-volume bar price).
Tips for Optimal Use
Adjust Inputs to Match Market Conditions : Experiment with order and profit deviations to account for volatile or steady markets.
Manage Risk : Use the cost calculation feature to ensure you allocate capital responsibly.
Technical Details
The script is written in Pine Script v6 and uses:
Switch Statements : For flexible default values.
Line Objects : To draw and update key price levels dynamically.
Labels : To display relevant trading metrics.
I’m glad to share this tool with the TradingView community. If you enjoy using MARTINGALE8, please keep it going and share your feedback. Let’s trade smarter, not harder!