VCC SmtmWorks better for Cryptos (1W and greater than) timeframes.
This strategy incorporates multiple indicators to make informed trading signals. It leverages the Stochastic indicator to assess price momentum, utilizes the Bollinger Band to identify potential oversold and overbought conditions, and closely monitors Moving Averages to gauge the trend's bullish or bearish nature.
A long signal will be displayed if the following conditions are met:
The Stochastic D and Stochastic K both indicate an oversold condition, with Stochastic K being lower than Stochastic D.
The current Price Low is below the Bollinger Lower Band.
The Price Close is currently below all Moving Averages.
A Death Cross pattern has formed among the Moving Averages.
A short signal will be displayed if the opposite of the long conditions are true:
The Stochastic D and Stochastic K both indicate an overbought condition, with Stochastic K being higher than Stochastic D.
The current Price High is above the Bollinger Upper Band.
The Price Close is currently above all Moving Averages.
A Golden Cross pattern has formed among the Moving Averages.
Bandas e Canais
Shifted EMAsJa verschobene EMAS halt lol.
Oder wie ChatGPT sagen würde:
The "Shifted EMAs" indicator on TradingView is a customizable tool that displays three Exponential Moving Averages (EMAs) on the chart. Users can adjust the EMA lengths and apply vertical shifts to the EMAs, enabling flexible analysis of trends and potential support/resistance levels. Each EMA is represented with distinct colors for easy differentiation, providing traders with valuable insights into price movements and aiding in making well-informed trading decisions.
[blackcat] L1 Stella Osoba Donchian ChannelsLevel 1
Background
On Jul, 2023, Stella Osoba proposed a price channel idea in the article of “Using Price Channels”.
Function
In Stella Osoba's article "Using Price Channels" in the 2023 bonus issue, author Stella Osoba describes why many analysis techniques are based on the concept of price channels. In her explanation of the Donchian channels, she explains that they are used to identify the trend and that the prices for the last period are not included in the calculations. I rewrote this idea in the PINE version presented here, allowing the user to optionally include the most recent period. To not include the most recent period, set the IncludeRecentPeriod input to false.
Richard Donchian, a futures trader, created the Donchian Channel as a trend indicator. He was later dubbed the "father of trend following." Several trading methods based on Donchian channels have been established, but day traders can create their own as the indicator is versatile and can be interpreted in different ways. The renowned Turtle Traders also used a variation of the Donchian technique.
The Donchian Channel draws a line between the high and low price of an asset over a period of time, generally using candlesticks as a clock. Candlesticks are chart areas on charts that show the open, high, low, and close price and time frame of a particular stock. They owe their name to their shape. When the indicator is applied to a chart, the lines form a channel around the current price.
When day trading, Donchian channels are useful for highlighting trends and range periods. A third line can be added between the top and bottom lines if required. The upper and lower channel lines are averaged to form this center band. The indicator can be used on all timeframes, including one-minute and five-minute charts (where a bar forms every one or five minutes), and it can be used for forex, stock, futures, and options trading .
Remarks
Feedbacks are appreciated.
DBMA - Dual Bollinger Moving AverageThe Dual Bollinger moving average (DBMA) consists of a moving average (MA) & two Bollinger Bands (BB), with the color of the bands representing the level of price compression. In its default settings, it is a 20-day simple moving average with 2 upper Bollinger Bands, having the standard deviation (SD) settings of 0.5 & 1, respectively.
How close the price is to the moving average?
For a pullback trader, the entry point should be close to the moving average, preferably with price compression. How close should it be, is where the bands serve as a guide. The low of the pullback candle should be within the bands, that is, at least within the far band (1 SD of the MA), or even better if it's within the near band (0.5 SD). When the price is outside the bands, it should not be considered favourable for a pullback entry.
For how long has the price been closer to the moving average?
John Carter’s TTM Squeeze indicator looked at the relationship between Bollinger Bands and Keltner's Channels to help identify period of volatility contractions. Bollinger Bands being completely enclosed within the Keltner Channels is indicative of a very low volatility. This is a state of volatility contraction known as squeeze. Using different ATR lengths (1.0, 1.5 and 2.0) for Keltner Channels, we can differentiate between levels of squeeze (High, Mid & Low compression, respectively). Greater the compression, higher the potential for explosive moves.
The squeeze portion of the script is based on LazyBear's script ( Squeeze Momentum Indicator )
The High, Mid & Low compression squeezes are depicted via the color of the bands being red, orange, or yellow, respectively. With the low of the pullback candle within the bands, & the squeeze color changing to red, it should be considered favourable for a pullback entry.
Trailing the price with the lower bands
The lower bands can be used for trailing with the moving average. While trailing, once the price closes below the moving average, the trailing stoploss (TSL) is said to be triggered, & the trade is exited. Here we use the bands to give it some cushion. Let the price close below the 1SD band for labelling the TSL as being triggered to exit the trade. If the price closes below the MA but is still within the bands, the signal is to keep holding the trade.
Bars Above/Below Donchian Channel [ScalpTradr]"Bars Above/Below Donchian Channel" provides a visualization of the Donchian Channel and measures the number of bars above and below the middle line of the channel.
The Donchian Channel is a trading indicator that outlines the highest high and the lowest low over a defined number of periods, in this case set by the variable "length". This indicator script specifically also calculates the 'basis', which is the average of the upper and lower channels of the Donchian Channel.
When the closing price of a bar is above the 'basis', the script increases a counter for "aboveCount" and adds a label on the chart to show how many bars have closed above the 'basis'. This label is green and it's always placed at the high price of the bar. Conversely, when the closing price is below the 'basis', it increases a counter for "belowCount" and adds a red label on the chart to show how many bars have closed below the 'basis'. This label is placed at the lower_channel level.
This script can be useful for traders who use the Donchian Channel as a part of their trading strategy. The number of bars closing above or below the 'basis' can provide insights into the ongoing trend. A higher count of bars closing above the 'basis' can be interpreted as a bullish signal, suggesting an upward trend. Similarly, a higher count of bars closing below the 'basis' can be interpreted as a bearish signal, suggesting a downward trend
I hope you find this indicator useful.
Enjoy.
TTP QFL OptimiserThis tool is designed to help finding the best take profit and stop loss levels when trading with QFL bases (Quick Fingers Luc).
You can use it to see the average drawdown among all historic bases broken for an asset and then find the drawdowns that are more frequent using the percentile parameters provided.
For example, by knowing that 98% of the bases got broken with a drawdown of up to 5% can become extremely useful for deciding where to place your take profit or stop loss levels.
It supports QFL 1H, 2H and 4H but make sure to set the chart timeframe to a lower timeframe than QFL to obtain valid results.
Two percentiles are provided to be able to evaluate potential TP and SL at the same time.
Steps:
- Load an asset in the 15min TF
- Select the QFL version: 1H more deals / lower quality vs 4H less deals/ better quality
- Find a percentile that triggers enough deals (example: 70) and then another percentile that doesn't get hit too much (example: 98)
- Confirm the values p1 and p2 provided in the table and the white and grey lines for the results of which drawdown percentages correspond to such selection of percentiles
Once having p1 and p2 use your backtesting and forward testing tools to confirm and adjust accordingly.
MACDh with divergences & impulse system (overlayed on prices)-----------------------------------------------------------------
General Description:
This indicator ( the one on the top panel above ) consists on some lines, arrows and labels drawn over the price bars/candles indicating the detection of regular divergences between price and the classic MACD histogram (shown on the low panel). This script is special because it can be adjusted to fit several criteria when trading divergences filtering them according to the "height" and "width" of the patterns. The script also includes the "extra features" Impulse System and Keltner Channels, which you will hardly find anywhere else in similar classic MACD histogram divergence indicators.
The indicator helps to find trend reversals, and it works on any market, any instrument, any timeframe, and any market condition (except against really strong trends that do not show any other sign of reversion yet).
Please take on consideration that divergences should be taken with caution.
-----------------------------------------------------------------
Definition of classic Bullish and Bearish divergences:
* Bearish divergences occur in uptrends identifying market tops. A classical or regular bearish divergence occurs when prices reach a new high and then pull back, with an oscillator (MACD histogram in this case) dropping below its zero line. Prices stabilize and rally to a higher high, but the oscillator reaches a lower peak than it did on a previous rally.
In the chart above (weekly charts of NKE, Nike, Inc.), in area X (around August 2021), NKE rallied to a new bull market high and MACD-Histogram rallied with it, rising above its previous peak and showing that bulls were extremely strong. In area Y, MACD-H fell below its centerline and at the same time prices punched below the zone between the two moving averages. In area Z, NKE rallied to a new bull market high, but the rally of MACD-H was feeble, reflecting the bulls’ weakness. Its downtick from peak Z completed a bearish divergence, giving a strong sell signal and auguring a nasty bear market.
* Bullish divergences , in the other hand, occur towards the ends of downtrends identifying market bottoms. A classical (also called regular) bullish divergence occurs when prices and an oscillator (MACD histogram in this case) both fall to a new low, rally, with the oscillator rising above its zero line, then both fall again. This time, prices drop to a lower low, but the oscillator traces a higher bottom than during its previous decline.
In the example in the chart above (weekly charts of NKE, Nike, Inc.), you see a bearish divergence that signaled the October 2022 bear market bottom, giving a strong buy signal right near the lows. In area A, NKE (weekly charts) appeared in a free fall. The record low A of MACD-H indicated that bears were extremely strong. In area B, MACD-H rallied above its centerline. Notice the brief rally of prices at that moment. In area C, NKE slid to a new bear market low, but MACD-H traced a much more shallow low. Its uptick completed a bullish divergence, giving a strong buy signal.
-----------------------------------------------------------------
Some cool features included in this indicator:
1. This indicator also includes the “ Impulse System ”. The Impulse System is based on two indicators, a 13-day exponential moving average and the MACD-Histogram, and identifies inflection points where a trend speeds up or slows down. The moving average identifies the trend, while the MACD-Histogram measures momentum. This unique indicator combination is color coded into the price bars for easy reference.
Calculation:
Green Price Bar: (13-period EMA > previous 13-period EMA) and
(MACD-Histogram > previous period's MACD-Histogram)
Red Price Bar: (13-period EMA < previous 13-period EMA) and
(MACD-Histogram < previous period's MACD-Histogram)
Price bars are colored blue when conditions for a Red Price Bar or Green Price Bar are not met. The MACD-Histogram is based on MACD(12,26,9).
The Impulse System works more like a censorship system. Green price bars show that the bulls are in control of both trend and momentum as both the 13-day EMA and MACD-Histogram are rising (you don't have permission to sell). A red price bar indicates that the bears have taken control because the 13-day EMA and MACD Histogram are falling (you don't have permission to buy). A blue price bar indicates mixed technical signals, with neither buying nor selling pressure predominating (either both buying or selling are permitted).
2. Another "extra feature" included here is the " Keltner Channels ". Keltner Channels are volatility-based envelopes set above and below an exponential moving average.
3. It were also included a couple of EMAs.
Everything can be removed from the chart any time.
-----------------------------------------------------------------
Options/adjustments for this indicator:
*Horizontal Distance (width) between two tops/bottoms criteria.
Refers to the horizontal distance between the MACH histogram peaks involved in the divergence
*Height of tops/bottoms criteria (for Histogram).
Refers to the difference/relation/vertical distance between the MACH HISTOGRAM peaks involved in the divergence: 1st Histogram Peak is X times the 2nd.
*Height/Vertical deviation of tops/bottoms criteria (for Price).
Deviation refers to the difference/relation/vertical distance between the PRICE peaks involved in the divergence.
*Plot Regular Bullish Divergences?.
*Plot Regular Bearish Divergences?.
*Delete Previous Cancelled Divergences?.
*Shows a pair of EMAs.
*Shows Keltner Channels (using ATR)
Keltner Channels are volatility-based envelopes set above and below an exponential moving average.
*This indicator also has the option to show the Impulse System over the price bars/candles.
Stablecoin Market Cap RiskThe Stablecoins Market Cap Risk indicator serves as a valuable risk oscillator for Bitcoin on a macro scale . This metric is derived by aggregating the market capitalization of CRYPTOCAP:USDT (Tether) and CRYPTOCAP:USDC (USD Coin), subsequently dividing this combined value by CRYPTOCAP:TOTAL (total market capitalization). The resulting figure is further normalized through linear regression.
The regression in question:
drive.google.com
However, it is essential to acknowledge that this model's reliability may diminish over time, as it is based solely on data from the most recent 4.5 years of cryptocurrency market trends. Consequently, adaptations and enhancements to the model are anticipated in the future to ensure its continued relevance and accuracy.
EMA Power BandsHello!
Today, I am delighted to introduce you to the "EMA Power Bands" indicator, designed to assist in identifying buying and selling points for assets moving in the markets.
Key Features of the Indicator:
EMA Bands: "EMA Power Bands" utilizes Exponential Moving Average (EMA) to create trend lines. These bands automatically expand or contract based on the price trend, adapting to market conditions.
ATR-Based Volatility: The indicator measures price volatility using the Average True Range (ATR) indicator, adjusting the width of the EMA bands accordingly. As a result, wider bands form during periods of increased volatility, while they narrow during lower volatility.
RSI-Based Buy-Sell Signals: "EMA Power Bands" uses the Relative Strength Index (RSI) to identify overbought and oversold zones. Entering the overbought zone generates a sell signal, while entering the oversold zone produces a buy signal.
Trend Direction Identification: The indicator assists in determining the price trend direction by analyzing the slope of the EMA bands. This allows you to identify periods of uptrends and downtrends.
Visualization of Buy-Sell Signals: "EMA Power Bands" visually marks the buy and sell signals:
- When RSI enters the overbought zone, it displays a sell signal (🪫).
- When RSI enters the oversold zone, it indicates a buy signal (🔋).
- When a candle closes above the emaup line, it displays a bearish signal (🔨).
- When a candle closes below the emadw line, it indicates a bullish signal (🚀).
By using the "EMA Power Bands" (EMA Güç Bantları) indicator, especially in trend-following strategies and periods of volatility, you can make more informed and disciplined trading decisions. However, I recommend using it in conjunction with other technical analysis tools and fundamental data.
*You can also use it with CCI as an example.
With this indicator, you can identify potential trend reversals in advance and strengthen your risk management strategies.
So, go ahead and try the "EMA Power Bands" (EMA Güç Bantları) indicator to enhance your technical analysis skills and make more informed trading decisions!
Liquidation Ranges + Volume/OI Dots [Kioseff Trading]Hello!
Introducing a multi-faceted indicator "Liquidation Ranges + Volume Dots" - this indicator replicates the volume dot tools found on various charting platforms and populates a liquidation range on crypto assets!
Features
Volume/OI dots populated according to user settings
Size of volume/OI dots corresponds to degree of abnormality
Naked level volume dots
Fixed range capabilities for volume/OI dots
Visible time range capabilities for volume/OI dots
Lower timeframe data used to discover iceberg orders (estimated using 1-minute data)
S/R lines drawn at high volume/OI areas
Liquidation ranges for crypto assets (10x - 100x)
Liquidation ranges are calculated using a popular crypto exchange's method
# of violations of liquidation ranges are recorded and presented in table
Pertinent high volume/OI price areas are recorded and presented in table
Personalized coloring for volume/OI dots
Net shorts / net long for the price range recorded
Lines shows reflecting net short & net long increases/decreases
Configurable volume/OI heatmap (displayed between liquidation ranges)
And some more (:
Liquidation Range
The liquidation range component of the indicator uses a popular crypto exchange's calculation (for liquidation ranges) to populate the chart for where 10x - 100x leverage orders are stopped out.
The image above depicts features corresponding to net shorts and net longs.
The image above shows features corresponding to liquidation zones for the underlying coin.
The image above shows the option to display volume/oi delta at the time the corresponding grid was traded at.
The image above shows an instance of using the "fixed range" feature for the script.
*The average price of the range is calculated to project liquidation zones.
*Heatmap is calculated using OI (or volume) delta.
Huge thank you to Pine Wizard @DonovanWall for his range filter code!
Price ranges are automatically detected using his calculation (:
Volume / OI Dots
Similar to other charting platforms, the volume/OI dots component of the indicator distinguishes "abnormal" changes in volume/OI; the detected price area is subsequently identified on the chart.
The detection method uses percent rank and calculates on the last bar of the chart. The "agelessness" of detection is contingent on user settings.
The image above shows volume dots in action; the size of each volume dot corresponds to the amount of volume at the price area.
Smaller dots = lower volume
Larger dots = higher volume
The image above exemplifies the highest aggression setting for volume/OI dot detection.
The table oriented top-right shows the highest volume areas (discovered on the 1-minute chart) for the calculated period.
The open interest change and corresponding price level are also shown. Results are listed in descending order but can also be listed in order of occurrence (most relevant).
Additionally, you can use the visible time range feature to detect volume dots.
The feature shows and explains how the visible range feature works. You select how many levels you want to detect and the script will detect the selected number of levels.
For instance, if I select to show 20 levels, the script will find the 20 highest volume/OI change price areas and distinguish them.
The image above shows a narrower price range.
The image above shows the same price range; however, the script is detecting the highest OI change price areas instead of volume.
* You can also set a fixed range with this feature
* Naked levels can be used
Additionally, you can select for the script to show only the highest volume/ OI change price area for each bar. When active, the script will successively identify the highest volume / OI change price area for the most recent bars.
Naked Levels
The image above shows and explains how naked levels can be detected when using the script.
And that's pretty much it!
Of course, there're a few more features you can check out when you use the script that haven't been explained here (:
Thank you again to @DonovanWall
Thank you to @Trendoscope for his binary insertion sort library (:
Thank you to @PineCoders for their time library
Thank you for checking this out!
Adaptive Price Channel (log scale)The field of technical analysis is consistently expanding, with numerous indicators used for market forecasting. Amongst them, a novel indicator dubbed the Adaptive Price Channel (log scale), inspired by the renowned Nadaraya-Watson Envelope (LuxAlgo) from LuxAlgo, is gaining traction for its distinctive features and versatility. Unlike its predecessor, the Adaptive Price Channel (log scale) is applicable on a logarithmic scale, thereby allowing it to be utilized on both smaller and larger timeframes.
1. Key Features
The Adaptive Price Channel (log scale) is founded on the trading view Pinescript language, version 5, with its primary aim to maximize the versatility and scalability of trading indicators. It allows traders to adapt it according to their preferred timeframe, thereby making it applicable for a wide range of trading strategies.
Its bandwidth can be adjusted through the input parameters, offering traders the flexibility to manipulate the indicator according to their strategic requirements. Furthermore, it provides an option for repainting smoothing. This option enables users to control the repainting effect in which the historical output of the indicator may change over time. When disabled, the indicator provides the endpoints of the calculations, ensuring consistency in historical values.
Moreover, the Adaptive Price Channel (log scale) allows for color customization, thereby improving visibility and user-friendliness. The colors of the indicator's upward and downward directions can be changed according to the user's preference.
2. Working Mechanism
The Adaptive Price Channel (log scale) uses the logarithm of the source, which is typically the closing price of a trading instrument. It leverages a Gaussian function that exponentially decreases the further the price moves away from the mean, accounting for both positive and negative values. The bandwidth of the Gaussian function can be adjusted to adapt to different market conditions.
Additionally, the Adaptive Price Channel (log scale) features an array of 500 lines for each bar, which helps in defining the boundaries or envelope for price movements. The calculations are executed using the Nadaraya-Watson estimator, which uses kernel regression for non-parametric analysis.
The calculated values for the upper and lower bounds of the envelope are then converted back from the logarithmic scale using the exponential function. This calculation process continues for each bar until the last bar in the data set.
To ensure optimal performance, the Adaptive Price Channel (log scale) uses dynamic repainting. If the repainting mode is enabled, it adjusts the smoothing of the indicator for the entire historical data, making the results more accurate.
3. Visualization and Alerts
The Adaptive Price Channel (log scale) offers an array of visual aids, including labels and plots. The upper and lower bounds of the envelope are plotted, and the indicator triggers labels at points where the closing price crosses these boundaries. These labels serve as alerts for potential trading opportunities.
4. Conclusion
The Adaptive Price Channel (log scale) is an innovative and adaptable trading indicator, drawing inspiration from its predecessor but introducing unique features to increase its versatility. By providing a repainting option, it ensures consistent historical values, thereby enhancing the reliability of the indicator. Furthermore, the capability to operate on a logarithmic scale broadens its usability for different timeframes. The Adaptive Price Channel (log scale) is a powerful tool for any trader, facilitating a better understanding of market dynamics, and enabling more informed decision-making.
Normalized Close IndicatorThe central aspect of this indicator is the computation of a normalized close price. The normalized close price is computed by first determining the highest and lowest closing prices over a specified historical period. This highest and lowest value form the boundaries of the historical price range.
Once these bounds are established, the current closing price's position within this range is calculated. This is done by subtracting the lowest close from the current close and dividing the result by the range (the highest close minus the lowest close). This yields a value between 0 and 1, which is then multiplied by 100 to provide a percentage. This is not calculating percentile rank, but often it overlaps.
This percentage represents where the current close price stands relative to the historical price range. If the value is near 0, it indicates that the current close price is near the historical low, potentially signaling an oversold condition. Conversely, if the value is near 100, it suggests that the current close price is near the historical high, possibly indicating an overbought condition.
By using this approach, the indicator helps identify points at which the price may be considered relatively high (overbought) or low (oversold) compared to its recent historical range.
Additionally alerts are to switch from long to short and vice versa, for the most part, my strategy that incorporates this indicator is either long or short, sometimes though, the opposite bounds (high level for longs and low level for shorts) are not reached, then stop loss and take profit levels are needed.
I discovered it works fine on markets that spend most of time in a range like BTC/USD, adjustment needs to be done in user inputs and in Pine Script (length) for different exchanges, in current configuration works fine for me on Deribit Perpetuals (BTCUSD.P and ETHUSD.P), on 5 minute and 3 minute timeframes with a stop loss of 1.5% and take profit of 4.5% for BTCUSD.P and 1.7% and 5.1% for ETHUSD.P.
Price Acceleration Indicator (PAI)I have designed a "Price Acceleration" Indicator (PAI). It tracks the second derivative in price movements. This is different from ROC as that one measures Price Velocity rather than Acceleration. This Indicator should give you an idea of when the steam has come out of a move, or when one is getting started. For example, if RSI is reaching overbought, and PAI is Negative, that means the move is slowing down and likely to give in to the opposite direction soon.
CoinFxPro Range indicator V 1.0This indicator has a structure that combines daily and weekly pivot levels, moving averages, and strength index-linked oscillators. The purpose of the indicator is designed to analyze price movements and identify potential trend reversals. Daily pivot levels are helpful in identifying critical support and resistance zones, while moving averages and oscillators indicate overbought or oversold situations in the price.
It is very simple to use and simple in appearance.
Triangular Signals appearing on the chart screen come when the price touches the daily or weekly support and resistance levels.
If you want the signals to be received less or more healthy, I added the filtering feature. In this way, you can filter the incoming signals through the volume or volatility filter, so that less signals are received.
On the other hand, the 4 timeframe rsi values of the price for daily use of the indicator are also given in the table.
You can change the RSI timeframes as you wish.
In this way, it is seen more clearly whether the signal is healthy and provides convenience while trading.
Evaluation of incoming signals;
First of all, when the signal occurs, pay attention to whether the RSI values that occur in the timeframe you trade and in other timeframes are overbought (red) or oversold (green).
When the signal comes, I buy or sell, especially if the RSI values in the 5 minutes, 15 minutes and 1 hour time periods are overbought or oversold.
If you wish, you can try a different strategy for yourself.
After the healthiest of the signals on the chart comes, the RSI values are also at overbought or oversold levels in 5-15 minutes and 1 hour timeframes and if there is a Trendline line above or below the price, it is out of that region.
A healthy buying or selling transaction can be made.
It should be noted that since risk = return, high risk means high return. High risk must be taken for high returns. Therefore, I recommend that you do not exceed 10% of your capital as margin when trading with leverage.
When trading, I always recommend trading with additional confirmation from a different indicator.
I also added a filtering feature to the indicator to block market structure related variables. Those who want to use can also use filtering.
I have added the automatic trendline for ease of trading. You can increase or decrease the number of trend lines as you wish.
I just published the indicator for daily use.
Mondays Range screener by B1rdIntroducing the long awaited Monday Range Screener by B1rd!
The Monday Range Screener is a powerful and intuitive indicator designed to help traders identify potential range trading opportunities based on Monday's price ranges. With user-friendly features and real-time data, this screener empowers you to make informed trading decisions.
Key Features:
Ticker Flexibility: The screener allows you to easily swap tickers, giving you the freedom to monitor and analyze multiple assets of your choice.
Comprehensive Information: The indicator displays essential data in a clear and organized manner. The left column shows the ticker symbol, followed by the current price, Monday's high, Monday's low, and Monday's average in the subsequent columns.
Range Trading Highlighting: The Monday Range Screener highlights the current price when it falls within Monday's high and low range, helping you quickly identify potential range trading opportunities.
Alert System: With the built-in alert feature, you can receive timely notifications whenever the current price enters Monday's high or low range. Stay on top of market movements even when you're away from the screen.
Get ready to take your trading to the next level with the Monday Range Screener by B1rd. This reliable indicator helps you identify range trading opportunities and stay informed about Monday's price ranges. Enhance your trading approach and make confident decisions using this powerful tool.
Important note: Please be aware that there is a known bug in certain chart layouts that may cause an array error and prevent the table from being plotted. The cause of this issue is unclear at the moment. However, based on my experience, there are a few potential solutions that you can try:
Set all the sources to a single asset, such as BTCUSDT. If this workaround works, you can gradually introduce new sources one by one and observe if the issue persists.
Experiment with different chart layouts, timeframes, and assets. Sometimes, applying the Monday Range Screener to alternative settings can help resolve the problem.
I apologize for any inconvenience this bug may cause. Please consider these workarounds as temporary solutions until a more permanent resolution can be found.
Original indicator this screener is based on:
Open Price Regression Modelnput Variables: The user can adjust the lookbackPeriod and m (multiplier) inputs. The lookbackPeriod specifies the number of previous bars used for regression calculations, and m is used to calculate the confidence interval width.
Calculate Regression Model: The code extracts open, high, low, and close prices for the current candle. It then performs regression calculations for high, low, and close prices based on the open prices.
Calculate Predicted Prices: Using the regression coefficients and intercepts, the code calculates predicted high, low, and close prices based on the current open price.
Calculate Confidence Interval: The code computes the standard errors of the regression for high, low, and close prices and multiplies them by the specified confidence level multiplier (m) to determine the width of the confidence intervals.
Plotting: The predicted high, low, and close prices are plotted with different colors. Additionally, confidence intervals are plotted around the predicted prices using lines.
Implications and Trading Advantage:
The Open Price Regression Model aims to predict future high, low, and close prices based on the current open price. Traders can use the predicted values and confidence intervals as potential price targets and volatility measures. Traders can consider taking long or short positions based on whether the current open price is below or above the predicted prices. Can be used on a daily time frame to forecast the day's high and low and use this levels are horizontal price levels on lower timeframes.
Oscillator Profile IndicatorDescription:
The Oscillator Profile Indicator (OPI) is designed to provide insights into market trends and potential reversal points by profiling the value distribution of an oscillator or the price chart over a specified lookback period.
The OPI works by calculating the Point of Control (PoC) for the oscillator values or prices in the given lookback period. This PoC, essentially a median, is considered the fair value where most trading activities have happened. Along with this, OPI also calculates lower and upper boundaries by taking the specified percentile of the sorted distribution of values. These boundaries outline the value area within which a significant portion of trading activity has occurred.
The main feature of the OPI is the interpretation of PoC movement and how it relates to general market trends. If the PoC moves above 0 on the oscillator, it's a potential indication that we are in a general uptrend. Conversely, if the PoC moves below 0, this can be a signal for a general downtrend.
Usage:
While OPI can be used on both price charts and oscillators, its effectiveness is more pronounced when used on oscillators. Applying this indicator to oscillators such as the Relative Strength Index (RSI) or the Moving Average Convergence Divergence (MACD) can provide useful insights.
How to Read:
PoC line: The line represents the median of the past 'n' periods. Its movement above or below 0 can be used to identify general uptrends or downtrends respectively.
Upper and Lower Boundary lines: These lines represent the specified percentile of the value distribution in the lookback period.
Colored Fills: The fills between the upper and lower boundary lines visually represent the value area. The color changes based on the relative position of the source value (price or oscillator value) to the PoC.
Signals:
An uptrend is indicated when the PoC moves above 0 on the oscillator, especially when coupled with an upward crossover of the source value through the PoC.
A downtrend is signaled when the PoC drops below 0 on the oscillator, particularly when paired with a downward crossover of the source value through the PoC.
(!) Note: Like all indicators, OPI should be used in conjunction with other technical analysis tools for the best results. It is also advisable to backtest this indicator with your strategy before using it in live trading.
Sessioned EMA - Frozen EMA in post market hoursWhy I develop this indicator?
In future indices, post market data with little volume distort the moving average seriously. This indicator is to eliminate the distortion of data during low volume post market hours.
How to use?
There is a time session setting in the indicator, you can set the cash hour time, moving average outside the session will be frozen.
What this indicator gives you
This indicator give you a more make sense ema pattern, the ema lines are more respected by the prices when you set the session properly.
Setup
1. Session setting
In US indices, such as NQ, ES etc, when there was data release at 0830 hr, huge volume transaction order appears, that makes the 0830 price data important that should be included in your ema trend line calculating. If that is the case, I will set the session begin from 0830, otherwise, I start the session at 0930. Golden rule : Price with huge volume counts.
2. Time zone
The coding is decided for GMT+8 time zone, you may amend the code to fit your timezone.
Nadaraya-Watson Envelope (Non-Repainting) Logarithmic ScaleIn the fast-paced world of trading, having a reliable and accurate indicator can make all the difference. Enter the Nadaraya-Watson Envelope Indicator, a cutting-edge tool designed to provide traders with valuable insights into market trends and potential price movements. In this article, we'll explore the advantages of this non-repainting indicator and how it can empower traders to make informed decisions with confidence.
Accurate Price Analysis:
The Nadaraya-Watson Envelope Indicator operates in a logarithmic scale, allowing for more accurate price analysis. By considering the logarithmic nature of price movements, this indicator captures the subtle nuances of market dynamics, providing a comprehensive view of price action. Traders can leverage this advantage to identify key support and resistance levels, spot potential breakouts, and anticipate trend reversals.
Non-Repainting Reliability:
One of the most significant advantages of the Nadaraya-Watson Envelope Indicator is its non-repainting nature. Repainting indicators can mislead traders by changing historical signals, making it difficult to evaluate past performance accurately. With the non-repainting characteristic of this indicator, traders can have confidence in the reliability and consistency of the signals generated, ensuring more accurate backtesting and decision-making.
Customizable Parameters:
Every trader has unique preferences and trading styles. The Nadaraya-Watson Envelope Indicator offers a range of customizable parameters, allowing traders to fine-tune the indicator to their specific needs. From adjusting the lookback window and relative weighting to defining the start of regression, traders have the flexibility to adapt the indicator to different timeframes and trading strategies, enhancing its effectiveness and versatility.
Envelope Bounds and Estimation:
The Nadaraya-Watson Envelope Indicator calculates upper and lower bounds based on the Average True Range (ATR) and specified factors. These envelope bounds act as dynamic support and resistance levels, providing traders with valuable reference points for potential price targets and stop-loss levels. Additionally, the indicator generates an estimation plot, visually representing the projected price movement, enabling traders to anticipate market trends and make well-informed trading decisions.
Visual Clarity with Plots and Fills:
Clear visualization is crucial for effective technical analysis. The Nadaraya-Watson Envelope Indicator offers plots and fills to enhance visual clarity and ease of interpretation. The upper and lower boundaries are plotted, along with the estimation line, allowing traders to quickly assess price trends and volatility. Fills between the boundaries provide a visual representation of different price regions, aiding in identifying potential trading opportunities and risk management.
Conclusion:
The Nadaraya-Watson Envelope Indicator is a powerful tool for traders seeking accurate and reliable insights into market trends and price movements. With its logarithmic scale, non-repainting nature, customizable parameters, and visual clarity, this indicator equips traders with a competitive edge in the financial markets. By harnessing the advantages offered by the Nadaraya-Watson Envelope Indicator, traders can navigate the complexities of trading with confidence and precision. Unlock the potential of this advanced indicator and elevate your trading strategy to new heights.
Multi-Band Breakout IndicatorThe Multi-Band Breakout Indicator was created to help identify potential breakout opportunities in the market. It combines multiple bands (ATR-Based and Donchian) and moving averages to provide valuable insights into the underlying trend and potential breakouts. By understanding the calculations, interpretation, parameter adjustments, potential applications, and limitations of the indicator, traders can effectively incorporate it into their trading strategy.
Calculation:
The indicator utilizes several calculations to plot the bands and moving averages. The length parameter determines the period used for the Average True Range (ATR), which measures volatility. A higher length captures a longer-term view of price movement, while a lower length focuses on shorter-term volatility. The multiplier parameter adjusts the distance of the upper and lower bands from the ATR. A higher multiplier expands the bands, accommodating greater price volatility, while a lower multiplier tightens the bands, reflecting lower volatility. The MA Length parameter determines the period for the moving averages used to calculate the trend and trend moving average. A higher MA Length creates a smoother trend line, filtering out shorter-term fluctuations, while a lower MA Length provides a more sensitive trend line.
The Donchian calculations in the Multi-Band Breakout Indicator play a significant role in identifying potential breakout opportunities and providing additional confirmation for trading signals. In this indicator, the Donchian calculations are applied to the trend line, which represents the average of the upper and lower bands. To calculate the Donchian levels, the indicator uses the Donchian Length parameter, which determines the period over which the highest high and lowest low are calculated. A longer Donchian Length captures a broader price range, while a shorter length focuses on more recent price action. By incorporating the Donchian calculations into the Multi-Band Breakout Indicator, traders gain an additional layer of confirmation for breakout signals.
Interpretation:
The Multi-Band Breakout Indicator offers valuable interpretation for traders. The upper and lower bands represent dynamic levels of resistance and support, respectively. These bands reflect the potential price range within which the asset is expected to trade. The trend line is the average of these bands and provides a central reference point for the overall trend. When the price moves above the upper band, it suggests a potential overbought condition and a higher probability of a pullback. Conversely, when the price falls below the lower band, it indicates a potential oversold condition and an increased likelihood of a bounce. The trend moving average further smooths the trend line, making it easier to identify the prevailing direction.
The crossover of the trend line (representing the average of the upper and lower bands) and the trend moving average holds a significant benefit for traders. This crossover serves as a powerful signal for potential trend changes and breakout opportunities in the market. When the trend line crosses above the trend moving average, it suggests a shift in momentum towards the upside, indicating a potential bullish trend. This provides traders with an early indication of a possible upward movement in prices. Conversely, when the trend line crosses below the trend moving average, it indicates a shift in momentum towards the downside, signaling a potential bearish trend. This crossover acts as an early warning for potential downward price movement. By identifying these crossovers, traders can capture the initial stages of a new trend, enabling them to enter trades at favorable entry points and potentially maximize their profit potential.
Breakout Signals:
For bullish breakouts, the indicator looks for a bullish crossover between the trend line and the trend moving average. This crossover suggests a shift in momentum towards the upside. Additionally, it checks if the current price has broken above the upper band and the previous Donchian high. This confirms that the price is surpassing a previous resistance level, indicating further upward movement.
For bearish breakouts, the indicator looks for a bearish crossunder between the trend line and the trend moving average. This crossunder indicates a shift in momentum towards the downside. It also checks if the current price has broken below the lower band and the previous Donchian low. This confirms that the price is breaking through a previous support level, signaling potential downward movement.
When a bullish or bearish breakout is detected, it suggests a potential trading opportunity. Traders may consider initiating positions in the direction of the breakout, anticipating further price movement in that direction. However, it's important to remember that breakouts alone do not guarantee a successful trade. Other factors, such as market conditions, volume, and confirmation from additional indicators, should be taken into account. Risk management techniques should also be implemented to manage potential losses.
Coloration:
The coloration in the Multi-Band Breakout Indicator is used to visually represent different aspects of the indicator and provide valuable insights to traders. Let's break down the coloration components:
-- Trend/Basis Color : The tColor variable determines the color of the bars based on the relationship between the trend line (trend) and the closing price (close), as well as the relationship between the trend line and the trend moving average (trendMA). If the trend line is above the closing price and the trend moving average is also above the closing price, the bars are colored fuchsia, indicating a potential bullish trend. If the trend line is below the closing price and the trend moving average is also below the closing price, the bars are colored lime, indicating a potential bearish trend. If neither of these conditions is met, the bars are colored yellow, representing a neutral or indecisive market condition.
-- Moving Average Color : The maColor variable determines the color of the filled area between the trend line and the trend moving average. If the trend line is above the trend moving average, the area is filled with a lime color with 70% opacity, indicating a potential bullish trend. Conversely, if the trend line is below the trend moving average, the area is filled with a fuchsia color with 70% opacity, indicating a potential bearish trend. This coloration helps traders visually identify the relationship between the trend line and the trend moving average.
-- highColor and lowColor : The highColor and lowColor variables determine the colors of the high Donchian band (hhigh) and the low Donchian band (llow), respectively. These bands represent dynamic levels of resistance and support. If the highest point in the previous Donchian period (hhigh) is above the upper band, the highColor is set to olive with 90% opacity, indicating a potential resistance level. On the other hand, if the lowest point in the previous Donchian period (llow) is below the lower band, the lowColor is set to red with 90% opacity, suggesting a potential support level. These colorations help traders quickly identify important price levels and assess their significance in relation to the bands.
By incorporating coloration, the Multi-Band Breakout Indicator provides visual cues to traders, making it easier to interpret the relationships between various components and assisting in identifying potential trend changes and breakout opportunities. Traders can use these color cues to quickly assess the prevailing market conditions and make informed trading decisions.
Adjusting Parameters:
The Multi-Band Breakout Indicator offers flexibility through parameter adjustments. Traders can customize the indicator based on their preferences and trading style. The length parameter controls the sensitivity to price changes, with higher values capturing longer-term trends, while lower values focus on shorter-term price movements. By adjusting the parameters, such as the ATR length, multiplier, Donchian length, and MA length, traders can customize the indicator to suit different timeframes and trading strategies. For shorter timeframes, smaller values for these parameters may be more suitable, while longer timeframes may require larger values.
Potential Applications:
The Multi-Band Breakout Indicator can be applied in various trading strategies. It helps identify potential breakout opportunities, allowing traders to enter trades in the direction of the breakout. Traders can use the indicator to initiate trades when the price moves above the upper band or below the lower band, confirming a potential breakout and providing a signal to enter a trade. Additionally, the indicator can be combined with other technical analysis tools, such as support and resistance levels, candlestick patterns, or trend indicators, to increase the probability of successful trades. By incorporating the Multi-Band Breakout Indicator into their trading approach, traders can gain a better understanding of market trends and capture potential profit opportunities.
Limitations:
While the Multi-Band Breakout Indicator is a useful tool, it has some limitations that traders should consider. The indicator performs best in trending markets where price movements are relatively strong and sustained. During ranging or choppy market conditions, the indicator may generate false signals, leading to potential losses. It is crucial to use the indicator in conjunction with other analysis techniques and risk management strategies to enhance its effectiveness. Additionally, traders should consider external factors such as market news, economic events, and overall market sentiment when interpreting the signals generated by the indicator.
By combining multiple bands and moving averages, this indicator offers valuable insights into the underlying trend and helps traders make informed trading decisions. With customization options and careful interpretation, this indicator can be a valuable addition to any trader's toolkit, assisting in identifying potential breakouts, capturing profitable trades, and enhancing overall trading performance.
RAINBOW AVERAGES - INDICATOR - (AS) - 1/3
-INTRODUCTION:
This is the first of three scripts I intend to publish using rainbow indicators. This script serves as a groundwork for the other two. It is a RAINBOW MOVING AVERAGES indicator primarily designed for trend detection. The upcoming script will also be an indicator but with overlay=false (below the chart, not on it) and will utilize RAINBOW BANDS and RAINBOW OSCILLATOR. The third script will be a strategy combining all of them.
RAINBOW moving averages can be used in various ways, but this script is mainly intended for trend analysis. It is meant to be used with overlay=true, but if the user wishes, it can be viewed below the chart. To achieve this, you need to change the code from overlay=true to false and turn off the first switch that plots the rainbow on the chart (or simply move the indicator to a new pane below). By doing this, you will be able to see how all four conditions used to detect trends work on the chart. But let's not get ahead of ourselves.
-WHAT IS IT:
In its simplest form, this indicator uses 10 moving averages colored like a rainbow. The calculation is as follows:
MA0: This is the main moving average and can be defined with the type (SMA, EMA, RMA, WMA, SINE), length, and price source. However, the second moving average (MA1) is calculated using MA0 as its source, MA2 uses MA1 as the data source, and so on, until the last one, MA9. Hence, there are 10 moving averages. The first moving average is special as all the others derive from it. This indicator has many potential uses, such as entry/exit signals, volatility indication, and stop-loss placement, but for now, we will focus on trend detection.
-TREND DETECTION:
The indicator offers four different background color options based on the user's preference:
0-NONE: No background color is applied as no trend detection tools is being used (boring)
1-CHANGE: The background color is determined by summing the changes of all 10 moving averages (from two bars). If the sum is positive and not falling, the background color is GREEN. If the sum is negative and not rising, the background color is RED. From early testing, it works well for the beginning of a movement but not so much for a lasting trend.
2-RAINBW: The background color is green when all the moving averages are in ascending order, indicating a bullish trend. It is red when all the moving averages are in descending order, indicating a bearish trend. For example, if MA1>MA2>MA3>MA4..., the background color is green. If MA1 threshold, and red indicates width < -threshold.
4-DIRECT: The background color is determined by counting the number of moving averages that are either above or below the input source. If the specified number of moving averages is above the source, the background color is green. If the specified number of moving averages is below the source, the background color is red. If all ten MAs are below the price source, the indicator will show 10, and if all ten MAs are above, it will show -10. The specific value will be set later in the settings (same for 3-TSHOLD variant). This method works well for lasting trends.
Note: If the indicator is turned into a below-chart version, all four color options can be seen as separate indicators.
-PARAMETERS - SETTINGS:
The first line is an on/off switch to plot the skittles indicator (and some info in the tooltip). The second line has already been discussed, which is the background color and the selection of the source (only used for MA0!).
The line "MA1: TYP/LEN" is where we define the parameters of MA0 (important). We choose from the types of moving averages (SMA, EMA, RMA, WMA, SINE) and set the length.
Important Note: It says MA1, but it should be MA0!.
The next line defines whether we want to smooth MA1 (which is actually MA0) and the period for smoothing. When smoothing is turned on, MA0 will be smoothed using a 3-pole super smoother. It's worth noting that although this only applies to MA0, as the other MAs are derived from it, they will also be smoothed.
In the line below, we define the type and length of MAs for MA2 (and other MAs except MA0). The same type and length are used for MA1 to MA9. It's important to remember that these values should be smaller. For example, if we set 55, it means that MA1 is the average of 55 periods of MA0, MA2 will be 55 periods of MA1, and so on. I encourage trying different combinations of MA types as it can be easily adjusted for ur type of trading. RMA looks quirky.
Moving on to the last line, we define some inputs for the background color:
TSH: The threshold value when using 3-TSHOLD-BGC. It's a good idea to change the chart to a pane below for easier adjustment. The default values are based on EURUSD-5M.
BG_DIR: The value that must be crossed or equal to the MA score if using 4-DIRECT-BGC. There are 10 MAs, so the maximum value is also 10. For example, if you set it to 9, it means that at least 9 MAs must be below/above the price for the script to detect a trend. Higher values are recommended as most of the time, this indicator oscillates either around the maximum or minimum value.
-SUMMARY OF SETTINGS:
L1 - PLOT MAs and general info tooltip
L2 - Select the source for MA0 and type of trend detection.
L3 - Set the type and length of MA0 (important).
L4 - Turn smoothing on/off for MA0 and set the period for super smoothing.
L5 - Set the type and length for the rest of the MAs.
L6 - Set values if using 4-DIRECT or 3-TSHOLD for the trend detection.
-OTHERS:
To see trend indicators, you need to turn off the plotting of MAs (first line), and then choose the variant you want for the background color. This will plot it on the chart below.
Keep in mind that M1 int settings stands for MA0 and MA2 for all of the 9 MAs left.
Yes, it may seem more complicated than it actually is. In a nutshell, these are 10 MAs, and each one after MA0 uses the previous one as its source. Plus few conditions for range detection. rest is mainly plots and colors.
There are tooltips to help you with the parameters.
I hope this will be useful to someone. If you have any ideas, feedback, or spot errors in the code, LET ME KNOW.
Stay tuned for the remaining two scripts using skittles indicators and check out my other scripts.
-ALSO:
I'm always looking for ideas for interesting indicators and strategies that I could code, so if you don't know Pinescript, just message me, and I would be glad to write your own indicator/strategy for free, obviously.
-----May the force of the market be with you, and until we meet again,
MTF Fusion - High Volume Expansion Channel [TradingIndicators]Exceptionally high volume and rapid price expansion are key markers of powerful moves, especially when they occur during a breakout or breakdown. The High Volume Expansion Channel (HVEC) uses our multi-timeframe fusion and price compression/expansion algorithms to look for high volume and rapid expansion from multiple higher timeframes at once. It uses this info to determine a high volume and expansion 'grade', and then encodes this result into a colored channel. This channel coloring varies in intensity based on how exceptionally high volume is and how rapidly price is expanding in either direction.
What is MTF Fusion?
Multi-Timeframe (MTF) Fusion is the process of combining calculations from multiple timeframes higher than the chart's into one 'fused' value or indicator. It is based on the idea that integrating data from higher timeframes can help us to better identify short-term trading opportunities within the context of long-term market trends.
How does it work?
Let's use the context of this indicator, which calculates a 'high volume and expansion grade' (let's call it HVEG), as an example to explain how MTF Fusion works and how you can perform it yourself.
Step 1: Selecting Higher Timeframes
The first step is to determine the appropriate higher timeframes to use for the fusion calculation. These timeframes should typically be chosen based on their ability to provide meaningful data and action which actively affect the price action of the smaller timeframe you're focused on. For example, if you are trading the 5 minute chart, you might select the 15 minute, 30 minute, and hourly timeframe as the higher timeframes you want to fuse in order to give you a more holistic view of the trends and action affecting you on the 5 minute. In this indicator, four higher timeframes are automatically selected depending on the timeframe of the chart it is applied to.
Step 2: Gathering Data and Calculations
Once the higher timeframes are identified, the next step is to calculate the data from these higher timeframes that will be used to calculate your fused values. In this indicator, for example, the HVEG value is calculated by determining the HVEG for all four higher timeframes.
Step 3: Fusing the Values From Higher Timeframes
The next step is to actually combine the values from these higher timeframes to obtain your 'fused' indicator values. The simplest approach to this is to simply average them. If you have calculated the HVEG value from three higher timeframes, you can, for example, calculate your 'multi-timeframe fused HVEG' as (HigherTF_HVEG_1 + HigherTF_HVEG_2 + HigherTF_HVEG_3) / 3.0.
Step 4: Visualization and Interpretation
Once the calculations are complete, the resulting fused indicator values are plotted on the chart. These values reflect the fusion of data from the multiple higher timeframes, giving a broader perspective on the market's behavior and potentially valuable insights without the need to manually consider values from each higher timeframe yourself.
What makes this script unique? Why is it closed source?
While the process described above is fairly unique and sounds simple, the truly important key lies in determining which higher timeframes to fuse together, and how to weight their values when calculating the fused end result in such a way that best leverages their relationship for useful TA.
This MTF Fusion indicator employs a smart, adaptive algorithm which automatically selects appropriate higher timeframes to use in fusion calculations depending on the timeframe of the chart it is applied to. It also uses a dynamic algorithm to adjust and weight the high volume and price expansion grade calculations depending on each higher timeframe's relationship to the chart timeframe. These algorithms are based on extensive testing and are the reason behind this script's closed source status.
Included Features
MTF Fusion high volume and expansion coloring
MTF Fusion ATR-based channel for visual effect
Channel width customization and explanatory labels
Pre-built color stylings
Options
Show Channel Lines: Show/hide the upper and lower lines of the channel
Fill Channel: Fill the channel with coloring depicting the current degree of high volume and rapid price expansion
Channel Width Multiplier: Sets the width of the ATR-based channel
Explanatory Labels: Show/hide explanatory labels describing the visuals
Lookback: Select how you want the degree of high volume expansion to be calculated (longer = long-term high volume and expansion, shorter = short-term high volume and expansion)
Pre-Built Color Styles: Use a pre-built color styling (uncheck to use your own colors)
Manual Color Styles: When pre-built color styles are disabled, use these color inputs to define your own
StdDev ChannelsThis script draws two sets of standard deviation channels on the price chart, providing a nuanced view of price volatility over different lengths.
The script starts by declaring a set of user-defined inputs allowing traders to customize the tool according to their individual requirements. The price input sets the source of the price data, defaulting to the closing price but customizable to use open, high, or low prices. The deviations parameter defines the width of the channels, with larger numbers resulting in wider channels. The length and length2 inputs represent the number of periods (in bars) that the script considers when calculating the regression line and standard deviation. Traders can also personalize the visual aspects of the indicator on the chart using the color, linewidth, and linestyle parameters.
Calculation of Standard Deviation:
The core of this script lies in calculating the regression line and standard deviation. This is where the InertiaAll function comes into play. This function calculates the linear regression line, which serves as the middle line of each channel. The function takes in two parameters: y (price data) and n (length for calculation). It returns an array containing the values for the regression line (InertiaTS), counter variable (x), slope of the line (a), and y-intercept (b). The standard deviation is then calculated using the built-in function ta.stdev, which measures the amount of variation or dispersion from the average.
After the calculation, the script proceeds to draw the channels. It creates two sets of lines (upper, middle, and lower) for each channel. These lines are initialized at the lowest price point on the chart (low). The coordinates for these lines get updated in the last section of the script, which runs only on the last bar on the chart (if barstate.islast). The functions line.set_xy1 and line.set_xy2 are used to adjust the starting and ending points for each line, forming the channels.
If the "full range" toggle is enabled, the script uses the maximum number of bars available on the chart to calculate the regression and standard deviation. This can give a broader perspective of the price's volatility over the entire available data range.
A Basic Strategy
The channels generated by this script may inform your trading decisions. If the price hits the upper line of a channel, it could suggest an 'overbought' condition indicating a potential selling opportunity. Conversely, if the price hits the lower line, it might signal an 'oversold' condition, suggesting a buying opportunity. The second channel, calculated over a different length, may serve to confirm these signals or identify longer-term trends.