Higher Fibonacci EMAOverall image:
If the closing price is higher than the three Fibonacci EMAs (uptrend):
Thanks to @ZenAndTheArtOfTrading and his indicator "Higher Timeframe EMA", URL =
This is a trend-discriminating indicator that uses 3 EMAs.
The Williams Alligator is the underlying philosophy, and we have applied it to capture the larger trend.
It is set up for the current time frame + 2 higher time frames.
One of the upper time legs has a daily EMA length of 13 Fibonacci numbers.
The top-level time leg has a weekly EMA with a length of 5 Fibonacci.
If the current closing price of the ticker leg is higher than these three EMAs, the bar color will be green. If it is lower, it will be red. If it is neither, it will be gray.
If the bar color is green, it suggests that the trend is upward. If it is red, you can consider entering short. If it is gray, it is best not to enter anything.
Trendtrading
All in One EMA indicator with Average EMA Calculations The Indicator displays multiple exponential moving averages (EMAs) on the chart. The six available options will let you adjust and set ]exponential moving averages ( EMAS) as per your choice. Additionally I have added an Average ema which will calculate the average of all the emas that you have selected. This average ema works very strong and greatly to find potential zone of dynamic supports and resistance as well as to gauge the overall trend .. The average ema will also allow you to keep your chart clean and you wont have to add too many emas together.
The average of the selected EMAs are displayed as a single line. This helps identify trends and potential reversals in the market. i hope this indicator will help you with trading...
Plz use the chart BINANCE:LINKBTC as reference, for back testing and educational purposes only.
Thumbs up if you liked the script.
Happy trading..
Disparity IndexThe Disparity Index is a technical momentum indicator that measures the relative position of the most recent closing price to a selected moving average. It calculates the percentage difference between the closing price and the moving average, providing insights into price momentum and potential reversals.
The formula for the Disparity Index is: * 100, where Close is the most recent closing price and n-period MA is the chosen moving average over n periods.
The Disparity Index can be used in various ways:
Trend Identification: The Disparity Index helps identify the relationship between the price and a chosen moving average. A positive value indicates that the price is above the moving average, suggesting bullish momentum, while a negative value suggests bearish momentum.
Overbought and Oversold Conditions: The Disparity Index can be used to identify potential overbought and oversold conditions. When the index reaches an extremely high value, it may indicate an overbought condition, implying a possible price correction. Conversely, an extremely low value can signal an oversold condition, indicating a potential price rebound.
Divergence: Traders can use the Disparity Index to identify divergence between the price and the indicator. Divergence occurs when the price and the Disparity Index move in opposite directions, potentially signaling an upcoming price reversal.
Personal Strategy: When the Disparity Index generates a green background, it suggests a potential bullish signal. This occurs when the Disparity Index crosses above the oversold threshold or exhibits a bullish reversal pattern. The green background signifies an area where buyers may have gained control, indicating a favorable environment for initiating long positions. This approach allows you to capitalize on potential upward price movements and join the uptrend.
On the other hand, when the Disparity Index generates a red background, it implies a potential bearish signal. This occurs when the Disparity Index crosses below the overbought threshold or exhibits a bearish reversal pattern. The red background highlights a zone where sellers might dominate, indicating a higher likelihood of downward price movements. By considering selling opportunities in these zones, you can position yourself to profit from potential downside moves and align with the prevailing downtrend.
The Disparity Index can be customized by using different types of moving averages such as simple moving averages (SMAs), exponential moving averages (EMAs), or weighted moving averages (WMAs). Additionally, it can be smoothed using another moving average to reduce noise and generate smoother signals, improving trend identification.
In trending markets, the Disparity Index is particularly effective as a trend indicator due to its ability to quickly capture price changes. It can provide early indications of trend strength and potential reversals, allowing traders to enter or exit positions in a timely manner. This advantage over traditional moving averages makes the Disparity Index a valuable tool for trend-following strategies.
Enjoy!
Developing Market Profile / TPO [Honestcowboy]The Developing Market Profile Indicator aims to broaden the horizon of Market Profile / TPO research and trading. While standard Market Profiles aim is to show where PRICE is in relation to TIME on a previous session (usually a day). Developing Market Profile will change bar by bar and display PRICE in relation to TIME for a user specified number of past bars.
What is a market profile?
"Market Profile is an intra-day charting technique (price vertical, time/activity horizontal) devised by J. Peter Steidlmayer. Steidlmayer was seeking a way to determine and to evaluate market value as it developed in the day time frame. The concept was to display price on a vertical axis against time on the horizontal, and the ensuing graphic generally is a bell shape--fatter at the middle prices, with activity trailing off and volume diminished at the extreme higher and lower prices."
For education on market profiles I recommend you search the net and study some profitable traders who use it.
Key Differences
Does not have a value area but distinguishes each column in relation to the biggest column in percentage terms.
Updates bar by bar
Does not take sessions into account
Shows historical values for each bar
While there is an entire education system build around Market Profiles they usually focus on a daily profile and in some cases how the value area develops during the day (there are indicators showing the developing value area).
The idea of trading based on a developing value area is what inspired me to build the Developing Market Profile.
🟦 CALCULATION
Think of this Developing Market Profile the same way as you would think of a moving average. On each bar it will lookback 200 bars (or as user specified) and calculate a Market Profile from those bars (range).
🔹Market Profile gets calculated using these steps:
Get the highest high and lowest low of the price range.
Separate that range into user specified amount of price zones (all spaced evenly)
Loop through the ranges bars and on each bar check in which price zones price was, then add +1 to the zones price was in (we do this using the OccurenceArray)
After it looped through all bars in the range it will draw columns for each price zone (using boxes) and make them as wide as the OccurenceArray dictates in number of bars
🔹Coloring each column:
The script will find the biggest column in the Profile and use that as a reference for all other columns. It will then decide for each column individually how big it is in % compared to the biggest column. It will use that percentage to decide which color to give it, top 20% will be red, top 40% purple, top 60% blue, top 80% green and all the rest yellow. The user is able to adjust these numbers for further customisation.
The historical display of the profiles uses plotchar() and will not only use the color of the column at that time but the % rating will also decide transparancy for further detail when analysing how the profiles developed over time. Each of those historical profiles is calculated using its own 200 past bars. This makes the script very heavy and that is why it includes optimisation settings, more info below.
🟦 USAGE
My general idea of the markets is that they are ever changing and that in studying that changing behaviour a good trader is able to distinguish new behaviour from old behaviour and adapt his approach before losing traders "weak hands" do.
A Market Profile can visually show a trader what kind of market environment we currently are in. In training this visual feedback helps traders remember past market environments and how the market behaved during these times.
Use the history shown using plotchars in colors to get an idea of how the Market Profile looked at each bar of the chart.
This history will help in studying how price moves at different stages of the Market Profile development.
I'm in no way an expert in trading Market Profiles so take this information with a grain of salt. Below an idea of how I would trade using this indicator:
🟦 SETTINGS
🔹MARKET PROFILING
Lookback: The amount of bars the Market Profile will look in the past to calculate where price has been the most in that range
Resolution: This is the amount of columns the Market Profile will have. These columns are calculated using the highest and lowest point price has been for the lookback period
Resolution is limited to a maximum of 32 because of pinescript plotting limits (64). Each plotchar() because of using variable colors takes up 2 of these slots
🔹VISUAL SETTINGS
Profile Distance From Chart: The amount of bars the market profile will be offset from the current bar
Border width (MP): The line thickness of the Market Profile column borders
Character: This is the character the history will use to show past profiles, default is a square.
Color theme: You can pick 5 colors from biggest column of the Profile to smallest column of the profile.
Numbers: these are for % to decide column color. So on default top 20% will be red, top 40% purple... Always use these in descending order
Show Market Profile: This setting will enable/disable the current Market Profile (columns on right side of current bar)
Show Profile History: This setting will enable/disable the Profile History which are the colored characters you see on each bar
🔹OPTIMISATION AND DEBUGGING
Calculate from here: The Market Profile will only start to calculate bar by bar from this point. Setting is needed to optimise loading time and quite frankly without it the script would probably exceed tradingview loading time limits.
Min Size: This setting is there to avoid visual bugs in the script. Scaling the chart there can be issues where the Market Profile extends all the way to 0. To avoid this use a minimum size bigger than the bugged bottom box
Dynamic Trend RipperThe "Dynamic Trend Ripper" indicator is designed to identify dynamic support and resistance levels based on exponential moving averages (EMA) and the average true range (ATR). It aims to assist traders in identifying potential trading opportunities by visualizing dynamic support and resistance areas on the price chart. Think of it as more of overbought or oversold areas then true support and resistance,
The indicator calculates two sets of EMAs: two for the top cloud and two for the bottom cloud. The lengths of these EMAs are determined by user-defined input parameters. Additionally, the indicator uses the ATR to adjust the EMAs, enhancing their effectiveness as dynamic support and resistance levels.
The top cloud is formed by adding the ATR to the top fast EMA and subtracting the ATR from the top slow EMA. The bottom cloud is formed by subtracting the ATR from the bottom fast EMA and adding the ATR to the bottom slow EMA.
The indicator plots the dynamic OB (Overbought) level, which is the top fast EMA plus the ATR multiplied by the OBOS multiplier. It also plots the dynamic OS (Oversold) level, which is the top slow EMA minus the ATR multiplied by the OBOS multiplier. These levels are visualized using colored lines on the chart.
The top fast EMA, top slow EMA, bottom fast EMA, and bottom slow EMA are also plotted on the chart. The area between the top slow EMA and top fast EMA is filled with a color, forming the top cloud. The area between the bottom fast EMA and bottom slow EMA is filled with another color, forming the bottom cloud. The color of the clouds changes based on the relationship between the top fast EMA and top slow EMA. If the Regular Fast EMA is greater than the Regular slow EMA, indicating a bullish trend, the clouds are displayed in green. Otherwise, if the top fast EMA is less than the top slow EMA, indicating a bearish trend, the clouds are displayed in red.
The indicator can be used to identify potential support and resistance zones where the price may encounter obstacles or reverse its direction. Traders can look for price interactions with the dynamic support and resistance levels, as well as the OB and OS levels, to make trading decisions. For example, a trader might consider entering a short trade when the price approaches the top cloud, or a long trade when the price bounces off the bottom cloud.
By incorporating the ATR, which measures volatility, the indicator adjusts the EMAs to adapt to changing market conditions. Traders can watch for price reactions or reversals near these levels to gauge potential overextension or exhaustion in the price movement. I'm not going to claim this as my own idea, but I will say that I came up with this version myself. I haven't seen anyone else take this approach which is why I think it can be revolutionary to trading.
EXTREME OVERBOUGHT/SOLD BANDS
ATR-ADJUSTED EMA'S
Stochastic Zone Strength Trend [wbburgin](This script was originally invite-only, but I'd vastly prefer contributing to the TradingView community more than anything else, so I am making it public :) I'd much rather share my ideas with you all.)
The Stochastic Zone Strength Trend indicator is a very powerful momentum and trend indicator that 1) identifies trend direction and strength, 2) determines pullbacks and reversals (including oversold and overbought conditions), 3) identifies divergences, and 4) can filter out ranges. I have some examples below on how to use it to its full effectiveness. It is composed of two components: Stochastic Zone Strength and Stochastic Trend Strength.
Stochastic Zone Strength
At its most basic level, the stochastic Zone Strength plots the momentum of the price action of the instrument, and identifies bearish and bullish changes with a high degree of accuracy. Think of the stochastic Zone Strength as a much more robust equivalent of the RSI. Momentum-change thresholds are demonstrated by the "20" and "80" levels on the indicator (see below image).
Stochastic Trend Strength
The stochastic Trend Strength component of the script uses resistance in each candlestick to calculate the trend strength of the instrument. I'll go more into detail about the settings after my description of how to use the indicator, but there are two forms of the stochastic Trend Strength:
Anchored at 50 (directional stochastic Trend Strength):
The directional stochastic Trend Strength can be used similarly to the MACD difference or other histogram-like indicators : a rising plot indicates an upward trend, while a falling plot indicates a downward trend.
Anchored at 0 (nondirectional stochastic Trend Strength):
The nondirectional stochastic Trend Strength can be used similarly to the ADX or other non-directional indicators : a rising plot indicates increasing trend strength, and look at the stochastic Zone Strength component and your instrument to determine if this indicates increasing bullish strength or increasing bearish strength (see photo below):
(In the above photo, a bearish divergence indicated that the high Trend Strength predicted a strong downwards move, which was confirmed shortly after. Later, a bullish move upward by the Zone Strength while the Trend Strength was elevated predicated a strong upwards move, which was also confirmed. Note the period where the Trend Strength never reached above 80, which indicated a ranging period (and thus unprofitable to enter or exit)).
How to Use the Indicator
The above image is a good example on how to use the indicator to determine divergences and possible pivot points (lines and circles, respectively). I recommend using both the stochastic Zone Strength and the stochastic Trend Strength at the same time, as it can give you a robust picture of where momentum is in relation to the price action and its trajectory. Every color is changeable in the settings.
Settings
The Amplitude of the indicator is essentially the high-low lookback for both components.
The Wavelength of the indicator is how stretched-out you want the indicator to be: how many amplitudes do you want the indicator to process in one given bar.
A useful analogy that I use (and that I derived the names from) is from traditional physics. In wave motion, the Amplitude is the up-down sensitivity of the wave, and the Wavelength is the side-side stretch of the wave.
The Smoothing Factor of the settings is simply how smoothed you want the stochastic to be. It's not that important in most circumstances.
Trend Anchor was covered above (see my description of Trend Strength). The "Trend Transform MA Length" is the EMA length of the Trend Strength that you use to transform it into the directional oscillator. Think of the EMA being transformed onto the 50 line and then the Trend Strength being dragged relative to that.
Trend Transform MA Length is the EMA length you want to use for transforming the nondirectional Trend Strength (anchored at 0) into the directional Trend Strength (anchored at 50). I suggest this be the same as the wavelength.
Trend Plot Type can transform the Nondirectional Trend Strength into a line plot so that it doesn't murk up the background.
Finally, the colors are changeable on the bottom.
Explanation of Zone Strength
If you're knowledgeable in Pine Script, I encourage you to look at the code to try to understand the concept, as it's a little complicated. The theory behind my Zone Strength concept is that the wicks in every bar can be used create an index of bullish and bearish resistance, as a wick signifies that the price crossed above a threshold before returning to its origin. This distance metric is unique because most indicators/formulas for calculating relative strength use a displacement metric (such as close - open) instead of measuring how far the price actually moved (up and down) within a candlestick. This is what the Zone Strength concept represents - the hesitation within the bar that is not typically represented in typical momentum indicators.
In the script's code I have step by step explanations of how the formula is calculated and why it is calculated as such. I encourage you to play around with the amplitude and wavelength inputs as they can make the zone strength look very different and perform differently depending on your interests.
Enjoy!
Walker
RSI Trend Transform [wbburgin]The RSI Trend Transform indicator is a dual-concept indicator that transforms volume data and price data into two different RSI values, which can then be used together to determine trend strength and momentum. The volume RSI does not use any price data in its calculation - it is purely a transform from nondirectional volume into a directional indicator.
The RSI for all three RSI values (price, volume,combined average) can be plotted as either stochastic or normal. The RSI calculation is adapted for use on volume, which is why the normal ta.rsi() function is not used for the price RSI calculation; both use the same formula for indicator consistency.
How to Use the Indicator
In the examples below, the Price RSI is plotted in yellow and the Volume RSI is plotted in red (length = 200, which is why the indicator is large in these examples). The indicator can be used on any timeframe and any asset, provided volume data is provided by the vendor to TradingView.
Identifying Bullish Trends
A rising volume RSI with a rising price RSI signifies a bullish trend. Example 1:
Example 2:
You can use the combined RSI (the average of the volume RSI and the price RSI) to help with the identification of these trends:
Identifying Bearish Trends
A falling volume RSI with a falling price RSI signifies a bearish trend:
Example 2:
Settings
Source is the source of the price RSI, the volume RSI will by default use volume in its calculations. If you have other indicators on-chart, you could even use the ATR, a volatility indicator, or any nondirectional or directional indicator and transform it into the "price" RSI.
Length is both the length of the RSI and the stochastic.
The next three rows are for each RSI you can plot on the indicator: price RSI, volume RSI, and combined RSI (average of price and volume). The first checkbox plots/removes them from the chart, you can subsequently choose the type of RSI (regular or stochastic), the color of the plot, and the length of the EMA smoothing applied afterward to the plot.
Upper Band and Lower Band refer to the overbought and oversold lines, respectively.
A note about the combined RSI- you will be unable to spot divergences if the combined RSI is the only plot on the indicator, so I encourage you to use the combined RSI as a way to confirm the overall trend if you notice the price RSI and the volume RSI and trending similarly.
Moving Average-TREND POWER v2.0-(AS)HELLO:
-This indicator is a waaaay simpler version of my other script - Moving Average-TREND POWER v1.1-(AS).
HOW DOES IT WORK:
-Script counts number of bars below or above selected Moving Average (u can se them by turning PLOT BARS on). Then multiplies number of bars by 0.01 and adds previous value. So in the uptrend indicator will be growing faster with every bar when price is above MA. When MA crosess price Value goes to zero so it shows when the market is ranging.
If Cross happens when number of bars is higher than Upper threshold or below Lower threshold indicator will go back to zero only if MA crosses with high in UPtrend and low in DNtrend. If cross happens inside THSs Value will be zero when MA crosses with any type of price source like for example (close,high,low,ohlc4,hl etc.....).This helps to get more crosess in side trend and less resets during a visible trend
HOW TO SET:
Just select what type of MA you want to use and Length. Then based on your preference set values of THSs'
OTHER INFORMATIONS:
-Script was created and tested on EURUSD 5M.
-For bigger trends choose slowerMAs and bigger periods and the other way around for short trends (FasterMAs/shorter periods)
-Below script code you can find not used formulas for calculating indicator value(thanks chat GPT), If you know some pinescript I encourage you to try try them or maybe bulid better ones. Script uses most basic one.
-Pls give me some feedback/ideas to improve and check out first version. Its way more complicated for no real reason but still worth to take a look'
-Also let me know if you find some logical errors in the code.
Enjoy and till we meet again.
Moving Average - TREND POWER v1.1- (AS)0)NOTE:
This is first version of this indicator. It's way more complicated than it should be. Check out Moving Average-TREND POWER v2.1-(AS), its waaaaay less complicated and might be better.Enjoy...
1)INTRODUCTION/MAIN IDEA:
In simpliest form this script is a trend indicator that rises if Moving average if below price or falling if above and going back to zero if there is a crossover with a price. To use this indicator you will have to adjust settings of MAs and choose conditions for calculation.
While using the indicator we might have to define CROSS types or which MAs to use. List of what cross types are defined in the script and Conditiones to choose from.The list will be below.
2) COMPOSITION:
-MA1 can be defined by user in settings, possible types: SMA, EMA, RMA, HMA, TEMA, DEMA, LSMA, WMA.
-MA2 is always ALMA
3) OVERLAY:
Default is false but if you want to see MA1/2 on chart you can change code to true and then turn on overlay in settings. Most plot settings are avalible only in OV=false.
if OV=true possible plots ->MA1/2, plotshape when choosen cross type
if OV=false -> main indicator,TSHs,Cross counter
4)PRESETS :
Indicator has three modes that can be selected in settings. First two are presets and do not require selecting conditions as they set be default.
-SIMPLE - most basic
-ABSOLUTE - shows only positive values when market is trending or zero when in range
-CUSTOM - main and the most advanced form that will require setting conditions to use in calculating trend
4.1)SIMPLE – this is the most basic form of conditions that uses only First MA. If MA1 is below selected source (High/Low(High for Uptrend and Low for DNtrend or OHLC4) on every bar value rises by 0.02. if it above Low or OHLC4 it falls by 0.02 with every bar. If there is a cross of MA with price value is zero. This preset uses CROSS_1_ULT(list of all cross types below)
4.2) ABSOLUTE – does not show direction of the trend unlike others and uses both MA1 and MA2. Uses CROSS type 123_ULT
4.3) CUSTOM – here we define conditions manually. This mode is defined in parts (5-8 of description)
5)SETTINGS:
SOURCE/OVERLAY(line1) – select source of calculation form MA1/MA2, select for overlay true (look point 3)
TRESHOLDS(line2). – set upper and lower THS, turn TSHs on/off
MA1(line3) – Length/type of MA/Offset(only if MA type is LSM)
MA2(line4) – length/offset/sigma -(remember to set ma in the way that in Uptrend MA2MA1 in DNtrend)
Use faster MA types for short term trends and slower types / bigger periods for longer term trends, defval MA1/2 settings
are pretty much random so using them is not recomended.
CROSSshape(line5) – choose which cross type you want to plot on chart(only in OV=true) or what type you want to use in counting via for loops,
CROSScount(line6) – set lookback for type of cross choosen above
BOOLs in lines 5 and 6 - plotshape if OV=true/plot CROSScount histogram (if OV=false)
Lines 7 and 8 – PRESET we want to use /SRC for calculation of indicator/are conditions described below/which MAs to use/Condition for
reducing value t 0 - (if PRESET is ABSOLUTE or SIMPLE only SRC should be set(Line 8 does not matter if not CUSTOM))
5)SOURCE for CONDS:
Here you can choose between H/L and OHLC. If H/L value grow when MAlow. If OHLC MAOHLC. H/L is set by default and recommended. This can be selected for all presets not only CUSTOM
6)CROSS types LIST:
“1 means MA1, 2 is MA2 and 3 I cross of MA1/MA2. L stands for low and H for high so for example 2H means cross of MA2 and high”
NAME -DEFINITION Number of possible crosses
1L - cross of MA1 and low 1
1H - cross of MA1 and high 1
1HL - cross of MA1 and low or MA1 and high 2 -1L/1H
2L - cross of MA2 and low 1
2H - cross of MA2 and high 1
2HL - cross of MA2 and low or MA1 and high 2 -2L/2H
12L - cross of MA1 and low or MA2 and low 2 -1L/2L
12H - cross of MA1 and high or MA2 and high 2 -1H/2H
12HL - MA1/2 and high/low 4 -1H/1L/2H/2L
3 -cross of MA1 and MA2 1
123HL -crosses from 12HL or 3 5 -12HL/3
1_ULT - cross of MA1 with any of price sources(close,low,high,ohlc4 etc…)
2_ULT - cross of MA2 with any of price sources(close,low,high,ohlc4 etc…)
123_ULT – all crosses possible of MA1/2 (all of the above so a lot)
7)CRS CONDS:
“conditions to reduce value back to zero”
>/< - 0 if indicator shows Uptrend and there’s a cross with high of selected MA or 0 if in DNtrend and cross with low. Better for UP/DN trend detection
ALL – 0 if cross of MA with high or low no matter the trend, better for detecting consolidation
ULT – if any cross of selected MA, most crosses so goes to 0 most often
8)MA selection and CONDS:
-MA1: only MA1 is used,if MA1 below price value grows and the other way around
MA1price =-0.02
-MA2 – only MA2 is used, same conditions as MA1 but using MA2
MA2price =-0.02
-BOTH – MA1 and MA2 used, grows when MA1 if below, grows faster if MA1 and MA2 are below and fastest when MA1 and MA2 are below and MA2price=-0.02
-MA1 and MA2 >price=-0.03
-MA1 and MA2 ?price and MA2>MA1=-0.04
9)CONDITIONS SELECTION SUMMARRY:
So when CUSTOM we choose :
1)SOURCE – H/L or OHLC
2)MAs – MA1/MA2/BOTH
3)CRS CONDS (>/<,ALL,ULT)
So for example...
if we take MA1 and ALL value will go to zero if 1HL
if MA1 and >/< - 0 if 1L or 1H (depending if value is positive or negative).(1L or 1H)
If ALL and BOTH zero when 12HL
If BOTH and ULT value goes back to zero if Theres any cross of MA1/MA2 with price or cross of MA1 and MA2.(123_ULT)
If >/< and BOTH – 0 if 12L in DNtrend or 12H if UPtrend
10) OTHERS
-script was created on EURUSD 5M and wasn't tested on different markets
-default values of MA1/MA2 aren't optimalized so do not
-There might be a logical error in the script so let me know if you find it (most probably in 'BOTH')
-thanks to @AlifeToMake for help
-if you have any ideas to improve let me know
-there are also tooltips to help
Powertrend - Volume Range Filter Strategy [wbburgin]The Powertrend is a range filter that is based off of volume, instead of price. This helps the range filter capture trends more accurately than a price-based range filter, because the range filter will update itself from changes in volume instead of changes in price. In certain scenarios this means that the Powertrend will be more profitable than a normal range filter.
Essentials of the Strategy
This is a breakout strategy which works best on trending assets with high volume and liquidity. It should be used on middle to higher timeframes and can be used on all assets that have volume provided by the data source (stocks, crypto, forex). It is long-only as of now. It can work on lower timeframes if you optimize the strategy filters to make less trades or if your exchange/broker is low/no fees, provided that your exchange/broker has high liquidity and volume.
The strategy enters a long position if the range filter is trending upwards and the price crosses over the upper range band, which signifies a price-volume breakout. The strategy closes the long position if the range filter is trending downwards and the price crosses under the lower range band, which signifies a breakdown. Both these conditions can be altered by the three filter options in the settings. The default trend filter is not alterable because it helps prevent false entries and exits that are against the trend.
Settings
The Length setting is the lookback period for the range smoothing.
The ADX Filter setting enables you to turn on an ADX filter, which will halt entries and exits unless the ADX of your customizable length is above a ADX VWMA of that length.
The Range Supertrend setting creates a supertrend from the top and bottom ranges, which can be used to filter entries and exits. The length is customizable. The filter can show you whether the range is making higher highs and lower lows. Below is an example of the Range Supertrend being used as a filter and plotted on-chart:
The VWMA setting halts entries if they are below a customizable length VWMA.
Both the Range Supertrend and the VWMA can also be plotted separately without actually filtering the strategy, so that you can use them independently if you wish. You can turn off the bar color, the highlighting, and the labels if you wish in the settings. A note about the bar color: if the color changes but the strategy does not signal an exit or entry this means that the crossover was against the trend. In these circumstances it may be indicative of a pullback to enter or exit or to add onto your position.
About the Strategy Results Below
A range filter is normally composed of two components - the range filter itself and a smoothing function. In the development of this script I tested both normal and volume-based varieties of the range filter and the smoothing function:
Tests Performed
Volume-based Range x VWMA smoothing
Price-based Range x VWMA smoothing
Price-based Range x EMA smoothing
Volume-based Range x EMA smoothing (final result)
The highest-performing was a volume-based range filter and a normal EMA-based smoothing function, but that does not mean that this strategy will be profitable - exits are based off of signal reversion so I strongly encourage you to develop your own take profits/stop losses for the strategy if you think it may be a good fit for you. The results below are with a commission value of 0.05% (because I built the strategy first for equities), slippage of 3, so if your exchange/broker has a higher fee schedule, I recommend adding filters and/or moving to higher timeframes for the strategy. Additionally, I used 10% of equity in each trade, while using the Range Supertrend filter (the previous upload was unrealistic because it used 100% of equity - missed a 0, apologies, and added in slippage).
Advanced Exponential Smoothing Indicator (AESI) [AstrideUnicorn]The Advanced Exponential Smoothing Indicator (AESI) provides a smoothed representation of price data using the exponential smoothing technique. It helps traders identify the overall trend and potential reversal points in the market.
SETTINGS
Length: The number of periods used for the calculation of the exponential moving average (EMA). Higher values provide a smoother result but may lag behind price movements.
Alpha: The smoothing factor that determines the weight of the recent price data in the smoothing calculation. Higher values give more weight to recent data, resulting in a more responsive indicator.
Cloud Mode: Determines whether to display a cloud between the AESI line and the EMA line. When enabled, the cloud represents bullish (green) and bearish (red) market conditions.
HOW TO USE
The AESI indicator consists of a single line that represents the advanced exponential smoothing of the price data. It aims to provide a smoother version of the price series, reducing noise and revealing the underlying trend.
Bullish Condition: When the AESI line is above the EMA line, it indicates a bullish market condition. Traders may consider looking for buying opportunities or holding onto existing long positions.
Bearish Condition: When the AESI line is below the EMA line, it suggests a bearish market condition. Traders may consider looking for selling opportunities or holding onto existing short positions.
Optional Cloud Mode:
Enabling the cloud mode allows you to visualize bullish and bearish market conditions more clearly. The cloud appears between the AESI line and the EMA line, providing a visual representation of the prevailing market sentiment.
Bullish Cloud: When the AESI line is above the EMA line, the cloud is green, indicating a potential bullish market condition.
Bearish Cloud: When the AESI line is below the EMA line, the cloud is red, indicating a potential bearish market condition.
Note: The AESI indicator is most effective when used in conjunction with other technical analysis tools and indicators to confirm trading signals and make informed trading decisions.
Adjusting the Parameters:
You can adjust the Length and Alpha parameters to find the best ones for different timeframes and market conditions. Experimenting with different parameter values can help you find the optimal settings for your trading strategy.
It is recommended to backtest the AESI indicator on historical price data and evaluate its performance before using it in live trading. Remember that no indicator can guarantee profitable trades, and it is important to use risk management techniques and exercise caution when making trading decisions.
Smart Trend EnvelopeThe "Smart Trend Envelope" indicator is a powerful tool that combines the "Nadaraya-Watson Envelope " indicator by LuxAlgo and the "Strongest Trendline" indicator by Julien_Eche.
This indicator provides valuable insights into price trends and projection confidence levels in financial markets. However, it's important to note that the indicator may repaint, meaning that the displayed results can change after the fact.
The "Strongest Trendline" indicator by Julien_Eche focuses on identifying the strongest trendlines using logarithmic transformations of price data. It calculates the slope, average, and intercept of each trendline over user-defined lengths. The indicator also provides standard deviation, Pearson's R correlation coefficient, and upper/lower deviation values to assess the strength and reliability of the trendlines.
In addition, the "Nadaraya-Watson Envelope " indicator developed by LuxAlgo utilizes the Nadaraya-Watson kernel regression technique. It applies a kernel function to smooth the price data and estimate future price movements. The indicator allows adjustment of the bandwidth parameter and multiplier to control the width of the envelope lines around the smoothed line.
Combining these two indicators, the "Smart Trend Envelope" indicator offers traders and investors a comprehensive analysis of price trends and projection confidence levels. It automatically selects the strongest trendline length based on the highest Pearson's R correlation coefficient. Traders can observe the trendlines on the price chart, along with upper and lower envelope lines generated by the Nadaraya-Watson smoothing technique.
The "Smart Trend Envelope" indicator has several qualities that make it a valuable tool for technical analysis:
1. Automatic Length Selection: The indicator dynamically selects the optimal trendline length based on the highest Pearson's R correlation coefficient, ensuring accurate trend analysis.
2. Projection Confidence Level: The indicator provides a projection confidence level ranging from "Ultra Weak" to "Ultra Strong." This allows traders to assess the reliability of the projected trend and make informed trading decisions.
3. Color-Coded Visualization: The indicator uses color schemes, such as teal and red, to highlight the direction of the trend and the corresponding envelope lines. This visual representation makes it easier to interpret the market trends at a glance.
4. Customizable Settings: Traders can adjust parameters such as bandwidth, multiplier, line color, and line width to tailor the indicator to their specific trading strategies and preferences.
The "Smart Trend Envelope" indicator has been specifically designed and coded to be used in logarithmic scale. It takes advantage of the logarithmic scale's ability to represent exponential price movements accurately. Therefore, it is highly recommended to use this indicator with the chart set to logarithmic scale for optimal performance and reliable trend analysis, especially on higher timeframes.
It's important to remember that the "Smart Trend Envelope" indicator may repaint, meaning that the displayed results can change after the fact. Traders should use this indicator as a tool for generating trade ideas and confirmation, rather than relying solely on its historical values. Combining the indicator with other technical analysis tools and considering fundamental factors can lead to more robust trading strategies.
Dodge Trend [MyTradingCoder]Introducing the "Dodge Trend" indicator, an innovative variant of the Supertrend indicator designed to help traders better avoid fakeouts and maintain positions in established trends.
Like the Supertrend, the Dodge Trend uses Average True Range (ATR) but incorporates a unique adaptive adjustment feature that differentiates it from its counterparts. While the conventional Supertrend rises with the trend and only descends when the price crosses it, the Dodge Trend is designed to 'dodge' potential fakeouts.
This 'dodging' mechanism works by allowing the Dodge Trend to fall slightly during pullbacks, reducing the risk of a premature exit due to a temporary price drop. The recovery rate after the pullback is quicker but is slightly lower than the rate at which a new Dodge Trend high would be established in an uptrend. This unique adjustment feature allows the Dodge Trend to chase price action in an exponential fashion, potentially enabling a quicker exit when the trend shifts.
Key Settings:
Length: Adjust how much price action is taken into consideration for the ATR average. Lower values yield higher responsiveness to recent price action.
Size: Determines the initial deviation of the Dodge Trend when it resets after every flip/break.
Source: Specifies the data point (close, high, open, low, hl2, etc.) used for the Dodge Trend.
Dodge Intensity: Adjusts the intensity of the pullback effect. Higher values result in more intense pullbacks. Range is limited between 0 and 99, with 95 as the recommended default.
Bullish Color Setting: Sets the color for the uptrend Dodge Trend.
Bearish Color Setting: Sets the color for the downtrend Dodge Trend.
Dodge Trend is a powerful tool for traders looking to ride trends and avoid unnecessary exits due to short-term price fluctuations. While it offers a unique feature that may potentially improve trading outcomes, it should be used in conjunction with other indicators and analysis methods for a comprehensive trading strategy. As with all tools, it does not guarantee profitable trades but aims to give traders more actionable and precise information to base their decisions on.
Experience trend-following in a more adaptive and efficient manner with the Dodge Trend indicator, a tool designed to help you 'dodge' false exits and stay in line with the overall trend.
Prevailing Trend IndicatorOVERVIEW
The Prevailing Trend indicator is a technical indicator that gauges whether the price is currently trending up or down. The purpose of this indicator is to call and/or filter with-trend signals.
CONCEPTS
This indicator assists traders in identifying high-probability trend entries. The upper line (blue line on the indicator) is calculated by taking the average range (high-low) of all bullish candles. The lower line (red line on the indicator) is calculated by taking the average range of all bearish candles. When these two lines intersect and cross each other, a buy and sell signal is generated. For example, if the blue line crosses over the red line, this indicates that the average size of all bullish bars are larger than the average size of all bearish bars. This is a good sign that an uptrend might occur. Vice versa for downtrends.
HOW DO I READ THIS INDICATOR
As an entry indicator:
When the blue line crosses over the red line, go long.
When the red line crosses over the blue line, go short.
As a signal filter:
If the blue line is above the red line, only take long trades.
If the red line is above the blue line, only take short trades.
MTF SuperTrends Nexus [DarkWaveAlgo]🧾 Description:
A nexus is a connection, link, or neuronal junction where signals and information are transmitted between different elements.
The MTF SuperTrends Nexus indicator serves as a nexus between MTF SuperTrends by facilitating the visualization of up to eight multi-timeframe SuperTrends, each with its own customizable timeframe, period, factor, and coloring customization. By combining these various SuperTrends, it helps you create a comprehensive view of MTF trend dynamics and cross-timeframe confluence according to the SuperTrend indicator.
It acts as a utility/control center that brings together multiple MTF SuperTrends and allows you to visualize the interactions between them with exceptional ease-of-use and customizability, helping to provide you with valuable insights into potential trend reversals, momentum shifts, and trading opportunities.
💡 Originality and Usefulness:
While there are other multi-timeframe SuperTrend indicators available, MTF SuperTrends Nexus' semi-transparent fills create a compounding opaqueness when SuperTrends from multiple timeframes coalesce - making visual assessment of cross-timeframe confluence extremely easy. We also believe it stands above the rest with its sheer quantity and quality of settings, features, and usability.
✔️ Re-Published to Avoid Misleading Values
This script has been re-published to ensure that it does not use `request.security()` calls using lookahead_on to access future data when referencing SuperTrend calculations from other timeframes. This decreases the likelihood that the indicator will provide deceiving values. This change has been made in accordance with the PineScript documentation: "Using barmerge.lookahead_on at timeframes higher than the chart's without offsetting the `expression` argument like in `close [ ]` will introduce future leak in scripts, as the function will then return the `close` price before it is actually known in the current context" and the Publishing Rule: "Do not use `request.security()` calls using lookahead to access future data". Historical and real-time values may differ when referencing timeframes other than the chart's.
💠 Features:
8 toggleable MTF SuperTrends with customizable timeframes, periods, and factors
Compounding filled areas for easy MTF SuperTrend confluence analysis
Aesthetic and flexible coloring and color theme styling options
End-of chart labels and options for ease-of-use and legibility
⚙️ Settings:
Use a Color Theme: When this setting is enabled, all manual 'Bullish and Bearish Colors' are overridden. All plots will use the colors from your selected Color Theme - excepting those plots set to use the 'Single Color' coloring method.
Color Theme: When 'Use a Color Theme' is enabled, this setting allows you to select the color theme you wish to use.
Fill SuperTrend Areas: When enabled, the area between any MTF SuperTrend and the price bars will be filled with semi-transparent coloring.
Hide SuperTrends on Timeframes Lower Than the Chart: When this setting is enabled, any MTF SuperTrend with a timeframe smaller than that of the chart the indicator is applied to will be hidden from view.
Enable: Show/hide a specific MTF SuperTrend.
Timeframe: Set the timeframe for a specific MTF SuperTrend.
Period: Set the lookback period for a specific MTF SuperTrend.
Factor: Set the multiplier factor used for a specific MTF SuperTrend's calculation.
Bullish Color: When 'Use a Color Theme' is disabled, this will set the 'bullish color' for this specific MTF SuperTrend.
Bearish Color: When 'Use a Color Theme' is disabled, this will set the 'bearish color' for this specific MTF SuperTrend.
Enable Label: When enabled, a label will show at the end of the chart displaying the timeframe, period, factor, and current price value of this specific MTF SuperTrend.
Size: Sets the font size of this specific MTF SuperTrend's label.
Label Offset (in Bars): Sets the distance from the latest bar, in bars, at which this specific MTF SuperTrend's label is displayed.
Show Label Line: When enabled, this specific MTF SuperTrend's label will be accommodated by a dashed line connecting it to its plot.
📈 Chart:
The chart shown in this original publication displays the 5 minute chart on BTCUSDT. Displayed on the chart are 6 MTF SuperTrends: the 5m 50-period/3-factor SuperTrend, 15m 50-period/3-factor SuperTrend, 30m 50-period/3-factor SuperTrend, 1h 50-period/3-factor SuperTrend, 4h 50-period/3-factor SuperTrend, and the 1D 25-period/1.5-factor SuperTrend - offering an exemplary view of how you can easily use these MTF SuperTrends to your advantage in analyzing SuperTrend relationships across multiple timeframes.
Trendline Pivots [QuantVue]Trendline Pivots
The Trend Line Pivot Indicator works by automatically drawing and recognizing downward trendlines originating from and connecting pivot highs or upward trendlines originating from and connecting pivot lows.
These trendlines serve as reference points of potential resistance and support within the market.
Once identified, the trend line will continue to be drawn and progress with price until one of two conditions is met: either the price closes(default setting) above or below the trend line, or the line reaches a user-defined maximum length.
If the price closes(default setting) above a down trend line or below an up trend line, an "x" is displayed, indicating the resistance or support has been broken. At the same time, the trend line transforms into a dashed format, enabling clear differentiation from active non-breached trend lines.
This indicator is fully customizable from line colors, pivot length, the number lines you wish to see on your chart and works on any time frame and any market.
Don't hesitate to reach out with any questions or concerns.
We hope you enjoy!
Cheers.
Williams %R + Keltner chanells - indicator (AS)1)INDICATOR ---This indicator is a combination of Keltner channels and Williams %R.
It measures trend using these two indicators.
When Williams %R is overbought(above upper line (default=-20)) and Keltner lower line is below price indicator shows uptrend (green).
When Williams %R is oversold(below lower line (default=-80)) and Keltner upper line is above price indicator shows downtrend (red) .
Can be turned into a strategy quickly.
2) CALCULATIONS:
Keltner basis is a choosen type of moving average and upper line is basis + (ATR*multiplier). Same with lower but minus instead of plus so basiss – (ATR*multiplier)
Second indicator
Williams %R reflects the level of the close relative to the highest high for the lookback period
3)PLS-HELP-----Looking for tips, ideas, sets of parameters, markets and timeframes, rules for strategy -------OVERALL -every advice you can have
4) SIGNALS-----buy signal is when price is above upper KC and Williams %R is above OVB(-20). Short is exactly the other way around
5) CUSTOMIZATION:
-%R-------LENGTH/SMOOTHING/TYPE SMOOTHING MA
-%R-------OVS/MID/OVB -(MID-no use for now)
-KC -------LENGTH/TYPE OF MAIN MA
-KC-------MULTIPLIER,ATR LENGTH
-OTHER--LENGTH/TYPE OF MA - (for signal filters, not used for now)
-OTHER--SOURCE -src of calculations
-OTHER--OVERLAY - plots %R values for debugging etc(ON by default)
6)WARNING - do not use this indicator on its own for trading
7)ENJOY
Relative Strength, not RSIThe Smoothed Relative Strength Indicator (not RSI) with Multi-Timeframe Support is a custom indicator that combines the concepts of Relative Strength (not RSI) and Money Flow Index (MFI) to create a smoothed trend-following tool. It works on any timeframe and adapts to different market conditions.
Key Features:
Multi-timeframe support: [ The script uses the request.security function to fetch data from other timeframes, allowing users to analyze the trend on different timeframes simultaneously.
Relative Strength calculation: The script calculates the Relative Strength (not RSI) by averaging the gains and losses over a user-defined period (len).
Money Flow Index calculation: The script calculates the Money Flow Index (MFI) by considering both price and volume data. The MFI is an oscillator that ranges between 0 and 100, and it helps identify overbought or oversold conditions in the market.
Combination of Relative Strength and MFI:The indicator calculates the average of Relative Strength and MFI values to create the Trend Reversal Strength (TRS) line.
Smoothing the TRS line: The TRS line is smoothed using a Simple Moving Average (SMA) with a user-defined smoothing length (smoothLen). This helps to reduce noise and make the trend more readable.
Trend color determination: The script determines the trend color based on the slope of the smoothed TRS line. If the current value of the smoothed TRS line is higher than the previous one, the line is colored green (uptrend). If the current value is lower than the previous one, the line is colored red (downtrend).
Visual representation of trend changes: The indicator plots small circles at points where the trend color changes, making it easier to identify potential trend reversal points.
Zero line: The script draws a horizontal line at the zero level to help users gauge the market's strength or weakness relative to this level.
Usage:
This indicator can be used as a trend-following tool to identify potential entry and exit points in the market. When the smoothed TRS line is green and rising, it suggests a bullish trend, and traders may consider entering long positions. Conversely, when the smoothed TRS line is red and falling, it indicates a bearish trend, and traders may consider short positions or exiting long trades.
Please note that this indicator should be used in conjunction with other technical analysis tools and proper risk management techniques to improve the accuracy of your trading decisions.
Dynamic Trendlines Multi-TimeframeThe Dynamic Trendlines indicator is a useful tool for traders to identify potential support and resistance levels in the market. By analyzing price volatility and drawing trendlines based on high volatility candles, it helps traders visualize key price levels that may influence future price action. This indicator uses the Average True Range (ATR) as a measure of price volatility to determine the threshold for high volatility candles. This indicator can be used on multiple time frames, so just choose which one works best for you!
The underlying concept of this indicator revolves around the calculation of the True Range and Average True Range. The True Range is the maximum value among the difference between the current high and low, the absolute value of the difference between the current high and previous close, and the absolute value of the difference between the current low and previous close. The ATR is then calculated as the simple moving average of the True Range over a user-defined period (default is 14). The threshold for high volatility candles is determined by multiplying the ATR by a user-defined multiplier (default is 1.5).
The indicator identifies high volatility candles when the closing price is greater than the previous closing price plus the threshold. Based on the price action, trendlines are drawn connecting the high or low of high volatility candles. The initial color and style of the trendline are determined by whether the price is moving up or down. Green solid lines represent upward price movement, while red solid lines represent downward price movement.
As the price crosses the trendlines, the indicator tracks the number of crosses and updates the line's style accordingly. If the price crosses a trendline twice, the line style is changed to dashed, indicating the potential weakening of the support or resistance level.
This indicator works best with trading methods that focus on capturing price breakouts or reversals. Traders can use the trendlines to identify potential entry or exit points, stop-loss levels, or take-profit targets. It's important to note that this indicator should be used in conjunction with other technical analysis tools and an understanding of the overall market context to make informed trading decisions.
When using the Dynamic Trendlines indicator on TradingView, users can customize the ATR length, threshold multiplier, and the number of recent trendlines displayed on the chart. Additionally, small triangles are plotted below high volatility candles, with their color based on the trendline it starts, providing a quick visual reference for traders.
In summary, the Dynamic Trendlines indicator is a valuable tool for identifying potential support and resistance levels in the market by analyzing price volatility and drawing trendlines based on high volatility candles. It is best suited for breakout and reversal trading strategies and should be used in conjunction with other technical analysis tools for optimal results.
Moving Average Trend Sniper [ChartPrime]Today we introducing the Moving Average Trend Sniper (MATS), a unique and powerful multi faceted tool. This moving average is designed to adapt to the ever-changing market conditions. MATS provides the ideal solution for traders looking to capitalize on market trends while accurately identifying support and resistance levels.
Why MATS?
MATS was developed with the trader in mind, focusing on the key factors crucial for a successful trading strategy - trend following, support, and resistance. Its unique moving average calculation not only accounts for market volatility and momentum but also provides a stable yet adaptable foundation for your trading decisions.
MATS employs a range of mathematical techniques to provide a precise and adaptive moving average, offering traders a more effective tool for analyzing market trends and identifying support and resistance levels. One of the primary distinctions of MATS is its use of delta, the change in market conditions, to update the moving average based on the trend's strength. This delta-based updating allows the moving average to adapt to market fluctuations and helps traders make more informed decisions when entering or exiting positions. MATS also focuses on the highs in a downtrend and the lows in an uptrend to provide more reliable support and resistance. By taking these crucial market points into consideration, the moving average delivers a comprehensive and accurate insight into the market's behavior and allows traders to make more precise predictions.
MATS leverages trigonometry to determine the trend angle for the moving average. By calculating this angle, MATS can efficiently pick the correct source (either the high or the low) to provide the best support and resistance analysis. This innovative use of trigonometry ensures that the moving average is better suited to the current market conditions and provides traders with a dynamic yet stable tool to support their trading decisions.
Settings:
Length: The length input for MATS plays a crucial role in determining how responsive the moving average will be to changes in market conditions. A shorter length setting results in a more reactive moving average that closely follows price movements, whereas a longer length setting generates a smoother, less volatile average. By adjusting the length setting, traders can fine-tune the sensitivity of MATS to align with their specific trading strategies and needs.
Glow: MATS offers a customizable and visually engaging display that helps traders effectively identify market trends. The "glow" effect surrounding support and resistance levels, available as an optional feature, enables users to assess these crucial areas more easily.
Example use cases:
In the screenshot below you can see the MATS acting as both a classical support and resistance while the glow and coloring is helped to provide a more classical trend following visualization to a trader. This duel functionality can help in re-entering during market retracements.
Risk-Adjusted Return OscillatorThe Risk-Adjusted Return Oscillator (RAR) is designed to aid traders in predicting future price action by analysing the risk-adjusted performance of an asset. This oscillator is displayed directly on the price chart, unlike other oscillators.
By considering the risk-return relationship, the indicator helps identify periods of overvaluation or undervaluation, allowing traders to anticipate potential price reversals or trend accelerations.
HOW TO USE
The Risk-Adjusted Return Oscillator analyses the risk-adjusted performance of an asset to detect price reversals and accelerations. Here's how to interpret its signals:
Ranging Market:
Overbought Signal: When the RAR curve reaches the overbought level (upper red line), it suggests a potential reversal signal. It indicates that the asset may be overvalued, and a price correction or trend reversal could occur.
Oversold Signal: When the RAR curve reaches the oversold level (lower red line), it indicates a potential reversal signal. It suggests that the asset may be undervalued, and a price correction or trend reversal could take place.
Trending Market:
Overbought Signal: In a trending market, an overbought signal (RAR curve reaching upper red line) suggests trend acceleration. It indicates that the existing trend is gaining strength, and buying pressure is increasing.
Oversold Signal: In a trending market, an oversold signal (RAR curve reaching lower red line) also signifies trend acceleration. It suggests that the prevailing trend is intensifying, and selling pressure is increasing.
Thus, it's important to consider the market context when interpreting overbought and oversold signals. In ranging markets, these signals act as potential reversal points. However, in trending markets, they indicate trend acceleration, reinforcing the current price direction.
SETTINGS
Period Length: Adjust the number of bars used to calculate returns and standard deviation.
Smoothing: Define the smoothing period for the RAR curve.
Show Overbought/Oversold Signals: Choose whether to display triangular shapes for overbought and oversold conditions.
Recursive Moving Average DifferenceThe relative difference between a moving average and the price can be a useful tool for interpreting trend direction and identifying pullbacks or breakdowns. This indicator recursively finds all the relative moving average differences between two simple moving averages of your choosing and weighs them by their lengths. It then returns a value that represents the weighted average of all the moving average differences. This can represent the gradient of motion between moving averages, or the path of least resistance, which the price may revert to in certain situations.
For the settings: minimum MA represents the minimum simple moving average to consider for the total weighted average. Maximum MA represents the maximum simple moving average to consider. "Move By" is the increment that you want to move between these two moving averages.
A positive moving average difference indicates that the price is above the moving average difference (i.e. the weighted average of all moving average differences between your two selected moving averages). A negative moving average difference indicates that the price is below the moving average difference. I have added a signal with a configurable length input as well to smooth out trends.
You can configure colors and lengths, as well as the counting increment. Future updates may include different ways to calculate weights, perhaps on overlay or strategy.
ADW - Colour TrendColour Trend is an indicator that will give you a visual representation of the trend in a selected market, and alert you when the trend changes. The green colour represents a bullish trend (prices are going up), the red colour represents a bearish trend (prices are going down), and silver represents a neutral trend (prices are relatively stable). The script calculates these trends based on the relative price levels and their moving averages.
Below is a breakdown of the script so you can better understand how these trends are defined.
Function f_p(_length, price) : This function calculates the price relative to its highest and lowest point over the given `_length` of time. This calculation is normalized by multiplying it by 100, giving us a percentage-like measure.
User Inputs : The length of the period (default 12), you can choose to show or hide bar colours (default is true).
Variables cycle_avg, cycle_counter, cycle_count, cycle_trend, cycle_col : These variables are used to calculate the trend cycles. The `cycle_avg` is the average trend cycle, `cycle_counter` keeps track of the current trend cycle, `cycle_count` counts the total number of cycles, `cycle_trend` keeps track of the direction of the cycle (1 for up, -1 for down), and `cycle_col` defines the colour of the current cycle.
Variables ph, pl, avg, mean : These variables calculate the price level relative to the highest and lowest prices (`ph` and `pl`), the average of these two levels (`avg`), and the cumulative average of the price level (`mean`).
Conditionals for cycle trend : The if-statements are checking whether the price level has reached a trend extreme and then updating the trend cycle, colour, count, and average accordingly.
Variable col and bar color : The variable `col` is used to define the colour of the bars based on the average price level. If the `show_barcolor` is true, the colour is determined based on the `avg` value.
Alert Conditions : These are conditions that will send alerts to the user when the trend changes. Specifically, the alerts occur when the colour changes from non-green to green (bull trend), from non-red to red (bear trend), or from non-silver to silver (no trend).