TASC 2024.06 REIT ETF Trading System█ OVERVIEW
This strategy script demonstrates the application of the Real Estate Investment Trust (REIT) ETF trading system presented in the article by Markos Katsanos titled "Is The Price REIT?" from TASC's June 2024 edition of Traders' Tips .
█ CONCEPTS
REIT stocks and ETFs offer a simplified, diversified approach to real estate investment. They exhibit sensitivity to interest rates, often moving inversely to interest rate and treasury yield changes. Markos Katsanos explores this relationship and the correlation of prices with the broader market to develop a trading strategy for REIT ETFs.
The script employs Bollinger Bands and Donchian channel indicators to identify oversold conditions and trends in REIT ETFs. It incorporates the 10-year treasury yield index (TNX) as a proxy for interest rates and the S&P 500 ETF (SPY) as a benchmark for the overall market. The system filters trade entries based on their behavior and correlation with the REIT ETF price.
█ CALCULATIONS
The strategy initiates long entries (buy signals) under two conditions:
1. Oversold condition
The weekly ETF low price dips below the 15-week Bollinger Band bottom, the closing price is above the value by at least 0.2 * ATR ( Average True Range ), and the price exceeds the week's median.
Either of the following:
– The TNX index is down over 15% from its 25-week high, and its correlation with the ETF price is less than 0.3.
– The yield is below 2%.
2. Uptrend
The weekly ETF price crosses above the previous week's 30-week Donchian channel high.
The SPY ETF is above its 20-week moving average.
Either of the following:
– Over ten weeks have passed since the TNX index was at its 30-week high.
– The correlation between the TNX value and the ETF price exceeds 0.3.
– The yield is below 2%.
The strategy also includes three exit (sell) rules:
1. Trailing (Chandelier) stop
The weekly close drops below the highest close over the last five weeks by over 1.5 * ATR.
The TNX value rises over the latest 25 weeks, with a yield exceeding 4%, or its value surges over 15% above the 25-week low.
2. Stop-loss
The ETF's price declines by at least 8% of the previous week's close and falls below the 30-week moving average.
The SPY price is down by at least 8%, or its correlation with the ETF's price is negative.
3. Overbought condition
The ETF's value rises above the 100-week low by over 50%.
The ETF's price falls over 1.5 * ATR below the 3-week high.
The ETF's 10-week Stochastic indicator exceeds 90 within the last three weeks.
█ DISCLAIMER
This strategy script educates users on the system outlined by the TASC article. However, note that its default properties might not fully represent real-world trading conditions for an individual. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script. Additionally, since this strategy utilizes compound conditions on weekly data to trigger orders, it will generate significantly fewer trades than other, higher-frequency strategies.
Bollinger Bands (BB)
Johnny's Adjusted BB Buy/Sell Signal"Johnny's Adjusted BB Buy/Sell Signal" leverages Bollinger Bands and moving averages to provide dynamic buy and sell signals based on market conditions. This indicator is particularly useful for traders looking to identify strategic entry and exit points based on volatility and trend analysis.
How It Works
Bollinger Bands Setup: The indicator calculates Bollinger Bands using a specified length and multiplier. These bands serve to identify potential overbought (upper band) or oversold (lower band) conditions.
Moving Averages: Two moving averages are calculated — a trend moving average (trendMA) and a long-term moving average (longTermMA) — to gauge the market's direction over different time frames.
Market Phase Determination: The script classifies the market into bullish or bearish phases based on the relationship of the closing price to the long-term moving average.
Strong Buy and Sell Signals: Enhanced signals are generated based on how significantly the price deviates from the Bollinger Bands, coupled with the average candle size over a specified lookback period. The signals are adjusted based on whether the market is bullish or bearish:
In bullish markets, a strong buy signal is triggered if the price significantly drops below the lower Bollinger Band. Conversely, a strong sell signal is activated when the price rises well above the upper band.
In bearish markets, these signals are modified to be more conservative, adjusting the thresholds for triggering strong buy and sell signals.
Features:
Flexibility: Users can adjust the length of the Bollinger Bands and moving averages, as well as the multipliers and factors that determine the strength of buy and sell signals, making it highly customizable to different trading styles and market conditions.
Visual Aids: The script vividly plots the Bollinger Bands and moving averages, and signals are visually represented on the chart, allowing traders to quickly assess trading opportunities:
Regular buy and sell signals are indicated by simple shapes below or above price bars.
Strong buy and sell signals are highlighted with distinctive colors and placed prominently to catch the trader's attention.
Background Coloring: The background color changes based on the market phase, providing an immediate visual cue of the market's overall sentiment.
Usage:
This indicator is ideal for traders who rely on technical analysis to guide their trading decisions. By integrating both Bollinger Bands and moving averages, it provides a multi-faceted view of market trends and volatility, making it suitable for identifying potential reversals and continuation patterns. Traders can use this tool to enhance their understanding of market dynamics and refine their trading strategies accordingly.
Vegas SuperTrend Enhanced - Strategy [presentTrading]█ Introduction and How it is Different
The "Vegas SuperTrend Enhanced - Strategy " trading strategy represents a novel integration of two powerful technical analysis tools: the Vegas Channel and the SuperTrend indicator. This fusion creates a dynamic, adaptable strategy designed for the volatile and fast-paced cryptocurrency markets, particularly focusing on Bitcoin trading.
Unlike traditional trading strategies that rely on a static set of rules, this approach modifies the SuperTrend's sensitivity to market volatility, offering traders the ability to customize their strategy based on current market conditions. This adaptability makes it uniquely suited to navigating the often unpredictable swings in cryptocurrency valuations, providing traders with signals that are both timely and reflective of underlying market dynamics.
BTC 6h LS
█ Strategy, How it Works: Detailed Explanation
This is an innovative approach that combines the volatility-based Vegas Channel with the trend-following SuperTrend indicator to create dynamic trading signals. This section delves deeper into the mechanics and mathematical foundations of the strategy.
Detail picture to show :
🔶 Vegas Channel Calculation
The Vegas Channel serves as the foundation of this strategy, employing a simple moving average (SMA) coupled with standard deviation to define the upper and lower bounds of the trading channel. This channel adapts to price movements, offering a visual representation of potential support and resistance levels based on historical price volatility.
🔶 SuperTrend Indicator Adjustment
Central to the strategy is the SuperTrend indicator, which is adjusted according to the width of the Vegas Channel. This adjustment is achieved by modifying the SuperTrend's multiplier based on the channel's volatility, allowing the indicator to become more sensitive during periods of high volatility and less so during quieter market phases.
🔶 Trend Determination and Signal Generation
The market trend is determined by comparing the current price with the SuperTrend values. A shift from below to above the SuperTrend line signals a potential bullish trend, prompting a "buy" signal, whereas a move from above to below indicates a bearish trend, generating a "sell" signal. This methodology ensures that trades are entered in alignment with the prevailing market direction, enhancing the potential for profitability.
BTC 6h Local
█ Trade Direction
A distinctive feature of this strategy is its configurable trade direction input, allowing traders to specify whether they wish to engage in long positions, short positions, or both. This flexibility enables users to tailor the strategy according to their risk tolerance, trading style, and market outlook, providing a personalized trading experience.
█ Usage
To utilize the "Vegas SuperTrend - Enhanced" strategy effectively, traders should first adjust the input settings to align with their trading preferences and the specific characteristics of the asset being traded. Monitoring the strategy's signals within the context of overall market conditions and combining its insights with other forms of analysis can further enhance its effectiveness.
█ Default Settings
- Trade Direction: Both (allows trading in both directions)
- ATR Period for SuperTrend: 10 (determines the length of the ATR for volatility measurement)
- Vegas Window Length: 100 (sets the length of the SMA for the Vegas Channel)
- SuperTrend Multiplier Base: 5 (base multiplier for SuperTrend calculation)
- Volatility Adjustment Factor: 5.0 (adjusts SuperTrend sensitivity based on Vegas Channel width)
These default settings provide a balanced approach suitable for various market conditions but can be adjusted to meet individual trading needs and objectives.
TrendVista Swing IndicatorOverview
The swing indicator is designed to offer traders a comprehensive analysis of market trends and volatility by integrating Bollinger Bands and the Average True Range (ATR). It aids in the visualization of price movements and volatility across multiple time frames, thereby providing insights into potential buy and sell opportunities.
Key Features
- Multitimeframe Analysis : By default, the indicator examines the market across the following time frames: 1 Day (1D), 4 Hours (4H), 1 Hour (1H), and 15 Minutes (15min). Users have the flexibility to modify these time frames to suit their trading strategy by adjusting the indicator's settings.
- Buy and Sell Timings : The indicator identifies optimal buy signals when the price drops below the lower Bollinger Band and subsequently re-enters the band's range. Additionally, a buy signal is generated during high volatility periods—signified by the ATR exceeding its 10-day average—helping traders spot potential liquidation points. Sell signals are tailored for traders looking to exit long positions rather than for initiating short positions.
- Bollinger Bands Phases : The indicator categorizes the market condition into three phases based on Bollinger Bands movement:
- Neutral Phase : When the closing price is within the Bollinger Bands' upper and lower limits.
- Bullish Phase : Signaled by the price closing above the upper Bollinger Band, suggesting an upward trend until the price closes below the middle band.
- Bearish Phase : Initiated when the price closes below the lower Bollinger Band, indicating a downtrend until the price closes above the middle band.
Users can opt to exclude the neutral phase from the analysis through the indicator's settings for a more focused view on bullish or bearish trends.
Indicator Customization
The swing indicator is versatile, allowing users to customize the time frames and phase visibility according to their preferences. This feature ensures that traders can tailor the indicator to match their specific analysis needs and trading strategies.
Considerations
- The signals provided by the swing indicator are not symmetrically designed for both buy and sell actions. The indicator primarily optimizes for identifying long positions, particularly in bull markets. The sell signals are intended for exiting existing long positions rather than for short selling.
Bollinger Band Wick and SRSI Signals [MW]Introduction
This indicator uses a novel combination of Bollinger Bands, candle wicks crossing the upper and lower Bollinger Bands and baseline, and combines them with the Stochastic SRSI oscillator to provide early BUY and SELL signals in uptrends, downtrends, and in ranging price conditions.
How it’s unique
People generally understand Bollinger Bands and Keltner Channels. Buy at the bottom band, sell at the top band. However, because the bands themselves are not static, impulsive moves can render them useless. People also generally understand wicks. Candles with large wicks can represent a change in pattern, or volatile price movement. Combining those two to determine if price is reaching a pivot point is relatively novel. When Stochastic RSI (SRSI) filtering is also added, it becomes a genuinely unique combination that can be used to determine trade entries and exits.
What’s the benefit
The benefit of the indicator is that it can help potentially identify pivots WHEN THEY HAPPEN, and with potentially minimal retracement, depending on the trader’s time window. Many indicators wait for a trend to be established, or wait for a breakout to occur, or have to wait for some form of confirmation. In the interpretation used by this indicator, bands, wicks, and SRSI cycles provide both the signal and confirmation.
It takes into account 3 elements:
Price approaching the upper or lower band or the baseline - MEANING: Price is becoming extended based on calculations that use the candle trading range.
A candle wick of a defined proportion (e.g. wick is 1/2 the size of a full candle OR candle body) crosses a band or baseline, but the body does not cross the band or baseline - MEANING: Buyers and sellers are both very active.
The Stochastic RSI reading is above 80 for SELL signals and below 20 for BUY signals - MEANING: Additional confirmation that price is becoming extended based on the current cyclic price pattern.
How to Use
SIGNALS
Buy Signals - Green(ish):
B Signal - Potential pivot up from the lower band when using the preferred multiplier
B1 Signal - Potential pivot up from baseline
Sell Signals - Red(ish):
S Signal - Potential pivot down from the upper band when using the preferred multiplier
S1 Signal - Potential pivot down from the baseline
DISCUSSION
During an uptrend or downtrend, signals from the baseline can help traders identify areas where they may enter the trending move with the least amount of drawdown. In both cases, entry points can occur with baseline signals in the direction of the trend.
For example, in an uptrend (when the price is forming higher highs and higher lows, or when the baseline is rising), price tends to oscillate between the upper band and baseline. In this case, the baseline BUY signal (B3) can show an entry point.
In a downtrend (when the price is forming lower highs and lower lows, or when the baseline is falling), price tends to oscillate between the baseline and the lower band. In this case, the baseline SELL signal (S3) can show an entry point.
During consolidation, when price is ranging, price tends to oscillate between the upper and lower bands, while crossing through the baseline unperturbed. Here, entry points can occur at the upper and lower bands.
When all conditions are met at the lower band during consolidation, a BUY signal (B), can occur. This signal may also occur prior to a break out of consolidation to the upside.
When all conditions are met at the upper band during consolidation, a SELL signal (S), can occur. This signal may also occur prior to a break out of consolidation to the downside.
Additional, B1 and S1 signals can be displayed that use the baseline as the pivot level.
Settings
SIGNALS
Show Bollinger Band Signals (Default: True): Allows signal labels to be shown.
Hide Baseline Signals (Default: False): Baseline signals are on by default. This will turn them off.
Show Wick Signals (Defau
lt: True): Displays signals when wicking occurs.
BOLLINGER BAND SETTINGS
Period length for Bollinger Band Basis (Default: 21): Length of the Bollinger Band (BB) moving average basis line.
Basis MA Type (Default: SMA): The moving average type for the BB Basis line.
Source (Default: “close”): The source of time series data.
Standard Deviation Multiplier (Default: 2.5: The deviation multiplier used to calculate the band distance from the basis line.
WICK SETTINGS FOR BOLLINGER BANDS
Wick Ratio for Bands (Default: 0.3): The ratio of wick size to total candle size for use at upper and lower bands.
Wick Ratio for Baseline (Default: 0.3): The ratio of wick size to total candle size for use at baseline.
WICK SETTINGS FOR CANDLE SIGNALS
Upper Wick Threshold (Default: 50): The percent of upper wick compared to the full candle size or candle body size.
Lower Wick Threshold (Default: 50): The percent of lower wick compared to the full candle size or candle body size.
Use Candle Body (Default: false): Toggles the use of the full candle size versus the candle body size when calculating the wick signal.
VISUAL PREFERENCES
Fill Bands (Default: true): Use a background color inside the Bollinger Bands.
Show Signals (Default: true): Toggle the Bollinger Band upper band, lower band, and baseline signals.
Show Bollinger Bands (Default: true): Show the Bollinger Bands.
STOCHASTIC SETTINGS
Use Stochastic RSI Filtering (Default: False): This will only trigger some SELL signals when the stochastic RSI is above 80, and BUY signals when below 20.
K (Default: 3): The smoothing level for the Stochastic RSI.
RSI Length (Default: 14): The period length for the RSI calculation.
Stochastic Length (Default: 8): The period length over which the stochastic calculation is performed.
Calculations
Bollinger Bands are a technical analysis tool that are used to measure market volatility and identify overbought or oversold conditions in the trading of financial instruments, such as stocks, bonds, commodities, and currencies. Bollinger Bands consist of three lines plotted on a price chart:
Middle Band, Basis, or Baseline: This is typically a simple moving average (SMA) of the closing prices over a certain period. It represents the intermediate-term trend of the asset's price.
Upper Band: This is calculated by adding a certain number of standard deviations to the middle band (SMA). The upper band adjusts itself with the increase in volatility.
Lower Band: This is calculated by subtracting the same number of standard deviations from the middle band (SMA). Like the upper band, the lower band adjusts to changes in volatility.
The candle wick signals occur if the wick is at the specified ratio compared to either the entire candle or the candle body. The upper band, lower band, and baseline signals happen if the wick is the specified ratio of the total candle size. For the major signals for upper and lower bands, these occur when the wick extends outside of the bands while closing a candle inside of the bands. For the baseline signals, they occur if a wick crosses a baseline but closes on the other side.
Other Usage Notes and Limitations
To understand future price movement, this indicator assumes that 3 things must be known:
Evidence of a change of market structure. This can be demonstrated by increased volatility, consolidation, volume spikes (which can be tracked with the MW Volume Impulse Indicator) or, in the case of this indicator, candle wicks.
The potential cause of the change. It could be a VWAP line (which can be tracked with the Multi VWAP , and Multi VWAP from Gaps indicators), an event, an important support or resistance level, a key moving average, or many other things. This indicator assumes the ATR bands can be a cause.
The current position in the price cycle. Oscillators like the RSI, and MACD, are typical measures of price oscillation (other oscillators like the Price and Volume Stochastic Divergence indicator can also be useful). This indicator uses the Stochastic RSI oscillator to determine overbought and oversold conditions.
When evidence of the change appears, and the potential cause of the change is identified, and the price oscillation is at a favorable position for the desired trading direction, this indicator will generate a signal.
ATR Bands (or Keltner Channels) are used to determine when price might “revert to the mean”. Crossing, or being near the upper or lower band, can indicate an overbought or oversold condition, which could lead to a price reversal. By tracking the behavior of candle wicks during these events, we can see how active the battle is between buyers and sellers.
If the top of a wick is large, it may indicate that sellers are aggressively attempting to bring the price down. Conversely, if the bottom wick is large, it can indicate that buyers are actively trying to counter the price action caused by selling pressure.
When this wicking action occurs at times when price is not near the upper band, lower band, or baseline, it could indicate the presence of an important level. That could mean a nearby VWAP line, a supply or demand zone, a round price number, or a number of other factors. In any case, this wick may be the first indication of a price reversal.
Shorter baseline periods may be better for short period trading like scalping or day trading, while longer period baselines can show signals that are better suited to swing trading, or longer term investing.
It's important for traders to be aware of the limitations of any indicator and to use them as part of a broader, well-rounded trading strategy that includes risk management, fundamental analysis, and other tools that can help with reducing false signals, determining trend direction, and providing additional confirmation for a trade decision. Diversifying strategies and not relying solely on one type of indicator or analysis can help mitigate some of these risks.
The TradingView platform allows a maximum of 500 labels per chart. This means that if your settings allow for a lot of signals, labels for earlier ones may not appear if the total number of labels exceeds 500 for the chart.
SqueeZe Score [UAlgo]The "SqueeZe Score" is a script based on the "Squeeze Momentum Indicator". It utilizes Bollinger Bands (BB) and Keltner Channels (KC) to identify periods of low volatility, indicating potential upcoming price movements. The Z-Score method is employed to measure deviations from the mean, highlighting extreme price movements within the context of the current volatility environment. This script provides traders with visual cues for potential bullish and bearish divergences, aiding in decision-making during trading activities.
🔶Key Features:
SqueeZe Settings: Users can customize parameters such as the length and multiplier factors for Bollinger Bands and Keltner Channels, providing flexibility to adapt the indicator to different trading strategies and market conditions.
Divergence Detection: The script includes options to detect and display both bullish and bearish divergences, providing additional insights into potential trend reversals or continuations.
Customizable Z-Score Thresholds: Thresholds for the Z-Score are user-defined, enabling traders to set levels at which extreme price movements are highlighted on the chart, facilitating quick identification of significant market conditions.
🔶Credit:
This script is inspired by the work of @LazyBear, who contributed to the original concept and development of the Squeeze Momentum indicator.
🔶Disclaimer:
- The information provided by this script is for educational and informational purposes only and should not be construed as financial advice.
- Users are encouraged to conduct their own research and analysis before making any investment decisions.
Breaker Blocks Screener | Flux Charts💎 GENERAL OVERVIEW
Introducing our new Breaker Blocks Screener! This screener can provide information about the latest breaker blocks in up to 5 tickers. You can also customize the algorithm that finds the breaker blocks and the styling of the screener.
Features of the new Breaker Blocks Screener :
Find Latest Breaker Blocks Accross 5 Tickers
Latest Status, Restests & Volume
Customizable Algoritm / Styling
📌 HOW DOES IT WORK ?
Breaker blocks form when an order block fails, or "breaks". It is often associated with market going in the opposite direction of the broken order block, and they can be spotted by following order blocks and finding the point they get broken, ie. price goes below a bullish order block.
The volume of a breaker block is simply the total volume of the bar that the original order block is broken. Often the higher the breaking bar's volume, the stronger the breaker block is.
This screener then finds breaker blocks accross 5 different tickers, and shows the latest information about them.
Status ->
Far -> The current price is far away from the breaker block.
Approaching ⬆️/⬇️ -> The current price is approaching the breaker block, and the direction it's approaching from.
Inside -> The price is currently inside the breaker block.
Retests -> Retest means the price to invalidate the breaker block, but failed to do so. Here you can see how many times the price retested the breaker block.
For the volume, check the top of the "How Does It Work" section.
🚩UNIQUENESS
This screener can detect latest breaker blocks and give information about them for up to 5 tickers. This saves the user time by showing them all in a dashboard at the same time. The screener shows the number of the retests of the breaker block as an unique trait. Another unique ability of the screener is that it shows the latest valid breaker block's volume in the dashboard.
⚙️SETTINGS
1. Tickers
You can set up to 5 tickers for the screener to scan breaker blocks here. You can also enable / disable them and set their individual timeframes.
2. General Configuration
Zone Invalidations -> Select between Wick & Close price for Order & Breaker Block Invalidation.
Swing Length -> Swing length is used when finding order block formations. Smaller values will result in finding smaller order blocks.
Reversal Zones [UAlgo]🔶Description:
"Reversal Zones " aims to identify potential reversal zones in price movements. The indicator provides visual signals on the chart, indicating potential overbought and oversold conditions based on the calculated values. It offers traders insights into possible turning points in the market, aiding in decision-making processes regarding entry and exit points.
🔶Key Features:
Bollinger Bands Percentile (BB Percentile):
Bollinger Bands Percentile is utilized in this script to gauge the current price position relative to its recent volatility. By calculating the percentile rank of the current price within the Bollinger Bands, traders can identify extreme price levels. This assists in recognizing potential overbought or oversold conditions, where price may be due for a reversal.
Choppiness Index (CI):
The Choppiness Index is employed here to measure the market's trendiness or choppiness. By evaluating the efficiency of the price movement, CI helps traders determine whether the market is trending or consolidating.
Commodity Channel Index (CCI):
The Commodity Channel Index is integrated into this script to capture price momentum. CCI quantifies the relationship between the current price, a moving average, and standard deviation. Traders use CCI to identify overbought or oversold conditions and potential trend reversals.
By averaging and smoothing these values, traders can obtain a clearer picture of potential turning points in the market. The final smoothed combination signal aims to reduce noise and provide more reliable insights.
🔶Disclaimer:
Please note that this script is provided for informational and educational purposes only and should not be considered as financial advice.
Trading in financial markets involves risk, and past performance is not necessarily indicative of future results.
Users should conduct their own research and analysis or consult with a qualified financial advisor before making any investment decisions based on this indicator.
The creators of this script are not liable for any losses incurred from trading activities.
Bollinger bands / Connectable [Azullian]Deepen your understanding of market volatility using Bollinger Bands. This tool helps in discerning price movements and volatility trends, essential for crafting effective strategies.
This connectable Bollinger bands indicator is part of an indicator system designed to help test, visualize and build strategy configurations without coding. Like all connectable indicators , it interacts through the TradingView input source, which serves as a signal connector to link indicators to each other. All connectable indicators send signal weight to the next node in the system until it reaches either a connectable signal monitor, signal filter and/or strategy.
█ UNIFORM SETTINGS AND A WAY OF WORK
Although connectable indicators may have specific weight scoring conditions, they all aim to follow a standardized general approach to weight scoring settings, as outlined below.
■ Connectable indicators - Settings
• 🗲 Energy: Energy applies an ATR multiplier to the plotted shapes on the chart. A higher value plots shapes farther away from the candle, enhancing visibility.
• ☼ Brightness: Brightness determines the opacity of the shape plotted on the chart, aiding visibility. Indicator weight also influences opacity.
• → Input: Use the input setting to specify a data source for the indicator. Here you can connect the indicator to other indicators.
• ⌥ Flow: Determine where you want to receive signals from:
○ Both: Weights from this indicator and the connected indicator will apply
○ Indicator only: Only weights from this indicator will apply
○ Input only: Only weights from the connected indicator will apply
• ⥅ Weight multiplier: Multiply all weights in the entire indicator by a given factor, useful for quickly testing different indicators in a granular setup.
• ⥇ Threshold: Set a threshold to indicate the minimum amount of weight it should receive to pass it through to the next indicator.
• ⥱ Limiter: Set a hard limit to the maximum amount of weight that can be fed through the indicator.
■ Connectable indicators - Weight scoring settings
▢ Weight scoring conditions
• SM – Signal mode: Enable specific conditions for weight scoring
○ All: All signals will be scored.
○ Entries only: Only entries will score
○ Exits only: Only exits will score.
○ Entries & exits: Both entries and exits will score.
○ Zone: Continuous scoring for each candle within the zone.
• SP – Signal period: Defines a range of candles within which a signal can score.
• SC - Signal count: Specifies the number of bars to retrospectively examine and score.
○ Single: Score for a single occurrence
○ All occurrences: Score for all occurrences
○ Single + Threshold: Score for single occurrences within the signal period (SP)
○ Every + Threshold: Score for all occurrences within the signal period (SP)
▢ Weight scoring direction
• ES: Enter Short weight
• XL: Exit long weight
• EL: Enter Long weight
• XS: Exit Short weight
▢ Weight scoring values
• Weights can hold either positive or negative scores. Positive weights enhance a particular trading direction, while negative weights diminish it.
█ Bollinger bands - INDICATOR SETTINGS
■ Main settings
• Enable/Disable Indicator: Toggle the entire indicator on or off.
• S - Source: Choose an alternative data source for the Bollinger bands calculation.
• T - Timeframe: Select an alternative timeframe for the Bollinger bands calculation.
• LE - Length: Determine the period the bollinger bands are calculated on
• SD - Standard deviation: Determine the standard deviation for the bollinger bands.
• Enable/Disable plotting: Toggle the plotting of the Bollinger bands
• U: Choose a color for the upper band
• B: Choose a color for the basis
• L: Choose a color for the lower band
• BG: Choose a color for Bollinger bands background
■ Scoring functionality
• The Bollinger bands score long entries when the current low price is smaller than the lower band.
• The Bollinger bands score long exits when the current high price is higher than the upper band.
• The Bollinger bands score long zones the entire time the current low price is smaller than the lower band.
• The Bollinger bands score short entries when the current high is higher than the upper band.
• The Bollinger bands score short exits when the current low is smaller than the lower band.
• The Bollinger bands score short zones the entire time the current high price is higher than the upper band.
█ PLOTTING
• Standard: Symbols (EL, XS, ES, XL) appear relative to candles based on set conditions. Their opacity and position vary with weight.
• Conditional Settings: A larger icon appears if global conditions are met. For instance, with a Threshold(⥇) of 12, Signal Period (SP) of 3, and Scoring Condition (SC) set to "EVERY", a Bollinger bands signaling over two times in 3 candles (scoring 6 each) triggers a larger icon.
█ USAGE OF CONNECTABLE INDICATORS
■ Connectable chaining mechanism
Connectable indicators can be connected directly to the signal monitor, signal filter or strategy , or they can be daisy chained to each other while the last indicator in the chain connects to the signal monitor, signal filter or strategy. When using a signal filter you can chain the filter to the strategy input to make your chain complete.
• Direct chaining: Connect an indicator directly to the signal monitor, signal filter or strategy through the provided inputs (→).
• Daisy chaining: Connect indicators using the indicator input (→). The first in a daisy chain should have a flow (⌥) set to 'Indicator only'. Subsequent indicators use 'Both' to pass the previous weight. The final indicator connects to the signal monitor, signal filter, or strategy.
■ Set up this indicator with a signal filter and strategy
The indicator provides visual cues based on signal conditions. However, its weight system is best utilized when paired with a connectable signal filter, signal monitor, and/or strategy .
Let's connect the Bollinger bands to a connectable signal filter and a strategy :
1. Load all relevant indicators
• Load Bollinger bands / Connectable
• Load Signal filter / Connectable
• Load Strategy / Connectable
2. Signal Filter: Connect the Bollinger bands to the Signal Filter
• Open the signal filter settings
• Choose one of the three input dropdowns (1→, 2→, 3→) and choose : Bollinger bands / Connectable: Signal Connector
• Toggle the enable box before the connected input to enable the incoming signal
3. Signal Filter: Update the filter signals settings if needed
• The default settings of the filter enable EL (Enter Long), XL (Exit Long), ES (Enter Short) and XS (Exit Short).
4. Signal Filter: Update the weight threshold settings if needed
• All connectable indicators load by default with a score of 6 for each direction (EL, XL, ES, XS)
• By default, weight threshold (TH) is set at 5. This allows each occurrence to score, as the default score in each connectable indicator is 1 point above the threshold. Adjust to your liking.
5. Strategy: Connect the strategy to the signal filter in the strategy settings
• Select a strategy input → and select the Signal filter: Signal connector
6. Strategy: Enable filter compatible directions
• Set the signal mode of the strategy to a compatible direction with the signal filter.
Now that everything is connected, you'll notice green spikes in the signal filter representing long signals, and red spikes indicating short signals. Trades will also appear on the chart, complemented by a performance overview. Your journey is just beginning: delve into different scoring mechanisms, merge diverse connectable indicators, and craft unique chains. Instantly test your results and discover the potential of your configurations. Dive deep and enjoy the process!
█ BENEFITS
• Adaptable Modular Design: Arrange indicators in diverse structures via direct or daisy chaining, allowing tailored configurations to align with your analysis approach.
• Streamlined Backtesting: Simplify the iterative process of testing and adjusting combinations, facilitating a smoother exploration of potential setups.
• Intuitive Interface: Navigate TradingView with added ease. Integrate desired indicators, adjust settings, and establish alerts without delving into complex code.
• Signal Weight Precision: Leverage granular weight allocation among signals, offering a deeper layer of customization in strategy formulation.
• Advanced Signal Filtering: Define entry and exit conditions with more clarity, granting an added layer of strategy precision.
• Clear Visual Feedback: Distinct visual signals and cues enhance the readability of charts, promoting informed decision-making.
• Standardized Defaults: Indicators are equipped with universally recognized preset settings, ensuring consistency in initial setups across different types like momentum or volatility.
• Reliability: Our indicators are meticulously developed to prevent repainting. We strictly adhere to TradingView's coding conventions, ensuring our code is both performant and clean.
█ COMPATIBLE INDICATORS
Each indicator that incorporates our open-source 'azLibConnector' library and adheres to our conventions can be effortlessly integrated and used as detailed above.
For clarity and recognition within the TradingView platform, we append the suffix ' / Connectable' to every compatible indicator.
█ COMMON MISTAKES, CLARIFICATIONS AND TIPS
• Removing an indicator from a chain: Deleting a linked indicator and confirming the "remove study tree" alert will also remove all underlying indicators in the object tree. Before removing one, disconnect the adjacent indicators and move it to the object stack's bottom.
• Point systems: The azLibConnector provides 500 points for each direction (EL: Enter long, XL: Exit long, ES: Enter short, XS: Exit short) Remember this cap when devising a point structure.
• Flow misconfiguration: In daisy chains the first indicator should always have a flow (⌥) setting of 'indicator only' while other indicator should have a flow (⌥) setting of 'both'.
• Hide attributes: As connectable indicators send through quite some information you'll notice all the arguments are taking up some screenwidth and cause some visual clutter. You can disable arguments in Chart Settings / Status line.
• Layout and abbreviations: To maintain a consistent structure, we use abbreviations for each input. While this may initially seem complex, you'll quickly become familiar with them. Each abbreviation is also explained in the inline tooltips.
• Inputs: Connecting a connectable indicator directly to the strategy delivers the raw signal without a weight threshold, meaning every signal will trigger a trade.
█ A NOTE OF GRATITUDE
Through years of exploring TradingView and Pine Script, we've drawn immense inspiration from the community's knowledge and innovation. Thank you for being a constant source of motivation and insight.
█ RISK DISCLAIMER
Azullian's content, tools, scripts, articles, and educational offerings are presented purely for educational and informational uses. Please be aware that past performance should not be considered a predictor of future results.
Urika Trend StrengthThe Urika Directional Strength (UDS) indicator calculates and visualizes the strength of the directional trend in the price data. It helps traders see the strength and direction of the trend and allows them to make informed trading decisions based on trend changes.
Calculation:
The Simple Moving Average is used to determine the upper and lower directional bands by adding and subtracting the product of the standard deviation of the price data and the multiplier of the moving average.
Direction: The upward directional trend and downward directional trend are calculated by taking the absolute value of the difference between the price data and the upper and lower directional bands, divided by the product of the standard deviation and the multiplier.
Strength: It is calculated by taking the absolute value of the difference between the price data and the moving average, divided by the product of the standard deviation and the multiplier.
Interpretation:
Direction: The position of the long and short lines at the top indicates the direction of the ticker. Long line for long position and Short line for short position.
Strength: When the Strength line is below the directional lines, it is a weak trend or consolidating. If it stays in between the two directional lines, it is a strong trend.
TTP Intelligent AccumulatorThe intelligent accumulator is a proof of concept strategy. A hybrid between a recurring buy and TA-based entries and exits.
Distribute the amount of equity and add to your position as long as the TA condition is valid.
Use the exit TA condition to define your exit strategy.
Decide between adding only into losing positions to average down or take a riskier approach by allowing to add into a winning position as well.
Take full profit or distribute your exit into multiple take profit exists of the same size.
You can also decide if you allow your exit conditions to close your position in a loss or require a minimum take profit %.
The strategy includes a default built-in TA conditions just for showcasing the idea but the final intent of this script is to delegate the TA entries and exists to external sources.
The internal conditions use RSI length 7 crossing below the BB with std 1 for entries and above for exits.
To control the number of orders use the properties from settings:
- adjust the pyramiding
- adjust the percentage of equity
- make sure that pyramiding * % equity equals 100 to prevent over use of equity (unless using leverage)
The script is designed as an alternative to daily or weekly recurring buys but depending on the accuracy of your TA conditions it might prove profitable also in lower timeframes.
The reason the script is named Intelligent is because recurring buy is most commonly used without any decision making: buy no matter what with certain frequency. This strategy seeks to still perform recurring buys but filtering out some of the potential bad entries that can delay unnecessarily seeing the position in profits. The second reason is also securing an exit strategy from the beginning which no recurring buy option offers out-of-the-box.
BB + Volume Based Coloured BarsVolume Based Coloured Bars:
Most of the time traders are confused about if the price movements were supported by VOLUME .
This indicator colors the bars into volume weighted signals...
When prices go down bars are red and contraversely when up, bars are green. Additionally we have two more colors for each
situation:
PRICE BARS ARE:
DARK RED when prices go down and VOLUME is bigger than 150% of its (default 21 day) average, that indicates us price action is supported by a strong BEARISH VOLUME
RED when prices go down and VOLUME is BETWEEN 50% AND 150% of its (default 21 day) average, at this situation we can think that volume is neither strong nor weak
ORANGE when prices go down and VOLUME is just less than 50% of its (default 21 day) average, so the volume is weak and doesn't support the price action much
DARK GREEN when prices go UP and VOLUME bigger than 150% of its (default 21 day) average, that indicates us price action is supported by a strong BULLISH VOLUME
GREEN when prices go UP and VOLUME is BETWEEN 50% AND 150% of its (default 21 day) average, at this situation we can think that volume is neither strong nor weak
LIGHT GREEN when prices go UP and VOLUME is just less than 50% of its (default 21 day) average, so the volume is weak and doesn't support the price action much
21 day Simple Moving Average used as default value which can be changed in the settings menu,
21 day is considered as a month for STOCK Markets, it would be more accurate to set the value to 30 for CRYPTO CURRENCIES
And Bollinger bands
By Kıvanc Özbilgic thank you
QQE MOD + SSL Hybrid + Waddah Attar Explosion IndicatorINDICATOR PURPOSE
This indicator is designed to complement my original QQE MOD + SSL Hybrid + Waddah Attar Explosion strategy.
Multiple users have requested that I convert the strategy to an indicator because alertconditions do not work on strategies and people want to specific set alerts for BUY, SELL, CLOSE BUY and CLOSE SELL. This can only be achieved using alertcondition().
This indicator functions in the exact same way as the strategy, but it doesn't have any backtesting functionality. I recomment that you use the original QQE MOD + SSL Hybrid + Waddah Attar Explosion strategy for parameter tuning and backtesting, then if you need more control on alerts you can use this indicator for that purpose.
Only other difference is that I have added grey exit labels on the chart since it's not obvious where the exits would happen like it was in the strategy version.
CREDITS
QQE MOD byMihkel00
SSL Hybrid by Mihkel00
Waddah Attar Explosion by shayankm
Hedge Coin M - Statistical Support and ResistanceHedge Coin M - Statistical Support and Resistance
Introduction
"Hedge Coin M - Statistical Support and Resistance" is a sophisticated, statistically-driven indicator designed specifically for traders in the COIN-M market on Binance. It offers a nuanced approach to identifying key market levels, focusing on the dynamics of support and resistance through advanced volatility analysis.
Foundation and Credits:
This script is an advanced adaptation of TradingView's standard code for the Bollinger Bands indicator. It extends the foundational concept of Bollinger Bands by integrating additional volatility metrics.
Calculation Method
This indicator employs Volume Weighted Moving Averages (VWMA) to create two distinct sets of Bollinger Bands, named BB-a and BB-b.
BB-a is derived from the VWMA of high prices, targeting potential resistance levels.
BB-b is based on the VWMA of low prices, aimed at identifying critical support levels.
Users can independently adjust the standard deviation (SD) multipliers for the upper and lower bands of both BB-a and BB-b, accommodating different market conditions.
Enhanced Volatility Analysis
The indicator calculates additional standard deviation lines for the upper band of BB-a and the lower band of BB-b. These lines provide deeper insights into market volatility.
Plotted Graphs
The primary plots include the upper and lower bands of BB-a and BB-b, marked in distinct colors for clarity.
Additional SD lines are plotted to indicate potential extended levels of support and resistance, offering traders a broader view of possible market movements.
Purpose and Usage
"Hedge Coin M - Statistical Support and Resistance" is designed to provide traders with a consistent, statistical method for identifying significant price levels.
It aids in scaling entry into positions, helping traders to navigate the COIN-M market with more informed decision-making.
This tool is especially useful for traders who combine long-term holding with swing trading strategies, offering a balanced approach to market engagement.
Integration and Adaptation
Easily integrate this indicator into your TradingView chart for the COIN-M market.
Use the insights provided to complement your overall trading strategy, particularly in identifying and reacting to significant market movements.
Disclaimer
Important Note: This indicator is provided for informational purposes only. It does not constitute financial advice, investment advice, trading advice, or any other sort of advice. Trading decisions should be made based on your own analysis, prudence, and judgment. Please be aware of the risks involved in trading and consult a financial advisor if necessary.
Zero-lag Volatility-Breakout EMA Trend StrategyThis is a simple volatility-breakout strategy which uses the difference in two different zero-lag* EMAs (explained below on what exactly I mean by this) to track the upwards or downwards strength of an instrument. When the difference breaks above a Bollinger Band of a configurable standard deviation multiple, the strategy enters based off the direction of the base EMA used (i.e. if the difference breaks above and the current EMA is rising, a long entry is produced. If the difference breaks above and the current EMA is falling, a short entry is produced).
The two EMA-type metrics used to calculate the volatility difference are calculated by the following formula:
top_ema = math.max(src, ta.ema(src, length))
bottom_ema = math.min(src, ta.ema(src, length))
ema_difference = (top_ema - bottom_ema) - 1
This produces a difference which responds immediately to large price movements, instead of lagging if it used strictly the EMA itself.
SETTINGS
Source : The source of the strategy - close, hlc3, another indicator plot, etc.
EMA Difference Length : The length of both the EMA difference statistics and the base EMA used to calculate the entry side.
Standard Deviation Multiple : The Bollinger Bands multiple used when the difference is breaking out.
Use Binary Strategy : The strategy has two configurations: Binary and Rapid-Exit. 'Binary' means that it will not close a long position until a short position is generated, and vice-versa. 'Rapid-Exit' will close a long or short position once the difference reaches the middle Bollinger Band MA. This means that turning on 'Binary' will expose you to more market risk, but potentially greater market return. Turning off 'Binary' will exit quickly and reduce drawdown.
The strategy results below use 10% equity and 0.1% fees per trade.
Open Interest OscillatorIn the middle of a bustling cryptocurrency market, with Bitcoin navigating a critical phase and the community hype over potential ETF approvals, current funding rates, and market leverage, the timing is optimal to harness the capabilities of sophisticated trading tools.
Meet the Open Interest Oscillator – special indicator tailored for the volatile arena of cryptocurrency trading. This powerful instrument is adept at consolidating open interest data from a multitude of exchanges, delivering an in-depth snapshot of market sentiment across all timeframes, be it a 1-minute sprint or a weekly timeframe.
This versatile indicator is compatible with nearly all cryptocurrency pairs, offering an expansive lens through which traders can gauge the market's pulse.
Key Features:
-- Multi-exchange Data Aggregation: This feature taps into the heart of the crypto market by aggregating open interest data from premier exchanges such as BINANCE, BITMEX, BITFINEX, and KRAKEN. It goes a step further by integrating data from various pairs and stablecoins, thus providing traders with a rich, multi-dimensional view of market activities.
-- Open Interest Bars: Witness the flow of market dynamics through bars that depict the volume of positions being opened or closed, offering a clear visual cue of trading behavior. In this mode, If bars are going into negative zone, then traders are closing their positions. If they go into positive territory - leveraged positions are being opened.
-- Bollinger Band Integration: Incorporate a layer of statistical analysis with standard deviation calculations, which frame the open interest changes, giving traders a quantified edge to evaluate the market's volatility and momentum.
-- Oscillator with Customizable Thresholds: Personalize your trading signals by setting thresholds that resonate with your unique trading tactics. This customization brings the power of tailored analytics to your strategic arsenal.
-- Max OI Ceiling Setting: In the fast-paced crypto environment where data can surge to overwhelming levels, the Max OI Ceiling ensures you maintain a clear view by capping the open interest data, thus preserving the readability and interpretability of information, even when market activity reaches feverish heights.
Universal Volatility IndexThe Universal Volatility Index (UVI) is a robust indicator designed to gauge market volatility across various asset classes. By synthesizing multiple volatility measures, the UVI offers traders a nuanced understanding of market dynamics, aiding in the assessment of risk and the decision-making process.
How It Works:
The UVI incorporates three key components to calculate a composite volatility score:
Average True Range (ATR): This represents the average volatility over the specified period, giving a base measure of market movement.
Bollinger Bands Width: Highlights the expansion or contraction of price ranges, offering insights into market volatility relative to recent price action.
Rate of Change (ROC): Captures the momentum or the velocity of price changes, adding a temporal dimension to volatility assessment.
By combining these components, the UVI delivers a singular volatility metric that adapts to changing market conditions, providing a valuable tool for traders in any market.
Usage:
To apply the UVI to your chart, add the indicator from the Pine Script library and adjust the input parameters as desired.
The plot will display a line representing the composite volatility score, with higher values indicating increased market volatility and lower values suggesting calmer market conditions.
Benefits:
The UVI is versatile and can be applied to any market, making it a universal tool for traders.
The indicator helps in identifying periods of high risk where tighter risk management may be warranted.
It assists in pinpointing potential breakouts when volatility is expanding after a period of consolidation.
Compliance with TradingView House Rules:
This script is provided for educational purposes and does not constitute financial advice. It has been created to contribute to the TradingView community by offering a versatile tool that helps traders understand and navigate market volatility.
Best scalping toolExplanation:
This script is a comprehensive indicator that combines three essential technical analysis tools: Money Flow Index (MFI), Relative Strength Index (RSI), and Bollinger Bands (Bollinger %B). It provides insights into market conditions related to cross points of mfi,rsi and B%B.
A buy condition is created when the last candle RSI and MFI are under the bollinger bands, and then in the actual candle the RSI cross up the bollinger low band.
A sell condition is created when the last candle RSI and MFI are above the bollinger bands, and then in the actual candle the RSI cross down the bollinger high band.
Key Components:
MFI (Money Flow Index):
Utilizes the MFI indicator based on a specified length.
Overbought and oversold levels (80 and 20, respectively).
RSI (Relative Strength Index): (Adapted to the mfi chart)
Allows selection of different moving average types (SMA, EMA, etc.) for the RSI calculation.
RSI along with upper and lower bands (70 and 30).
Bollinger Bands:
Provides upper and lower Bollinger Bands based on the RSI's standard deviation.
Visualization Options:
Allows the user to choose between show the buy (green arrow) and the sell (red arrow) .
How It Works:
The indicator amalgamates these three powerful technical indicators to help traders identify potential entry or exit points. The green arrow its a buy signal and the red arrow is a sell signal.
By offering configurable settings and clear visual cues, this indicator assists traders in recognizing critical market conditions and potential trading opportunities.
Disclaimer: This indicator should be used as a tool in a broader trading strategy and not solely for making trading decisions. It's recommended to combine it with other technical or fundamental analysis for comprehensive trading decisions.
Fibonacci Bollinger Volume Weighted DeviationDiscover market dynamics with the 'Fibonacci Bollinger Volume Weighted Deviation' indicator – a unique tool blending Fibonacci ratios, Bollinger Bands, and volume-weighted analysis. Ideal for spotting overbought/oversold conditions and potential market turnarounds, this indicator is a must-have for traders seeking nuanced insights into price behavior and volatility.
Description:
"The 'Fibonacci Bollinger Volume Weighted Deviation' indicator presents a novel approach to market trend analysis by integrating Fibonacci ratios with the classic concept of Bollinger Bands. Designed for traders who incorporate Fibonacci levels in their market analysis, this indicator adapts Bollinger Bands to a user-defined Fibonacci ratio. It creates dynamic upper and lower bands around a Simple Moving Average (SMA), offering insights into price deviations and potential overbought or oversold market states.
Incorporating volume data, this indicator provides a volume-weighted perspective of price deviations. This feature is crucial in gauging the market sentiment, as significant volumes linked with price deviations can signal strong market moves. By plotting these deviations and emphasizing those that significantly diverge from the volume-weighted average, it aids in pinpointing potential turning points or key support and resistance zones.
Versatile in nature, the 'Fibonacci Bollinger Volume Weighted Deviation' indicator is adaptable to various trading styles and market conditions. It proves especially valuable in markets where Fibonacci levels are a key factor. Traders can explore long positions when prices fall below the lower band and consider short positions when prices breach the upper band. The addition of volume-weighted deviation analysis refines these trading signals, offering a more sophisticated and nuanced decision-making process for entries and exits.
As a standalone tool or in conjunction with other technical instruments, this indicator is an invaluable addition to any technical analyst's toolkit. It not only enhances traditional Fibonacci and Bollinger Band methodologies but also integrates volume analysis to provide a comprehensive view of market trends and movements."
Fibonacci Enhanced Bollinger BandsDiscover the synergistic power of Fibonacci ratios with traditional Bollinger Bands in the 'Fibonacci Enhanced Bollinger Bands' indicator. Ideal for traders seeking dynamic price levels for strategic entries and exits, this tool adds a unique Fibonacci twist to your technical analysis toolkit.
Introduction to Fibonacci Enhanced Bollinger Bands
'Fibonacci Enhanced Bollinger Bands' is a trading indicator that combines the classic Bollinger Bands approach with the powerful insights of Fibonacci ratios. By integrating these two concepts, this indicator offers traders a unique perspective on market volatility and potential support/resistance levels.
How It Works
Core Concept : The indicator calculates Bollinger Bands using a selected Fibonacci ratio. This ratio is applied to the standard deviation of the price series, providing a dynamic range around a Simple Moving Average (SMA).
Trading Strategies
Long Opportunities : The area below the lower band can be considered a potential zone for long positions. Prices in this zone may indicate an oversold market condition, suggesting a possible reversal or pullback.
Short Opportunities : Conversely, the area above the upper band might signal short-selling opportunities. Prices in this region could imply an overbought scenario, potentially leading to a price decline.
Versatility : Whether you're a day trader, swing trader, or long-term investor, this indicator adapts to various timeframes and assets, making it a versatile tool in your trading arsenal.
Conclusion
The 'Fibonacci Enhanced Bollinger Bands' indicator is designed for traders who wish to leverage the power of Fibonacci ratios in conjunction with the volatility insights provided by Bollinger Bands. It's an excellent tool for identifying potential reversal zones and refining entry and exit points. Try it out to enhance your market analysis and support your trading decisions with the combined wisdom of Fibonacci and Bollinger Bands.
Logarithmic Bollinger Bands [MisterMoTA]The script plot the normal top and bottom Bollinger Bands and from them and SMA 20 it finds fibonacci logarithmic levels where price can find temporary support/resistance.
To get the best results need to change the standard deviation to your simbol value, like current for BTC the Standards Deviation is 2.61, current Standard Deviation for ETH is 2.55.. etc.. find the right current standard deviation of your simbol with a search online.
The lines ploted by indicators are:
Main line is a 20 SMA
2 retracement Logarithmic Fibonacci 0.382 levels above and bellow 20 sma
2 retracement Logarithmic Fibonacci 0.618 levels above and bellow 20 sma
Top and Bottom Bollindger bands (ticker than the rest of the lines)
2 expansion Logarithmic Fibonacci 0.382 levels above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci 0.618 levels above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci level 1 above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci 1.618 levels above Top BB and bellow Bottom BB
Let me know If you find the indicator useful or PM if you need any custom changes to it.
Optimal Length BackTester [YinYangAlgorithms]This Indicator allows for a ‘Optimal Length’ to be inputted within the Settings as a Source. Unlike most Indicators and/or Strategies that rely on either Static Lengths or Internal calculations for the length, this Indicator relies on the Length being derived from an external Indicator in the form of a Source Input.
This may not sound like much, but this application may allows limitless implementations of such an idea. By allowing the input of a Length within a Source Setting you may have an ‘Optimal Length’ that adjusts automatically without the need for manual intervention. This may allow for Traditional and Non-Traditional Indicators and/or Strategies to allow modifications within their settings as well to accommodate the idea of this ‘Optimal Length’ model to create an Indicator and/or Strategy that adjusts its length based on the top performing Length within the current Market Conditions.
This specific Indicator aims to allow backtesting with an ‘Optimal Length’ inputted as a ‘Source’ within the Settings.
This ‘Optimal Length’ may be used to display and potentially optimize multiple different Traditional Indicators within this BackTester. The following Traditional Indicators are included and available to be backtested with an ‘Optimal Length’ inputted as a Source in the Settings:
Moving Average; expressed as either a: Simple Moving Average, Exponential Moving Average or Volume Weighted Moving Average
Bollinger Bands; expressed based on the Moving Average Type
Donchian Channels; expressed based on the Moving Average Type
Envelopes; expressed based on the Moving Average Type
Envelopes Adjusted; expressed based on the Moving Average Type
All of these Traditional Indicators likewise may be displayed with multiple ‘Optimal Lengths’. They have the ability for multiple different ‘Optimal Lengths’ to be inputted and displayed, such as:
Fast Optimal Length
Slow Optimal Length
Neutral Optimal Length
By allowing for the input of multiple different ‘Optimal Lengths’ we may express the ‘Optimal Movement’ of such an expressed Indicator based on different Time Frames and potentially also movement based on Fast, Slow and Neutral (Inclusive) Lengths.
This in general is a simple Indicator that simply allows for the input of multiple different varieties of ‘Optimal Lengths’ to be displayed in different ways using Tradition Indicators. However, the idea and model of accepting a Length as a Source is unique and may be adopted in many different forms and endless ideas.
Tutorial:
You may add an ‘Optimal Length’ within the Settings as a ‘Source’ as followed in the example above. This Indicator allows for the input of a:
Neutral ‘Optimal Length’
Fast ‘Optimal Length’
Slow ‘Optimal Length’
It is important to account for all three as they generally encompass different min/max length values and therefore result in varying ‘Optimal Length’s’.
For instance, say you’re calculating the ‘Optimal Length’ and you use:
Min: 1
Max: 400
This would therefore be scanning for 400 (inclusive) lengths.
As a general way of calculating you may assume the following for which lengths are being used within an ‘Optimal Length’ calculation:
Fast: 1 - 199
Slow: 200 - 400
Neutral: 1 - 400
This allows for the calculation of a Fast and Slow length within the predetermined lengths allotted. However, it likewise allows for a Neutral length which is inclusive to all lengths alloted and may be deemed the ‘Most Accurate’ for these reasons. However, just because the Neutral is inclusive to all lengths, doesn’t mean the Fast and Slow lengths are irrelevant. The Fast and Slow length inputs may be useful for seeing how specifically zoned lengths may fair, and likewise when they cross over and/or under the Neutral ‘Optimal Length’.
This Indicator features the ability to display multiple different types of Traditional Indicators within the ‘Display Type’.
We will go over all of the different ‘Display Types’ with examples on how using a Fast, Slow and Neutral length would impact it:
Simple Moving Average:
In this example above have the Fast, Slow and Neutral Optimal Length formatted as a Slow Moving Average. The first example is on the 15 minute Time Frame and the second is on the 1 Day Time Frame, demonstrating how the length changes based on the Time Frame and the effects it may have.
Here we can see that by inputting ‘Optimal Lengths’ as a Simple Moving Average we may see moving averages that change over time with their ‘Optimal Lengths’. These lengths may help identify Support and/or Resistance locations. By using an 'Optimal Length' rather than a static length, we may create a Moving Average which may be more accurate as it attempts to be adaptive to current Market Conditions.
Bollinger Bands:
Bollinger Bands are a way to see a Simple Moving Average (SMA) that then uses Standard Deviation to identify how much deviation has occurred. This Deviation is then Added and Subtracted from the SMA to create the Bollinger Bands which help Identify possible movement zones that are ‘within range’. This may mean that the price may face Support / Resistance when it reaches the Outer / Inner bounds of the Bollinger Bands. Likewise, it may mean the Price is ‘Overbought’ when outside and above or ‘Underbought’ when outside and below the Bollinger Bands.
By applying All 3 different types of Optimal Lengths towards a Traditional Bollinger Band calculation we may hope to see different ranges of Bollinger Bands and how different lookback lengths may imply possible movement ranges on both a Short Term, Long Term and Neutral perspective. By seeing these possible ranges you may have the ability to identify more levels of Support and Resistance over different lengths and Trading Styles.
Donchian Channels:
Above you’ll see two examples of Machine Learning: Optimal Length applied to Donchian Channels. These are displayed with both the 15 Minute Time Frame and the 1 Day Time Frame.
Donchian Channels are a way of seeing potential Support and Resistance within a given lookback length. They are a way of withholding the High’s and Low’s of a specific lookback length and looking for deviation within this length. By applying a Fast, Slow and Neutral Machine Learning: Optimal Length to these Donchian Channels way may hope to achieve a viable range of High’s and Low’s that one may use to Identify Support and Resistance locations for different ranges of Optimal Lengths and likewise potentially different Trading Strategies.
Envelopes / Envelopes Adjusted:
Envelopes are an interesting one in the sense that they both may be perceived as useful; however we deem that with the use of an ‘Optimal Length’ that the ‘Envelopes Adjusted’ may work best. We will start with examples of the Traditional Envelope then showcase the Adjusted version.
Envelopes:
As you may see, a Traditional form of Envelopes even produced with a Machine Learning: Optimal Length may not produce optimal results. Unfortunately this may occur with some Traditional Indicators and they may need some adjustments as you’ll notice with the ‘Envelopes Adjusted’ version. However, even without the adjustments, these Envelopes may be useful for seeing ‘Overbought’ and ‘Oversold’ locations within a Machine Learning: Optimal Length standpoint.
Envelopes Adjusted:
By adding an adjustment to these Envelopes, we may hope to better reflect our Optimal Length within it. This is caused by adding a ratio reflection towards the current length of the Optimal Length and the max Length used. This allows for the Fast and Neutral (and potentially Slow if Neutral is greater) to achieve a potentially more accurate result.
Envelopes, much like Bollinger Bands are a way of seeing potential movement zones along with potential Support and Resistance. However, unlike Bollinger Bands which are based on Standard Deviation, Envelopes are based on percentages +/- from the Simple Moving Average.
We will conclude our Tutorial here. Hopefully this has given you some insight into how useful adding a ‘Optimal Length’ within an external (secondary) Indicator as a Source within the Settings may be. Likewise, how useful it may be for automation sake in the sense that when the ‘Optimal Length’ changes, it doesn’t rely on an alert where you need to manually update it yourself; instead it will update Automatically and you may reap the benefits of such with little manual input needed (aside from the initial setup).
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Bollinger Bands StrategyBollinger Bands Strategy :
INTRODUCTION :
This strategy is based on the famous Bollinger Bands. These are constructed using a standard moving average (SMA) and the standard deviation of past prices. The theory goes that 90% of the time, the price is contained between these two bands. If it were to break out, this would mean either a reversal or a continuation. However, when a reversal occurs, the movement is weak, whereas when a continuation occurs, the movement is substantial and profits can be interesting. We're going to use BB to take advantage of this strong upcoming movement, while managing our risks reasonably. There's also a money management method for reinvesting part of the profits or reducing the size of orders in the event of substantial losses.
BOLLINGER BANDS :
The construction of Bollinger bands is straightforward. First, plot the SMA of the price, with a length specified by the user. Then calculate the standard deviation to measure price dispersion in relation to the mean, using this formula :
stdv = (((P1 - avg)^2 + (P2 - avg)^2 + ... + (Pn - avg)^2) / n)^1/2
To plot the two Bollinger bands, we then add a user-defined number of standard deviations to the initial SMA. The default is to add 2. The result is :
Upper_band = SMA + 2*stdv
Lower_band = SMA - 2*stdv
When the price leaves this channel defined by the bands, we obtain buy and sell signals.
PARAMETERS :
BB Length : This is the length of the Bollinger Bands, i.e. the length of the SMA used to plot the bands, and the length of the price series used to calculate the standard deviation. The default is 120.
Standard Deviation Multipler : adds or subtracts this number of times the standard deviation from the initial SMA. Default is 2.
SMA Exit Signal Length : Exit signals for winning and losing trades are triggered by another SMA. This parameter defines the length of this SMA. The default is 110.
Max Risk per trade (in %) : It's the maximum percentage the user can lose in one trade. The default is 6%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:BTCUSD in 8h timeframe with the following parameters :
BB Length = 120
Standard Deviation Multipler = 2
SMA Exit Signal Length = 110
Max Risk per trade (in %) = 6%
ENTER RULES :
The entry rules are simple:
If close > Upper_band it's a LONG signal
If close < Lower_band it's a SHORT signal
EXIT RULES :
If we are LONG and close < SMA_EXIT, position is closed
If we are SHORT and close > SMA_EXIT, the position is closed
Positions close automatically if they lose more than 6% to limit risk
RISK MANAGEMENT :
This strategy is subject to losses. We manage our risk using the exit SMA or using a SL sets to 6%. This SMA gives us exit signals when the price closes below or above, thus limiting losses. If the signal arrives too late, the position is closed after a loss of 6%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the fixed ratio value, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 8h, this strategy is a medium/long-term strategy. That's why only 51 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)