Fibonacci ATR Fusion - Strategy [presentTrading]Open-script again! This time is also an ATR-related strategy. Enjoy! :)
If you have any questions, let me know, and I'll help make this as effective as possible.
█ Introduction and How It Is Different
The Fibonacci ATR Fusion Strategy is an advanced trading approach that uniquely integrates Fibonacci-based weighted averages with the Average True Range (ATR) to identify and capitalize on significant market trends.
Unlike traditional strategies that rely on single indicators or static parameters, this method combines multiple timeframes and dynamic volatility measurements to enhance precision and adaptability. Additionally, it features a 4-step Take Profit (TP) mechanism, allowing for systematic profit-taking at various levels, which optimizes both risk management and return potential in long and short market positions.
BTCUSD 6hr Performance
█ Strategy, How It Works: Detailed Explanation
The Fibonacci ATR Fusion Strategy utilizes a combination of technical indicators and weighted averages to determine optimal entry and exit points. Below is a breakdown of its key components and operational logic.
🔶 1. Enhanced True Range Calculation
The strategy begins by calculating the True Range (TR) to measure market volatility accurately.
TR = max(High - Low, abs(High - Previous Close), abs(Low - Previous Close))
High and Low: Highest and lowest prices of the current trading period.
Previous Close: Closing price of the preceding trading period.
max: Selects the largest value among the three calculations to account for gaps and limit movements.
🔶 2. Buying Pressure (BP) Calculation
Buying Pressure (BP) quantifies the extent to which buyers are driving the price upwards within a period.
BP = Close - True Low
Close: Current period's closing price.
True Low: The lower boundary determined in the True Range calculation.
🔶 3. Ratio Calculation for Different Periods
To assess the strength of buying pressure relative to volatility, the strategy calculates a ratio over various Fibonacci-based timeframes.
Ratio = 100 * (Sum of BP over n periods) / (Sum of TR over n periods)
n: Length of the period (e.g., 8, 13, 21, 34, 55).
Sum of BP: Cumulative Buying Pressure over n periods.
Sum of TR: Cumulative True Range over n periods.
This ratio normalizes buying pressure, making it comparable across different timeframes.
🔶 4. Weighted Average Calculation
The strategy employs a weighted average of ratios from multiple Fibonacci-based periods to smooth out signals and enhance trend detection.
Weighted Avg = (w1 * Ratio_p1 + w2 * Ratio_p2 + w3 * Ratio_p3 + w4 * Ratio_p4 + Ratio_p5) / (w1 + w2 + w3 + w4 + 1)
w1, w2, w3, w4: Weights assigned to each ratio period.
Ratio_p1 to Ratio_p5: Ratios calculated for periods p1 to p5 (e.g., 8, 13, 21, 34, 55).
This weighted approach emphasizes shorter periods more heavily, capturing recent market dynamics while still considering longer-term trends.
🔶 5. Simple Moving Average (SMA) of Weighted Average
To further smooth the weighted average and reduce noise, a Simple Moving Average (SMA) is applied.
Weighted Avg SMA = SMA(Weighted Avg, m)
- m: SMA period (e.g., 3).
This smoothed line serves as the primary signal generator for trade entries and exits.
🔶 6. Trading Condition Thresholds
The strategy defines specific threshold values to determine optimal entry and exit points based on crossovers and crossunders of the SMA.
Long Condition = Crossover(Weighted Avg SMA, Long Entry Threshold)
Short Condition = Crossunder(Weighted Avg SMA, Short Entry Threshold)
Long Exit = Crossunder(Weighted Avg SMA, Long Exit Threshold)
Short Exit = Crossover(Weighted Avg SMA, Short Exit Threshold)
Long Entry Threshold (T_LE): Level at which a long position is triggered.
Short Entry Threshold (T_SE): Level at which a short position is triggered.
Long Exit Threshold (T_LX): Level at which a long position is exited.
Short Exit Threshold (T_SX): Level at which a short position is exited.
These conditions ensure that trades are only executed when clear trends are identified, enhancing the strategy's reliability.
Previous local performance
🔶 7. ATR-Based Take Profit Mechanism
When enabled, the strategy employs a 4-step Take Profit system to systematically secure profits as the trade moves in the desired direction.
TP Price_1 Long = Entry Price + (TP1ATR * ATR Value)
TP Price_2 Long = Entry Price + (TP2ATR * ATR Value)
TP Price_3 Long = Entry Price + (TP3ATR * ATR Value)
TP Price_1 Short = Entry Price - (TP1ATR * ATR Value)
TP Price_2 Short = Entry Price - (TP2ATR * ATR Value)
TP Price_3 Short = Entry Price - (TP3ATR * ATR Value)
- ATR Value: Calculated using ATR over a specified period (e.g., 14).
- TPxATR: User-defined multipliers for each take profit level.
- TPx_percent: Percentage of the position to exit at each TP level.
This multi-tiered exit strategy allows for partial position closures, optimizing profit capture while maintaining exposure to potential further gains.
█ Trade Direction
The Fibonacci ATR Fusion Strategy is designed to operate in both long and short market conditions, providing flexibility to traders in varying market environments.
Long Trades: Initiated when the SMA of the weighted average crosses above the Long Entry Threshold (T_LE), indicating strong upward momentum.
Short Trades: Initiated when the SMA of the weighted average crosses below the Short Entry Threshold (T_SE), signaling robust downward momentum.
Additionally, the strategy can be configured to trade exclusively in one direction—Long, Short, or Both—based on the trader’s preference and market analysis.
█ Usage
Implementing the Fibonacci ATR Fusion Strategy involves several steps to ensure it aligns with your trading objectives and market conditions.
1. Configure Strategy Parameters:
- Trading Direction: Choose between Long, Short, or Both based on your market outlook.
- Trading Condition Thresholds: Set the Long Entry, Short Entry, Long Exit, and Short Exit thresholds to define when to enter and exit trades.
2. Set Take Profit Levels (if enabled):
- ATR Multipliers: Define how many ATRs away from the entry price each take profit level is set.
- Take Profit Percentages: Allocate what percentage of the position to close at each TP level.
3. Apply to Desired Chart:
- Add the strategy to the chart of the asset you wish to trade.
- Observe the plotted Fibonacci ATR and SMA Fibonacci ATR indicators for visual confirmation.
4. Monitor and Adjust:
- Regularly review the strategy’s performance through backtesting.
- Adjust the input parameters based on historical performance and changing market dynamics.
5. Risk Management:
- Ensure that the sum of take profit percentages does not exceed 100% to avoid over-closing positions.
- Utilize the ATR-based TP levels to adapt to varying market volatilities, maintaining a balanced risk-reward ratio.
█ Default Settings
Understanding the default settings is crucial for optimizing the Fibonacci ATR Fusion Strategy's performance. Here's a precise and simple overview of the key parameters and their effects:
🔶 Key Parameters and Their Effects
1. Trading Direction (`tradingDirection`)
- Default: Both
- Effect: Determines whether the strategy takes both long and short positions or restricts to one direction. Selecting Both allows maximum flexibility, while Long or Short can be used for directional bias.
2. Trading Condition Thresholds
Long Entry (long_entry_threshold = 58.0): Higher values reduce false positives but may miss trades.
Short Entry (short_entry_threshold = 42.0): Lower values capture early short trends but may increase false signals.
Long Exit (long_exit_threshold = 42.0): Exits long positions early, securing profits but potentially cutting trends short.
Short Exit (short_exit_threshold = 58.0): Delays short exits to capture favorable movements, avoiding premature exits.
3. Take Profit Configuration (`useTakeProfit` = false)
- Effect: When enabled, the strategy employs a 4-step TP mechanism to secure profits at multiple levels. By default, it is disabled to allow users to opt-in based on their trading style.
4. ATR-Based Take Profit Multipliers
TP1 (tp1ATR = 3.0): Sets the first TP at 3 ATRs for initial profit capture.
TP2 (tp2ATR = 8.0): Targets larger trends, though less likely to be reached.
TP3 (tp3ATR = 14.0): Optimizes for extreme price moves, seldom triggered.
5. Take Profit Percentages
TP Level 1 (tp1_percent = 12%): Secures 12% at the first TP.
TP Level 2 (tp2_percent = 12%): Exits another 12% at the second TP.
TP Level 3 (tp3_percent = 12%): Closes an additional 12% at the third TP.
6. Weighted Average Parameters
Ratio Periods: Fibonacci-based intervals (8, 13, 21, 34, 55) balance responsiveness.
Weights: Emphasizes recent data for timely responses to market trends.
SMA Period (weighted_avg_sma_period = 3): Smoothens data with minimal lag, balancing noise reduction and responsiveness.
7. ATR Period (`atrPeriod` = 14)
Effect: Sets the ATR calculation length, impacting TP sensitivity to volatility.
🔶 Impact on Performance
- Sensitivity and Responsiveness:
- Shorter Ratio Periods and Higher Weights: Make the weighted average more responsive to recent price changes, allowing quicker trade entries and exits but increasing the likelihood of false signals.
- Longer Ratio Periods and Lower Weights: Provide smoother signals with fewer false positives but may delay trade entries, potentially missing out on significant price moves.
- Profit Taking:
- ATR Multipliers: Higher multipliers set take profit levels further away, targeting larger price movements but reducing the probability of reaching these levels.
- Fixed Percentages: Allocating equal percentages at each TP level ensures consistent profit realization and risk management, preventing overexposure.
- Trade Direction Control:
- Selecting Specific Directions: Restricting trades to Long or Short can align the strategy with market trends or personal biases, potentially enhancing performance in trending markets.
- Risk Management:
- Take Profit Percentages: Dividing the position into smaller percentages at multiple TP levels helps lock in profits progressively, reducing risk and allowing the remaining position to ride further trends.
- Market Adaptability:
- Weighted Averages and ATR: By combining multiple timeframes and adjusting to volatility, the strategy adapts to different market conditions, maintaining effectiveness across various asset classes and timeframes.
---
If you want to know more about ATR, can also check "SuperATR 7-Step Profit".
Enjoy trading.
Truerange
ATR Range Pivot LinesDescription:
This Pine Script calculates and plots pivot lines based on ATR (Average True Range) value and closing price. It uses the previous trading day's ATR value to set static pivot levels for the current trading day. These pivot lines help traders identify potential support and resistance levels based on historical volatility. The script includes two main pivot lines—ATR High and ATR Low —and two midpoint lines between them for additional context. Labels are added to show the exact pivot values, with options to customize label positions.
Intended Use:
The script is designed to help traders forecast potential price ranges for the current trading day based on the previous day’s volatility. By adding and subtracting the previous day's ATR from the prior close, the script identifies key levels where price action may encounter support or resistance. It is useful for setting realistic price targets or entry/exit points. Since the ATR-based pivot lines are static for the entire day, they provide a reliable range for intraday trading strategies.
Disclosure:
This script was generated using AI. It is recommended to review and test the script thoroughly before applying it in live trading scenarios.
ATR GerchikAverage True Range ( ATR ) is a technical analysis indicator that measures market volatility. It is a moving average of the true range over a period of time. Originally developed by a market technician J. Welles Wilder Jr. in the 1970s, ATR was utilized to measure the average volatility of an asset over a given time period. Wilder realized that measuring volatility using only closing prices would not yield accurate results, necessitating a more complex system. To calculate the Average True Range, one must first determine the True Range (TR).
ATR calculation procedure:
1. Determine the true maximum - this is the highest of the current maximum and yesterday's closing price of the day.
2. Determine the true minimum - this is the smallest of the current minimum and yesterday's closing price.
3. Determine the true range - this is the distance between the true maximum and minimum.
4. Exclude extremely large candles and extremely small ones from the obtained true ranges.
5. Calculate the average for the selected period based on the remaining range.
6. Calculate the percentage of the current True Range relative to the average ATR value for the previous period.
Description:
If you analyze market movements, you will find that 75-80% of the time, an instrument moves only 1 ATR per day. Understanding this is crucial; for example, if an instrument has already moved 80% of its daily range, it is not advisable to enter a new position. This concept is similar to a car's fuel tank; if the tank is nearly empty, the car won’t go far. Many indicators include anomalous candles in their ATR calculations, which can yield unreliable results and lead to incorrect decisions. This is why many traders prefer to calculate ATR manually.
However, the Gerchik ATR indicator accounts for anomalous candles by filtering out extremely large and small candles. Users can set the coefficient for the upper and lower filtering thresholds. Experiment with these settings to find your criteria for filtering out abnormal candles. Personally, I filter out candles larger than 2x ATR and smaller than 0.5x ATR. Additionally, this indicator displays the consumed “fuel” of the instrument for the entire day and the current percentages, so you don’t have to calculate the distance traveled manually. The indicator also visually displays the boundaries of the average true range on the chart, enabling quick and informed decisions. When building any strategy, relying on the average true range movement is essential.
This extended version of the indicator includes a NATP indicator (Normalized ATR), a variation of the ATR that measures volatility as a percentage of the current price. It helps gauge market volatility levels and assists traders in making informed decisions.
Procedure for calculating NATR (Normalized ATR):
1. Determine the true maximum - the higher of the current high and the previous close.
2. Determine the true minimum - the lower of the current low and the previous close.
3. Determine the true range - the distance between the true maximum and minimum.
4. Filter out extremely large and small values from the obtained true ranges.
5. Calculate the average for n candles based on the remaining ranges.
Additionally in this version:
- Change table position
- Added NATP indicator
- Option to turn off the table description
- Option to turn off some indicators in the table
- Indication of the selected period in the table
- Changing coefficients for filtering abnormal candles
- Display of the number of invalid candles in the selected period
- Inclusion of labels with full ATR, NATR, candle range, and validity information
- Color-coding labels based on validity
- Selection of colors for valid and invalid candles
- Adjustable label size
- ATR graph display on the chart
- Customizable graph style, line thickness, and fill color
Detailed description:
Displays colored labels with detailed information. Labels can be color-coded based on validity and selected color. The text color will automatically adjust if a lighter color is chosen.
Panel of available settings
Graphic styles:
Line ATR graph style
Cross line ATR graph style
Step line ATR graph style
Step line diamond ATR graph style
Cross ATR graph style
Columns ATR graph style
Circles ATR graph style
Area ATR graph style
Cross area ATR graph style
Key Features:
- Anomalous Candle Filtering: Excludes extremely large and small candles for more reliable ATR values. Set filtering thresholds independently as coefficients.
- Consumed Fuel Indicator: Shows the percentage of the ATR consumed, aiding quick assessment of remaining movement potential.
- Daily Timeframe Focus: Designed for daily charts for accurate long-term analysis. The indicator is displayed on the daily timeframe if enabled, hiding it on lower timeframes.
- Visual Indicator Boundaries: Displays indicator boundaries on the chart with customizable styles and settings.
Practical Applications:
ATR helps traders predict potential future price movements, aiding in setting Stop Loss and Take Profit targets. Using ATR for SL/TP placement helps avoid market noise. ATR can also form an exit strategy by placing Trailing Stop Losses.
- Entry and Exit Points: Determine optimal entry and exit points by assessing market volatility and potential price movement.
- Stop-Loss Placement: Calculate stop-loss levels based on ATR to ensure appropriate placement, accounting for current market volatility.
- Trend Confirmation: Use ATR percentage consumption to confirm trend strength and decide on trade entries or exits.
Examples of Use:
- Trend Following: During strong trends, ATR identifies increased volatility periods, signaling potential breakouts or reversals.
- Range Trading: In ranging markets, ATR highlights low volatility periods, indicating consolidation and potential breakout zones.
ATR Gerchik LightAverage True Range ( ATR ) is a technical analysis indicator that measures volatility in the market. ATR is a moving average of the true range over a period of time.
ATR calculation procedure:
1. Determine the true maximum - this is the highest of the current maximum and yesterday's closing price of the day.
2. Determine the true minimum - this is the smallest of the current minimum and yesterday's closing price.
3. Determine the true range - this is the distance between the true maximum and minimum.
4. We exclude extremely large candles (> x2 ATR) and extremely small ones (< 0.5 ATR) from the obtained true ranges.
5. We calculate the average for the selected period based on the remaining range.
6. We calculate the percentage of the current True Range relative to the average ATR value for the previous period.
Description:
If you analyze it yourself, you will see that 75-80% of the time, the instrument moves only 1 ATR per day. You must understand that if an instrument has, for example, moved 80% of its daily range, it is not advisable to purchase it. This is comparable to a car's fuel tank: if the tank is almost empty, the car won't go far. Most indicators that calculate ATR include anomalous candles, which give unreliable results and lead to incorrect decisions. Because of this, many traders prefer to calculate ATR on their own.
However, the Gerchik ATR indicator accounts for anomalous candles and filters out extremely large candles (> 2x ATR) and extremely small ones (< 0.5x ATR). Additionally, this indicator immediately shows the consumed “fuel” of the instrument as a percentage, so you don't have to calculate the distance traveled yourself. This allows you to make quick, informed decisions. If we see that the tank is almost empty, it is logical not to get into that car today. When building any strategy, you must rely on the average movement.
Key Features:
Anomalous Candle Filtering: Excludes extremely large and small candles to provide more reliable ATR values.
Consumed Fuel Indicator: Shows the percentage of the ATR consumed, helping traders quickly assess the remaining potential movement.
Daily Timeframe Focus: Designed specifically for use on daily charts for accurate long-term analysis.
Practical Applications:
Entry and Exit Points: Use the ATR to determine optimal entry and exit points by assessing market volatility and potential price movement.
Stop-Loss Placement: Calculate stop-loss levels based on ATR to ensure they are placed at appropriate distances, accounting for current market volatility.
Trend Confirmation: Use the percentage of ATR consumed to confirm the strength of a trend and decide whether to enter or exit trades.
Examples of Use:
Trend Following: During strong trends, ATR helps identify periods of increased volatility, signaling potential breakouts or reversals.
Range Trading: In ranging markets, ATR can highlight periods of low volatility, indicating consolidation and potential breakout zones.
Note: The indicator is displayed and works only on the daily timeframe!
The indicator was created according to the instructions, description of the functionality, and strategy of Mr. Gerchik. Thank you so much, Chief!
________________________
Average True Range ( ATR , средний истинный диапазон) – это индикатор технического анализа, который измеряет волатильность на рынке. ATR представляет собой скользящее среднее истинного диапазона за определенный период времени.
Порядок расчета ATR:
1. Определяем истинный максимум – это наивысшее из текущего максимума и вчерашней цены закрытия дня.
2. Определяем истинный минимум – это наименьшее из текущего минимума и вчерашней цены закрытия.
3. Определяем истинный диапазон – это расстояние между истинным максимумом и минимумом.
4. Исключаем из полученных истинных диапазонов экстремально большие свечи (> x2 ATR) и экстремально маленькие (< 0.5 ATR).
5. Рассчитываем среднее за выбранный период исходя из оставшегося диапазона.
6 . Рассчитываем процент текущего истинного диапазона (True Range) относительно среднего значения ATR за предыдущий период.
Описание:
Если вы сами проанализируете, то увидите, что 75-80% времени инструмент ходит только 1 ATR. И вы должны понимать, что если инструмент внутри дня прошел, к примеру, 80% своего движения, то этот инструмент больше нельзя покупать. Это можно сравнить с баком машины: если бак почти пустой, машина далеко не уедет. Большинство индикаторов, которые рассчитывают ATR, производят расчет с паранормальными свечами. Это дает недостоверный результат и приводит к неверным решениям. Многие трейдеры из-за этого не используют готовые индикаторы и предпочитают считать ATR самостоятельно. Но индикатор ATR Gerchik учитывает паранормальные свечи и фильтрует экстремально большие свечи (> x2 ATR) и экстремально маленькие (< 0.5 ATR). Также этот индикатор сразу показывает израсходованный "бензин" инструмента в процентах. И вам не надо самостоятельно высчитывать пройденный путь. Вы можете быстро принимать правильные решения. Если мы видим, что бак почти пустой, логично не садиться в эту машину сегодня. Когда вы строите какую-то стратегию, вы должны обязательно полагаться на среднестатистическое движение.
Существует много стратегий, завязанных на ATR, которые учитывают волатильность инструмента, запас хода, точки разворота, места выставления стоп-лоссов (SL) и тейк-профитов (TP) и другие факторы. Я не буду останавливаться на них, так как каждый может найти описание этих стратегий и использовать их на свой выбор.
Индикатор отображается и работает только на дневном таймфрейме!
Индикатор создан по наставлениям, описанию функционала и стратегии господина Герчика. Огромное спасибо, Шеф!
IsAlgo - CandleWave Channel Strategy► Overview:
The CandleWave Channel Strategy uses an exponential moving average (EMA) combined with a custom true range function to dynamically calculate a multi-level price channel, helping traders identify potential trend reversals and price pullbacks.
► Description:
The CandleWave Channel Strategy is built around an EMA designed to identify potential reversal points in the market. The channel’s main points are calculated using this EMA, which serves as the foundation for the strategy’s dynamic price channel. The channel edges are determined using a proprietary true range function that measures the distance between the highs and lows of price movements over a specific period. By factoring in the maximum distance between highs and lows and averaging these values over the period, the strategy creates a responsive channel that adapts to current market conditions. The channel consists of five levels, each representing different degrees of trend tension.
The strategy continuously monitors the price in relation to the channel edges. When a candle closes outside one of these edges, it indicates a potential price reversal. This outside-close candle acts as a signal for a possible trend change, prompting the strategy to prepare for a trade entry. Upon detecting an outside-close candle, the strategy triggers an entry. The logic behind this is that when the price moves outside the defined channel, it is likely to revert back within the channel and move towards the opposite edge. The strategy aims to capitalize on this reversion by entering trades based on these signals.
Traders can adjust the channel’s length, levels, and minimum distance to tailor it to different market conditions. They can also define the characteristics of the entry candle, such as its size, body, and relative position to previous candles, to ensure it meets specific conditions before triggering a trade. Additionally, the strategy permits the specification of trading hours and days, enabling traders to focus on preferred market periods. Exit can be configured based on profit/loss limits, trade duration, and band reversal signals or other criteria.
How it Works:
Channel Calculation: The strategy continuously updates the channel edges using the EMA and true range function.
Signal Detection: It waits for a candle to close outside the channel edges.
Trade Entry: When an outside-close candle is detected, the strategy enters a trade expecting the price to revert to the opposite channel edge.
Customization: Users can define the characteristics of the entry candle, such as its size relative to previous candles, to ensure it meets specific conditions before triggering a trade.
↑ Long Trade Example:
The entry candle closes below the channel level, indicating a potential upward reversal. The strategy enters a long position expecting the price to move towards the upper levels.
↓ Short Trade Example:
The entry candle closes above the channel level, signaling a potential downward reversal. The strategy enters a short position anticipating the price to revert towards the lower levels.
► Features and Settings:
⚙︎ Channel: Adjust the channel’s length, levels, and minimum distance to suit different market conditions and trading styles.
⚙︎ Entry Candle: Customize entry criteria, including candle size, body, and relative position to previous candles for accurate signal generation.
⚙︎ Trading Session: Define specific trading hours during which the strategy operates, restricting trades to preferred market periods.
⚙︎ Trading Days: Specify active trading days to avoid certain days of the week.
⚙︎ Backtesting: backtesting for a selected period to evaluate strategy performance. This feature can be deactivated if not needed.
⚙︎ Trades: Configure trade direction (long, short, or both), position sizing (fixed or percentage-based), maximum number of open trades, and daily trade limits.
⚙︎ Trades Exit: Set profit/loss limits, specify trade duration, or exit based on band reversal signals.
⚙︎ Stop Loss: Choose from various stop-loss methods, including fixed pips, ATR-based, or highest/lowest price points within a specified number of candles. Trades can also be closed after a certain number of adverse candle movements.
⚙︎ Break Even: Adjust stop loss to break even once predefined profit levels are reached, protecting gains.
⚙︎ Trailing Stop: Implement a trailing stop to adjust the stop loss as the trade becomes profitable, securing gains and potentially capturing further upside.
⚙︎ Take Profit: Set up to three take-profit levels using methods such as fixed pips, ATR, or risk-to-reward ratios. Alternatively, specify a set number of candles moving in the trade’s direction.
⚙︎ Alerts: Comprehensive alert system to notify users of significant actions, including trade openings and closings. Supports dynamic placeholders for take-profit levels and stop-loss prices.
⚙︎ Dashboard: Visual display on the chart providing detailed information about ongoing and past trades, aiding users in monitoring strategy performance and making informed decisions.
► Backtesting Details:
Timeframe: 30-minute GBPJPY chart
Initial Balance: $10,000
Order Size: 500 units
Commission: 0.02%
Slippage: 5 ticks
Volume Delta Trailing Stop [LuxAlgo]The ' Volume Delta Trailing Stop ' indicator uses Lower Time Frame (LTF) volume delta data which can provide potential entries together with a Volume-Delta based Trailing Stop-line .
🔶 USAGE
Our 'Volume Delta Trailing Stop' script can show potential entries/Stop Loss lines
A trigger line needs to be broken before a position is taken, after which a Volume Delta-controlled Trailing Stop-line is created:
🔶 DETAILS
🔹 Volume rises when bought or sold
🔹 When the opening price appears on the chart, a buy/sell order has been executed.
If that order is less than the available supply of that particular price, volume will rise, without moving the price.
🔹 When the opening price is the same as the closing price, the volume of that bar can be seen as "neutral volume" (nV); nor "up", nor "down" volume.
Example
A buy order doesn't fill the first available supply in the order book. This price will be the opening price with a certain volume.
When at closing time, price still hasn't moved (the first available supply in the order book isn't filled, or no movement downwards),
the closing price will be equal to the opening price, but with volume. This can be seen as "neutral volume (nV)".
🔹 Delta Volume (ΔV): this is "up volume" minus "down volume"
🔹 Standard volume is colored red when closing price is lower than opening price ( = "down volume").
🔹 Standard volume is colored green when closing price is higher OR equal (nV) than opening price ( = "up volume").
🔹 Neutral Volume
The "Neutral-Volume" is considered "Up-Volume" - setting will dictate whether nV is considered as green 'buy' volume or not.
🔶 EXAMPLE
29 July 10:00 -> 10:05, chart timeframe 5 minutes, open 29311.28, close 29313.89
close > open, so the volume (39.55) is colored green ("up volume").
(The Volume script used in the following examples is the open-source publication Volume Columns w. Alerts (V) from LucF )
Let's zoom to the 1-minute TF:
The same period is now divided into more bars, volume direction (color) is dependable on the difference between open and close.
Counting up and down volume gives a more detailed result, it remains in an upward direction though):
(ΔV = +15.51)
Let's further zoom in to the 1-second TF:
The same period is now divided into even more bars (more possibility for changing direction on each bar)
Here we see several bars that haven't moved in price, but they have volume ("neutral" volume).
(neutral volume is coloured light green here, while up volume is coloured darker green)
When we count all green and red volume bars, the result is quite different:
(ΔV = -0.35)
In total more volume is found when price went downwards, yet price went up in these 5 minutes.
-> This is the heart of our publication, when this divergence occurs, you can see a barcolor changement:
• orange: when price went up, but LTF Volume was mainly in a downward direction.
• blue: when price went down, but LTF Volume was mainly in an upwards direction.
When we split the green "up volume" into "up" and "neutral", the difference is even higher
(here "neutral volume" is colored grey):
(ΔV = -12.76; "up" - "down")
🔶 CONCEPTS
bullishBear = current bar is red but LTF volume is in upward direction -> blue bar
bearishBull = current bar is green but LTF volume is in downward direction -> orange bar
🔹 Potential positioning - forming of Trigger-line
When not in position, the script will wait for a divergence between price and volume direction. When found, a Trigger-line will appear:
• at high when a blue bar appears ( bullishBear ).
• at low when an orange bar appears ( bearishBull ).
Next step is when the Trigger-line is broken by close or high/low (settings: Trigger )
Here, the closing price went under the grey Trigger-line -> bearish position:
🔹 Trailing Stop-line
When the Trigger-line is broken, the Trailing Stop-line (TS-line) will start:
• low when bullish position
• high when bearish position
You can choose (settings -> Trigger -> Close or H/L ) whether close price or high/low should break the Trigger-line
When alerts are enabled ("Any alert() function call"), you'll get the following message:
• ' signal up ' when bullish position
• ' signal down' when bearish position
After that, the TS-line will be adjusted when:
• a blue bullishBear bar appears when in bullish position -> lowest of {low , previous blue bar's high or orange bar's low}
• an orange bearishBull bar appears when in bearish position -> highest of {high, previous blue bar's high or orange bar's low}
When alerts are enabled ("Any alert() function call"), and the TS-line is broken, you'll get the following message:
• ' TS-line broken down ' when out bullish position
• ' TS-line broken up ' when out bearish position
🔹 Reference Point
Default the direction of price will be evaluated by comparing closing price with opening price.
When open and close are the same, you'll get "neutral volume".
You can use "previous close" instead (as in built-in volume indicator) to include gaps.
If close equals open , but close is lower than previous close , it will be regarded as " down volume ",
similar, when close is higher than previous close , it will be regarded as " up volume "
Note, the setting applies for the current timeframe AND Lower timeframe:
Based on: " open " (close - open)
Based on: " previous close " (close - previous close)
🔹 Adjustment
When the TS-line changes, this can be adjusted with a percentage of price , or a multiple of " True Range "
Default (Δ line -> Adjustment - 0)
Δ line -> Adjustment 0.03% (of price)
Δ line -> Mult of TR (10)
🔶 SETTINGS
🔹 LTF: choose your Lower TimeFrame: 1S (seconds), 5S, 10S, 15S, 30S, 1 minute)
🔹 Trigger: Choose the trigger for breaking the Trigger-line ; close or H/L (high when bullish position, low when bearish position)
🔹 Δ line ( Trailing Stop-line ): add/subtract an adjustment when the TS-line changes ( default: Adjustment ):
• Adjustment ( default: 0 ): add/subtract an extra % of price
• Mult of TR : add/subtract a multiple of True Range
🔹 Based on: compare closing price against:
• open
• previous close
🔹 "Neutral-Volume" is considered "Up-Volume" : this setting will dictate whether nV is considered as green 'buy' volume or not.
🔶 CONSIDERATIONS
🔹 The lowest LTF (1S) will give you more detail and will get data close to tick data.
However, a maximum of 100,000 intrabars can be used in calculations .
This means on the daily chart you won't see anything since 1 day ~ 86400 seconds. (just over 1 bar)
-> choose a lower chart timeframe, or choose a higher LTF (5S, 10S, ... 1 minute)
🔹 Always choose a LTF lower than the current chart timeframe.
🔹 Pine Script™ code using this request.security_lower_tf() may calculate differently on historical and real-time bars, leading to repainting .
True Range/Expected MoveThis indicator plots the ratio of True Range/Expected Move of SPX. True Range is simple the high-low range of any period. Expected move is the amount that SPX is predicted to increase or decrease from its current price based on the current level of implied volatility. There are several choices of volatility indexes to choose from. The shift in color from red to green is set by default to 1 but can be adjusted in the settings.
Red bars indicate the true range was below the expected move and green bars indicate it was above. Because markets tend to overprice volatility it is expected that there would be more red bars than green. If you sell SPX or SPY option premium red days tend to be successful while green days tend to get stopped out. On a 1D chart it is interesting to look at the clusters of bar colors.
Average Range LinesThis Average Range Lines indicator identifies high and low price levels based on a chosen time period (day, week, month, etc.) and then uses a simple moving average over the length of the lookback period chosen to project support and resistance levels, otherwise referred to as average range. The calculation of these levels are slightly different than Average True Range and I have found this to be more accurate for intraday price bounces.
Lines are plotted and labeled on the chart based on the following methodology:
+3.0: 3x the average high over the chosen timeframe and lookback period.
+2.5: 2.5x the average high over the chosen timeframe and lookback period.
+2.0: 2x the average high over the chosen timeframe and lookback period.
+1.5: 1.5x the average high over the chosen timeframe and lookback period.
+1.0: The average high over the chosen timeframe and lookback period.
+0.5: One-half the average high over the chosen timeframe and lookback period.
Open: Opening price for the chosen time period.
-0.5: One-half the average low over the chosen timeframe and lookback period.
-1.0: The average low over the chosen timeframe and lookback period.
-1.5: 1.5x the average low over the chosen timeframe and lookback period.
-2.0: 2x the average low over the chosen timeframe and lookback period.
-2.5: 2.5x the average low over the chosen timeframe and lookback period.
-3.0: 3x the average low over the chosen timeframe and lookback period.
Look for price to find support or resistance at these levels for either entries or to take profit. When price crosses the +/- 2.0 or beyond, the likelihood of a reversal is very high, especially if set to weekly and monthly levels.
This indicator can be used/viewed on any timeframe. For intraday trading and viewing on a 15 minute or less timeframe, I recommend using the 4 hour, 1 day, and/or 1 week levels. For swing trading and viewing on a 30 minute or higher timeframe, I recommend using the 1 week, 1 month, or longer timeframes. I don’t believe this would be useful on a 1 hour or less timeframe, but let me know if the comments if you find otherwise.
Based on my testing, recommended lookback periods by timeframe include:
Timeframe: 4 hour; Lookback period: 60 (recommend viewing on a 5 minute or less timeframe)
Timeframe: 1 day; Lookback period: 10 (also check out 25 if your chart doesn’t show good support/resistance at 10 days lookback – I have found 25 to be useful on charts like SPX)
Timeframe: 1 week; Lookback period: 14
Timeframe: 1 month; Lookback period: 10
The line style and colors are all editable. You can apply a global coloring scheme in the event you want to add this indicator to your chart multiple times with different time frames like I do for the weekly and monthly.
I appreciate your comments/feedback on this indicator to improve. Also let me know if you find this useful, and what settings/ticker you find it works best with!
Also check out my profile for more indicators!
ATR VisualizerAdvance Your Market Analysis with the True Range Indicator
The True Range Indicator is a sophisticated screener meticulously developed to bolster your trading execution by presenting an exceptional understanding of the market direction. The centerpiece of this instrument is a distinctive candle configuration depicting the Average True Range (ATR) and the Bear/Bull range. However, it traverses beyond the conventional channels to offer specific market settings to boost your trading decisions.
User-Defined Settings
Broadly, the indicator offers five dynamic settings:
Bear/Bull Range
The Bear/Bull Range outlines the ATR for each candle type - bearish and bullish - and then smartly opts for the pertinent one based on the prevalent market circumstances. This feature aids in comparing the range of bullish and bearish candlesticks, which deepens your understanding of the price action and volatility.
Bearish Range
The Bearish Range isolates and computes the ATR for bearish candles solely. Utilizing this option spots the bear-dominated periods and provides insights about potential market reversals or downward continuations.
Bullish Range
Opposite to the Bearish Range, the Bullish Range setting tabulates the ATR exclusively for bullish candles. It assists in tracking the periods when bulls control, enlightening traders about the possibility of upward continuations or trend reversals.
Average Range
The Average Range provides an unbiased measure of range without prioritizing either bull or bear trends. This model is ideal for traders looking for a holistic interpretation of market behavior, regardless of direction.
Cumulative Average Range
Equally significant is the Cumulative Average Range which calculates the aggregate moving average of the true ranges for an expressed period. This setting is extremely valuable when evaluating the long-term volatility and spotting potential breakouts.
Dual Candle Configuration
Going a step ahead, the True Range Indicator uniquely offers the possibility to incorporate more than one candle estimate on your screen. This ensures simultaneous analysis of multiple market dynamics, thereby enhancing your trading precision multifold.
Concluding Thoughts
In essence, the True Range Indicator is an indispensable companion for traders looking to not only leverage market volatility but also make educated predictions. Equipped with an array of insightful market settings and the ability to display dual candle estimates on-screen, you can customize the functionality to suit your unique trading style and magnify your market performance dramatically.
Balance of Force (BOF)The script "Balance of Force" is an indicator that aims to provide insight into the bullish and bearish forces present in the market by analyzing the relationship between bullish and bearish true ranges. The indicator first calculates the bearish and bullish true ranges by taking the absolute difference between the open and close prices for each period and summing these values over a user-specified length. It then calculates the ratio of the bullish true range to the bearish true range and takes the natural logarithm of this value, resulting in the "bullish-bearish ratio".
The script then calculates the standard deviation of this ratio over a user-specified length to create a measure of volatility. Using this deviation and the dominant cycle, it then applies an exponential moving average to smooth the ratio. The indicator plots the smoothed ratio, the raw ratio, and the deviation of the ratio multiplied by 1, 2 and 3 in addition to filling the area between the deviation multiplied by 3 and the log(1) with red and green. The user can use the indicator to identify potential bullish or bearish market conditions by analyzing the relationship between the smoothed ratio and the log(1) and the deviation of the ratio.
True Range Adjusted Exponential Moving Average [CC]The True Range Adjusted Exponential Moving Average was created by Vitali Apirine (Stocks and Commodities Jan 2023 pgs 22-27) and this is the latest indicator in his EMA variation series. He has been tweaking the traditional EMA formula using various methods and this indicator of course uses the True Range indicator. The way that this indicator works is that it uses a stochastic of the True Range vs its highest and lowest values over a fixed length to create a multiple which increases as the True Range rises to its highest level and decreases as the True Range falls. This in turn will adjust the Ema to rise or fall depending on the underlying True Range. As with all of my indicators, I have color coded it to turn green when it detects a buy signal or turn red when it detects a sell signal. Darker colors mean it is a very strong signal and let me know if you find any settings that work well overall vs the default settings.
Let me know if you would like me to publish any other scripts that you recommend!
TASC 2023.01 TRAdj EMA█ OVERVIEW
TASC's January 2023 edition of Traders' Tips includes an article titled "True Range Adjusted Exponential Moving Average (TRadj EMA)" by Vitali Apirine. This code implements the indicator presented in that publication.
█ CONCEPTS
The True Range Adjusted Exponential Moving Average (TRAdj EMA) is a trend-following indicator that considers volatility for a quicker response to price changes. It is an EMA that modulates its weighting factor based on the true range (TR) of the asset.
In a trading strategy, traders can use a TRAdj EMA in tandem with an EMA of the same length to identify an asset's trend, or they can use it alongside another TRAdj EMA of a different length to identify turning points and filter price movements.
█ CALCULATIONS
The following steps are performed to calculate the indicator:
• Calculate the asset's TR according to the standard definition proposed by J. Welles Wilder, Jr.
• Define the true range adjustment factor as:
TRAdj =( Current TR − Minimum TR) ⁄ ( Maximum TR − Minimum TR ),
where Maximum TR and Minimum TR are the maximum and minimum TR values over the specified lookback period .
• Calculate the TRAdj EMA in the same manner as a traditional EMA, but with a weighting factor defined as:
2*(1 + TRAdj * Multiplier ) ⁄ ( EMA length + 1),
where Multiplier is an input parameter that ranges from 5 to 10. For comparison, a traditional EMA uses a weighting factor of 2 ⁄ ( EMA length + 1).
SPX Expected MoveThis indicator plots the "expected move" of SPX for today's trading session. Expected move is the amount that SPX is predicted to increase or decrease from its current price, based on the current level of implied volatility. The implied volatility in this indicator is computed from the current value of the VIX (or one of several volatility symbols available on Trading view). The computation is done using standard formula. The resulting plots are labeled as 1 and 2 standard deviations. The default values are to use VIX as well as 252 trading days in the years.
Use the square root of (days to expiration, or in this case a fraction of the day remaining) divided but the square root of (252, or number of trading days in a year).
timeRemaining = math.sqrt(DTE) / math.sqrt(252)
Standard deviation move = SPX bar closing price * (VIX/100) * timeRemaining
ATR - Average True Range + Dynamic Trend w/ Signals | by Octopu$↕ ATR - Average True Range + Dynamic Trend w/ Signals | by Octopu$
What is ATR?
ATR stands for Average True Range
A Technical Analysis Indicator that measures market volatility by decomposing the range of a Security Price in a specific period.
The ATR can be used as a High Low Spectrum,
As well as a variation of a Moving Average, considering the ranges on a timeframe, generally this being 14 days.
Shorter periods can be used (will generate more signals) or longer periods for steadier trends (for fewer signals)
A ticker on a high volatility has a high ATR.
A ticker on a low volatility has a low ATR.
It is an useful resource for a trading system:
Can be used to enter or exit trades and/or also measure the daily spectrum of a stock.
Does not necessarily points price direction, but takes into account gaps and strong legs.
Can also be used as trading positions confirmation,
Rather be it for stop losses or take profits,
As well as setting trailing stops or limit orders.
This tool offers a great Risk to Reward Ratio, considering the fact you will be aware of the possible moves that an asset can perform.
This indicator should not be used as a standalone tool.
(The combination of factors relies on your own knowledge about Confluence Factors along with your Due Diligence)
This indicator is not an advice to buy or sell securities.
www.tradingview.com
SPY
ANY Ticker. ANY Timeframe.
(Used SPY 5m as Example only)
Features:
• ATR ( Average True Range )
• Range UP and DOWN
• Movement from Price Line
• Dynamic ATR
• Cross/Test Signals
• Live and Last Close
Options:
• Specific Factors Setup
• Length Customization
• Toggle On/Off
• Color PIcker
• Styling Options
Notes:
v1.0
Indicator release.
Changes and updates can come in the future for additional functionalities or per requests. Follow and Stay Tuned!
Did you like it? Please Support and Shoot me a message! I'd appreciate if you dropped by to say thanks! Thank you.
- Octopu$
🐙
Higher Time Frame Average True RangesPurpose: This script will help an options trader asses risk and determine good entry and exit strategies
Background Information: The true range is the greatest of: current high minus the current low; the absolute value of the current high minus the previous close; and the absolute value of the current low minus the previous close. The Average True Range (ATR) is a 14-day moving average of the true range. Traders use the ATR indicator to assess volatility in stocks and decide when to enter and exit trades. It is important to note the limitations of using True Range and ATR: These indications cannot tell you the direction of your options trade (call vs. put) and they cannot tell you whether a particular trend is about to reverse. However, it can be used to assess if volatility has peaked for a particular direction and time period.
How this script works: This indicator calculates true range for the daily (DTR), weekly (WTR), and monthly (MTR) time frames and compares it to the Average True Range (ATR) for each of those time frames (DATR, WATR, and MATR). The comparison is displayed into a colored table in the upper right-hand corner of the screen. When a daily, weekly, or monthly true range reaches 80% of its respective ATR, the row for that time frame will turn Orange indicating medium risk for staying in the trade. If the true range goes above 100% of the respective ATR, then the row will turn Red indicating high risk for staying in the trade. When the row for a time period turns red, volatility for the time period has likely peaked and traders should heavily consider taking profits. It is important to note these calculations start at different times for each time frame: Daily (Today’s Open), Weekly (Monday’s Open), Monthly (First of the Month’s Open). This means if it’s the 15th of the month then the Monthly True Range is being calculated for the trading days in the first half of the month (approximately 10 trade days).
The script also plots three sets of horizontal dotted lines to visually represent the ATR for each time period. Each set is generated by adding and subtracting the daily, weekly, and monthly ATRs from that time periods open price. For example, the weekly ATR is added and subtracted from Mondays open price to visually represent the true range for that week. The DATR is represented by red lines, the WATR is represented by the green lines, and the MATR is represented by the blue lines. These plots could also be used to assess risk as well.
How to use this script: Use the table to assess risk and determine potential exit strategies (Green=Low Risk, Orange=Medium Risk, Red=High Risk. Use the dotted lines to speculate what a stock’s price could be in a given time period (Daily=Red, Weekly=Green, and Monthly=Blue). And don’t forget the true range’s calculation and plots starts at the beginning of each time period!
Volume Volatality IndicatorVolume Volatility Indicator
vol: volume; vma: rma of volume
Cyan column shows (vol - vma)/vma, if vol > vma else shows 0
0 value means vol less than vma: good for continuation
0 < value < 1 means vol more than vma: good for trend
value > 1 means vol more than 2 * vma: good for reversal
tr: truerange; atr: averagetruerange
Lime column show -(tr - atr)/atr, if tr > atr else show 0
0 value means tr less than atr: good for continuation
0 > value > -1 means tr more than atr: good for trend
value < -1 means tr more than 2 * atr: good for reversal
Cyan line = 1
Lime line = -1
This indicator shows the volume and truerange together.
Good for filtering trending and consolidating markets.
Thanks for the support.
ATR VS TRUE RANGEDisplays ATR and True Range on the same panel.
Adjust the input and style settings to your liking.
ATR PercentDisplays daily percentage on the bottom right corner of chart.
Formula:
True Range / ATR * 100
Greedy MA & Greedy Bollinger Bands This moving average takes all of the moving averages between 1 and 700 and takes the average of them all. It also takes the min/max average (donchian) of every one of those averages. Also included is Bollinger Bands calculated in the same way. One nice feature I have added is the option to use geometric calculations for. I also added regular bb calculations because this can be a major hog. Use this default setting on 1d or 1w. Enjoy!
ps, I call it greedy because the default settings wont work on lower time frames
[MACLEN] TRUE RANGEThis is a true range (TR) based strategy with weighted moving average (WMA) smoothing to remove noise.
In addition, it includes a risk management strategy using 4 "safes" in the same operation to always seek to make a profit.
This is for evaluation only, and it is not recommended to use with real money.
It is a work in progress. I read your comments.
Volatility ChannelThis script is based on an idea I have had for bands that react better to crypto volatility. It calculates a Donchian Channel, SMMA-Smoothed True Range, Bollinger Bands (standard deviation), and a Keltner Channel (average true range) and averages the components to construct its bands/envelopes. This way, hopefully band touches are a more reliable indicator of a temporary bottom, and so on. Secondary coloring for strength of trend is given as a gradient based on RSI.
ATR TREXTry to visualize TREX method.
-4 types of candle based on TR :
1. Spinning ( Candle < 0.8*ATR )
2. Standard ( 0.8*ATR < Candle < 1.2*ATR )
3. Long bar ( 1.2*ATR < Candle < 2.5*ATR )
4. Spike ( 2.5*ATR < Candle )
ATR length is different base on FRACTAL timeframes.
you can now find what is type of candle as colored ATR.
-Time frames :
1 Min
5 Min
15 Min
1 Hour
4 Hour
1 Day
1 Week
1 Month
I am working on TREX method and this indicator will change and improve . (V1.0)
Br
Amin
Secondary Chart with OverSized CandlesHi everyone, I'm sharing a simple script I made for a friend. He was looking for a way to add another asset to his chart, and monitor relevant movements \ spot eventual correlation, especially when trading Cryptocurrencies.
We couldn't find a similar script already available so here it is - the code is commented and I hope it's clear enough :)
Notes:
- The parameter scale = scale.left keeps the scales separated and therefore the chart is more organized, otherwise the chart would appear flat if the price difference is too big (e.g. BTC vs XRP)
- It is possible to have the script running in a separate panel (instead of overlay) by moving it to a new pane (when added to the chart) or by removing the parameter overlay = true at the beginning of the code.
- In case you wish to add indicators to this sub-chart (e.g. Bollinger Bands, EMA, etc..) you can do that by adding the relevant code and feed it with the variables OPEN \ HIGH \ LOW \ CLOSE as well as using the same method to retrieve new variables from the target asset with the request.security function.
Hope this comes handy.
Val - Protervus