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 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) и другие факторы. Я не буду останавливаться на них, так как каждый может найти описание этих стратегий и использовать их на свой выбор.
Индикатор отображается и работает только на дневном таймфрейме!
Индикатор создан по наставлениям, описанию функционала и стратегии господина Герчика. Огромное спасибо, Шеф!
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
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.
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
+ Rate of ChangeNOTE!* If you were using my previous + Rate of Change (and OBV) indicator, I will not be updating that. OBV was moved to my + Breadth & Volume indicator.
This indicator here is basically and updated version of the old indicator, without OBV.
The Rate of Change, or RoC, is a momentum indicator that measures the percentage change in price between the current period and the price n periods ago.
It oscillates above and below a zeroline, basically showing positive or negative momentum.
I applied the OBV's calculation to it, but without the inclusion of volume (also added a lookback period) to see what would happen. I rather liked the result.
I call this the "Cumulative Rate of Change." I only recently realized that this is actually just the OBV without volume, however the OBV does not have a lookback period, and this indicator does.
Doing some more fiddling, I realized that removing both the signum and the volume from the calculation gets you basically a price chart, but calculated as the change in price over n periods. I'm leaving this in because maybe someone discovers they really like having a line chart with moving averages or some other indicator on it to leave their main chart indicator free (giving a more clear look at price action). Can't hurt, right?
Default lookback is set to 1, but play with longer settings (especially if using the traditional RoC, which is by default in TV set to 10, and is nigh on useless at 1--I like 13).
Default source is set to each candle close, but give ohlc4 a look. It smooths out the indicator a bit, and because it's an average of the open, high, low, and close it should give a better idea of what price in general is doing.
Moving averages, Bollinger Bands, Donchian Channels, candle coloring and alerts are my usual additions.
Below are some comparison images of the different indicators wrapped up in here.
Comparison of Cumulative Rate of Change with two different sources. Lookback set to 1.
Cumulative Rate of Change as a price chart, essentially.
And, lastly, the traditional Rate of Change indicator.
VolatilityLibrary "Volatility"
Functions for determining if volatility (true range) is within or exceeds normal.
The "True Range" (ta.tr) is used for measuring volatility.
Values are normalized by the volume adjusted weighted moving average (VAWMA) to be more like percent moves than price.
current(len) Returns the current price adjusted volatitlity ratio.
Parameters:
len : Number of bars to get a volume adjusted weighted average price.
normal(len, maxDeviation, level, gapDays, spec, res) Returns the normal upper range of volatility. Compensates for overnight gaps within a regular session.
Parameters:
len : Number of bars to measure volatility.
maxDeviation : The limit of volatility before considered an outlier.
level : The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays : The number of days in the past to measure overnight gap volaility.
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = '1440').
isNormal(len, maxDeviation, level, gapDays, spec, res) Returns true if the volatility (true range) is within normal levels. Compensates for overnight gaps within a regular session.
Parameters:
len : Number of bars to measure volatility.
maxDeviation : The limit of volatility before considered an outlier.
level : The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays : The number of days in the past to measure overnight gap volaility.
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = '1440').
severity(len, maxDeviation, level, gapDays, spec, res) Returns ratio of the current value to the normal value. Compensates for overnight gaps within a regular session.
Parameters:
len : Number of bars to measure volatility.
maxDeviation : The limit of volatility before considered an outlier.
level : The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays : The number of days in the past to measure overnight gap volaility.
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = '1440').
CH-I: Trend - Higher Timeframe BodyI took the script for the built-in indicator for candle bodies of a higher timeframe (www.tradingview.com) which has a fixed border width and style and added the possibility to customize both the border width and the border style or to even disable the display of any border at all, which makes the presentation of those boxes more flexible.
Dual Mean Reversion Channel (adjusted lower band)This is a public and open-source lighter version compared to the "Overextended Price Channel" which is provided complimentaty to the Trend Insight System.
Introduction :
Channels are very useful tools to assess overextended price, volatility and upcoming retracement or impulsive moves (such as Bollinger Band squeezes). It is an indispensable addition to any trader using Mean Reversion theory for a scalp-trade or swing-trade.
This script contains :
- 2 channels Keltner-style, using the True Range for volatility
- customizable volatility (channel width) and smoothing period
- a standard selection of moving average ; SMA, EMA, VWMA
- an embedded readjustment of the lower bands to avoid the drop on a logarithmic scale (see explanation below)
Why another channel indicator ?
I have found most conventional channels to be either not based on "proper" volatility (e.g. standard deviation of price action for Bollinger Band), or the bottom channel to be ill adapted to the logarithmic scale and plunges to 0 on some high volatility periods, messing with readability on logarithmic auto-scaled chart.
Also, I find the channels to be most useful when superimposed with another one of longer length; especially a pair of channels with a 50 and 200 period moving average respectively. Mean Reversion traders that mostly trade the 50 and 200 SMA/EMA know what I am talking about as having a channel helps to have a better visual for a proper of entry and exit point.
Disclaimer :
This indicator was originally intended to be used along with the Trend Insight System to improve performance, and the default configuration mostly backtested on BTCUSD.
Please use with caution, proper risk management and along with your favorite oscillator, candlestick reading and signals system.
Some explanation :
Based on Mean Reversion paradigm, everything has a tendency to revert back to the mean :
- when the price enters the upper channel, it is supposed to be (or start getting) overbought as the market is getting overheated, thus prone to correction,
- on the other hand, when the price enters the lower channel, it is supposed to be (or getting) oversold and the market looks favorable for a buy-in.
Depending on the trading style used, a trader will usually either wait until the price leaves the channel towards the mean before taking action (conservative style) or you will set limit orders inside the channel as you expect a reversion to the mean (more agressive/risky style).
With two channels, more complex (and maybe precise) rules can be built to optimize one's trading strategy.
Important notes :
In the end, sticking with 50/200 length and a single setting on volatility might be wiser, be wary of overoptimization which is risky at best and counter productive at worst (according to legendary traders such as Mark Douglas). Even if, needless to say, the volatility needs to be adjusted between a nascent and volatile market (such as crypto) compared to standard call markets that are much less volatile.
End notes :
It will always be considered a work in progress to help bring out the best of trading with channels, any comment and suggestion are welcomed.
[kai]Futility RatioAn indicator that measures movement inefficiency
Inefficient movement, that is, the range market becomes a high number, the limit is reached at about 60 and a trend occurs
When the range breaks and a trend occurs, the inefficiency drops to about 40 and many trends end.
The full-scale trend goes down further and goes down to about 25, which is evaluated as an efficient movement, the limit is reached and the trend ends.
As for how to use this Inge, the direction of the trend needs to be considered in other ways.
Create a position when you reach 60
Position closed or contrarian at 40 or 25
I assume the usage
動きの非効率性を測定するインジケーターです
非効率な動きをするつまりレンジ相場は高い数字になって、60程度で限界が訪れてトレンドが発生します
レンジがブレイクしトレンドが発生すると40程度まで非効率性は下がりって多くのトレンドは終了します
本格的なトレンドはさらに下がっていって効率的な動きと評価される25程度まで下がって限界が訪れてトレンドが終了します
このインジの使い方はトレンドの方向は他の方法で考える必要がありますが
60まで上がったときにポジション作成
40又は25でポジションクローズ又は逆張り
という使い方を想定しています