Multi-Sector Trend AnalysisThis script, titled "Multi-Sector Trend Analysis: Track Sector Momentum and Trends," is designed to assist traders and investors in monitoring multiple sectors of the stock market simultaneously. It leverages technical analysis by incorporating trend detection and momentum indicators like moving averages and the Relative Strength Index (RSI) to offer insights into the price action of various market sectors.
Core Features:
1. Sector-Based Analysis: The script covers 20 major sectors from the NSE (National Stock Exchange) such as Auto, Banking, Energy, FMCG, IT, Pharma, and others. Users can customize which sectors they wish to analyze using the available input fields.
Technical Indicators: The script uses two core technical indicators to detect trends and momentum:
2. Moving Averages: The script calculates both fast and slow exponential moving averages (EMAs). These are critical for identifying short- and long-term price trends and crossovers, helping detect shifts in momentum.
3. Relative Strength Index (RSI): A well-known momentum indicator that shows whether a stock is overbought or oversold. This script uses a 14-period RSI to gauge the strength of each sector.
4. Trend Detection: The script identifies whether the current market trend is "Up" or "Down" based on the relationship between the fast and slow EMAs (i.e., whether the fast EMA is above or below the slow EMA). It highlights this trend visually in a table format, allowing quick and easy trend recognition.
5. Gain/Loss Tracking: This feature calculates the percentage gain or loss since the last EMA crossover (a key point in trend change), giving users a sense of how much the price has moved since the trend shifted.
6. Customizable Table for Display: The script displays the analyzed data in a table format, where users can view each sector's:
Symbol
Trend (Up or Down)
RSI Value
Gain/Loss Since the Last EMA Crossover
This table is customizable in terms of size and color theme (dark or light), providing flexibility in presentation for different charting styles.
How It Works:
Sector Selection: Users can input up to 20 different sector symbols for analysis.
Moving Averages: Users can define the period lengths for both the fast and slow EMAs to suit their trading strategies.
Table Options: Choose between different table sizes and opt for a dark theme to enhance the visual appearance on charts.
How to Use:
Select the symbols (sectors) that you want to track. The script includes pre-configured symbols for major sectors on the NSE, but you can modify these to suit your needs.
Adjust the fast and slow EMA lengths to your preference. A common setting would be 3 for the fast EMA and 4 for the slow EMA, but more conservative traders might opt for higher values.
Customize the table size and theme based on your preference, whether you want a compact table or a larger one for easier readability.
Why Use This Script:
This script is ideal for traders looking to:
Monitor multiple market sectors simultaneously.
Identify key trends across sectors quickly.
Understand momentum and detect potential reversals through RSI and EMA crossovers.
Stay informed on sector performance using a clear visual table that tracks gains or losses.
By using this script, traders can gain better insights into sector-based trading strategies, improve their sector rotation tactics, and stay informed about the broader market environment. It provides a powerful yet easy-to-use tool for both beginner and advanced traders.
Trendlinetrading
Bull Bear Trend IndicatorIntroduction: Origin of the Swing Point Indicator
In the quest for a reliable indicator that accurately predicts trend directions and identifies valid highs and lows, the genesis of the Swing Point Indicator emerged. Faced with the challenge of finding a tool that provided comprehensive market analysis and actionable insights, the need for a novel solution became evident. Combining insights gleaned from market analysis and innovative algorithmic approaches, the Swing Point Indicator was born.
Enhanced Feature: Highs and Lows Labeling in Trend Direction
In addition to its core functionalities, the Swing Point Indicator incorporates an advanced feature that enhances the visualization of trend direction. This feature provides further clarity by selectively labeling highs and lows based on the prevailing trend, reinforcing the identification of higher highs and lower lows in uptrends and downtrends, respectively. Overlapping labels on highs and lows signify a potential trend change, providing traders with valuable insight into market reversals.
Detailed Description:
1. Uptrend Labeling:
- Higher Highs (Green Label with Price): In an uptrend, where higher highs are observed, the indicator labels these points with vibrant green color and includes the corresponding price value. This visually highlights the significance of higher highs as pivotal points in the upward trajectory of prices.
- Higher Lows (Red Marker without Text or Diamond): To complement the identification of higher highs, higher lows are marked with a distinct red marker or diamond, devoid of any accompanying text. While these points are crucial in delineating the ascending trend, their emphasis lies in their role as support levels, providing a foundation for upward price movements.
2. Downtrend Labeling:
- Lower Lows (Red Label with Price): Conversely, in a downtrend characterized by lower lows, the indicator labels these points with conspicuous red color, accompanied by the corresponding price value. Lower lows signify critical levels of downward price momentum, acting as indicators of potential bearish continuation.
- Lower Highs (Green Marker without Text or Diamond): Lower highs, indicative of downward retracements in a downtrend, are marked by distinctive green markers or diamonds without accompanying text. While these points denote temporary pauses or pullbacks in the bearish trend, their emphasis lies in their role as resistance levels, impeding upward price movements.
Functionality and Utility:
- Customizable Lookback Candle Count: Traders have the option to adjust the lookback candle count, which is set by default at 108 candles in the settings. This flexibility allows traders to tailor the indicator to their specific trading preferences and timeframes.
- Equal Highs or Lows Option: When enabled, the Swing Point Indicator can identify equal highs or equal lows, providing traders with additional insight into market dynamics.
- Formation Confirmation: A new higher high along with its higher low or a new lower low along with its lower high is confirmed after two candles have closed following the swing point candle. This ensures the reliability of the identified trend direction.
Conclusion:
The incorporation of selective labeling for highs and lows based on trend direction, alongside the introduction of customizable settings and formation confirmation criteria, enhances the effectiveness of the Swing Point Indicator. This feature-rich tool empowers traders with a nuanced understanding of market dynamics, highlighting critical price levels and trend reversals. By offering enhanced visualization, customizable options, and confirmation criteria, the Swing Point Indicator equips traders with the confidence and precision needed to navigate the markets successfully, contributing to more informed and profitable trading strategies.
Another New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and this is a companion indicator to my previous script . This indicator still works off of the same concept as before with effort vs results but this indicator takes a slightly different approach and instead defines results as the absolute difference between the closing price and a closing price x bars ago. As you can see in my chart example, this indicator works great to stay with the current trend and provides either a stop loss or take profit target depending on which direction you are going in. As always, I use darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicator scripts you would like to see me publish!
A New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and his idea was to focus on the Adaptive Moving Average created by Perry Kaufman and to try to improve it by introducing a concept of effort vs results. In this case the effort would be the total range of the underlying price action since each bar is essentially a war of the bulls vs the bears. The result would be the total range of the close so we are looking for the highest close and lowest close in that same time period. This gives us an alpha that we can use to plug into the Kaufman Adaptive Moving Average algorithm which gives us a brand new indicator that can hug the price just enough to allow us to ride the stock up or down. I have color coded it to be darker colors when it is a strong signal and lighter colors when it is a normal signal. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Price Action in action
What?
Price Action in Action is an indicator to help Price Action learners and practitioners to get everything related for Price Action in one place.
Price Action is:
Price + Volume = Action
In this indicator, we have the following features available:
Support/Resistance
Using the RSI with different periods in a multiple of 7 (7, 14, 21, 28), we first determine the overbought (above 70, customizable) and oversold (below 30, customizable) regions. Then we pick up the highest point and lowest point in the RSI values in the overbought and oversold regions, respectively. These are the point, historically supply/demand emerged for surety to push down/up the RSI indicator and the corresponding price. So, these are the most accurate way, we believe, to draw support/resistance (or demand/supply) in the chart. By default, the Support is green color and Resistance is red color. To give a visual representation, we differentiate the different shades of green and red. For example, for Level-1 (i.e. 7 by default) we use the darkest shade (0 transparency) and Level-4 (i.e. 28 by default) we use lighter shade (60 transparency). Note please: you can customize the color of support and resistance lines (say if you want resistance as green and support as red). The respective shades (transparency) will be automatically adjusted accordingly. But those shade (transparency) levels are not customizable, they are fixed (please bear with it for version-1 at least).
Strength of Support/Resistance
In the chart above/below the Resistance / Support lines you can see the tiny labels with some numbers like 1, 2.
We found out how many times a particular support/resistance is appearing across multiple RSI periods. E.g. if price P1 appears 2 times among 4 different RSI periods, the number will be 2 for that calculation, and so on.
There can be multiple presence of these numbers in a support/resistance line (i.e. multiple tiny labels). Something like: 1, 1, 2 (into different candles). This means the same support/resistance is tested so many times in different occasion (means there is a RSI max/min coincides in this level over multiple occasions) at different candles.
This will help you to intuitionally gauge the “strength” of a support/resistance line.
The more the marrier, unworthy to mention.
Candle Stick Patterns
Well: we don’t need to tell anything about the Candlestick. All of you know it better than us. And it’s a time proven, zero-lag mechanism to judge the Price-Action is unfolding in the market. We do not know if there is anything better possible than this time tested patterns to judge the prevailing sentiments of market.
Price-Action does not complete without finding out the Candlestick Patterns correctly.
And in this indicator your will get all of these: Single Candle such as Doji (default off), Marubozu, Spinner, hammers, inverted-hammer etc. ; 2 candles like Tweezer, Inside Candle, Engulfing; 3 candles like morning star/evening star.
In the multi candle patterns (2/3 candles), we are grouping the candles with a dotted rectangle such that it is clear which 2/3 candles are part of the pattern. E.g. Morning Star: 3 candles are grouped in a dotted rectangle and the Morning Star label will come to the latest candle (3rd most – as the pattern is detected reliably only on the completion of the 3rd final candle).
Of course, any program can not eliminate your trained eyes and brain to capture the patterns. But we have provided sufficient knobs to adjust various parameters to tweak the candle-pattern detection. Such as Strict Inside Candle(Harami) Boolean knob where the whole current candle including wicks will be inside the body part of the previous big candle. For non-strict mode, the current candle just inside the previous candle, possibly by wicks.
To make it better usable, for every such knobs (which are not obvious) we have added user-friendly tooltip (just mouse hover the question mark (?) besides the control/switch). There are plenty of it.
Volume
Here we have a rudimentary (yet effective) way to judge the volumes.
We find out the Volume Weighted Moving Average (VMWA) of the 20-period (default, but customizable) and the latest volume. If the latest volume is more than the 20 period vwma, we just add a grey diamond on the top of the candle to denote it’s attracting volumes. Of course, we provide a Weight coefficient (default is set to 1). So if the current bar’s volume on bar’s completion is more than the 20 period volume vmwa times the weigh-cofficient, we mark it with a tiny grey diamond.
Points to be noted:
In all places we mark the indication only on the completion of the bar (technically speaking we have checks, as far as possible, with barstate.isconfirmed). However, if you wish, you can turn it off for Candlestick (as some experts may want to check candlestick on the real time, even before the closing of bars).
In case if you see the chart looks cluttered (because of many information, specially in smaller timeframes like 5 min), there are controls given in the settings to toggle each and every features.
By default, we turn off Doji candles (all 3 types of Doji’s – normal, Gravestone & Dragonfly) as they are mainly indecision. However, you can toggle it to turn it on.
It does not give you any Buy/Sell call. The interpretation it does not have.
Why?
What’s unique in it?
As we already mentioned our intention is to include Price (in forms of Support / Resistance), Volume and Action (sentiments in terms of Candlestick patterns) into a single place. And so far, to the best of our knowledge, we could not come across a single indicator provides all of these.
There were works available to determine the RSI based support / resistance zones. Those are great piece works at that time (lets say 3 years back when PineScript was in earlier versions). To the best of our knowledge those does not cover up finding out the lowest / highest point of RSI and the corresponding price to get the simplistic and distinct support/resistance lines.
We have the intuitive support/resistance strength included which we could not found out in current set of available indicators.
To the best of our knowledge, there seems no indicator can detect 3-candle patterns which are extremely popular to detect trend reversals (such as Morning Star or Evening Star). Moreover for the multi-candle patterns we are grouping the candles part of the pattens (2-candles or 3-candles) using a dotted rectangle such that it’s visually clearly (and a well educative material for Price-Action learners also).
Mentions:
There are many works which inspire us along the way. Honestly: we sometimes forgot which all indicators we experimented with. We are sincerely apologetic in case we forgot to mention. A few note-worthy:
There is an indicator from user “repo32” named as “Candlestick Patterns Identified (updated 3/11/15)”. (We could not be able to contact “repo32”). We are inspired from his work that it’s feasible to detect Candlestick patterns.
There is an awesome work done by “RSI Based Automatic Demand and Supply” by user “shtcoinr”. The idea of consulting multiple RSI levels to find out the demand/supply zone we inspired from him. (We did contact “shtcoinr” and got his kind permission to use the concept.)
We are greatly thankful to these abovementioned wizards for their pioneering a-prior work in this front.
And of course, this TradingView platform to provide this abstraction, facilitates and felicitates collaborative contributions.
Ultimately, what’s for you?
That’s the main question. What’s for you?
Price-action comprises of following 3 tasks (at least):
Draw support/resistance lines in the chart.
Once price reaches at the support/resistance line, you fervently look out the candles’ formation to mentally map to the candle patterns. Your aim is divine: You want to judge if the price-action will continue or take a rejection/reversal.
Then you double-confirm with the volume (in a non-overlaid chart below).
Finally take a trade.
For a price-action newbie or seasoned, expert practitioner, you must be doing all the above tasks regularly and manually, in a mechanical, mundane way. There come the humanly subjectivity & the inevitable emotions . This indicator, being a piece of program/code in PineScript latest version v5 , eliminates (or at least, reduces to a great extend) that subjectivity & emotions out of the way of decision making . Thus resulting better yield.
Of course, you can argue that you draw slanted trend lines also. We recommend an already existing indicator by user LuxAlgo named as “Trendlines with Breaks ”, if you wish so.
Disclaimer:
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Happy trading.