Inverted ProjectionThe "Inverted Projection" indicator calculates the Simple Moving Average (SMA) and draws lines representing an inverted projection. The indicator swaps the highs and lows of the projection to provide a unique perspective on price movement.
This indicator is a simple study that should not be taken seriously as a tool for predicting future price movements; it is purely intended for exploratory purposes.
Скользящие средние
Non Adaptive Moving Average - Quan DaoThis Non-Adaptive Moving Average (NAMA) is my origin work. It came from the issues that I always face when using existing famous MA like EMA or RMA:
- What length should I choose for the MA for this security?
- Is there a length that works for multiple timeframes?
- Is there a length that works for multiple securities in multiple markets?
Choosing the right length for an MA is a tedious and boring work and is very subjective. One day in early 2023, I decided to create a new MA that will not be dependant a lot (non-adaptive) on the length of it, to make my life a little bit easier. The idea came from the formula of EMA and RMA:
ma = alpha * src + (1 - alpha) * ma
in which,
alpha = 1 / length for RMA
alpha = 2 / (length + 1) for EMA
I decided to use a constant alpha for the formula, which happened to be: 1.618 / 100 (i.e., golden ratio / 100)
This NAMA is using the length in the start only, after running for a while the MA value will be the same for every value of its length, which resolves good my 3 questions above.
The application of this NAMA is wide, I think.
- It can be used like a normal MA but you don't have to choose its length anymore.
- It can be used like EMA in DEMA, TEMA (I called it DNAMA, TNAMA)
- It can be used in calculating some famous indicators (RSI, TR, ...) so that these indicators will not be dependant on the length as well
In this example script, I included an EMA (in blue color) as well so that you can see how the EMA changes and NAMA stays the same when changing the value of its Length.
Consensio Allocation ToolOriginally created and taught by Taylor Jenks, this indicator provides portfolio allocation suggestions based on the behaviour of price and 3 simple moving averages (4/10/40 by default)
(ie. when short & medium term SMAs are above the long term then allocation is to be 100%).
This percentage allocated to the stock/commodity is to be reduced as it passes below the SMA's, particularly as each moving average crosses.
Consensio is useful for scaling in and out of a position as the portfolio allocation will change according to the momentum of the asset.
The rules below are my own based on understanding of the trading system developed by Jenks and his online content.
This script has the following rules:
if fastAboveSlowMA and not mediumAboveSlowMA
allocation := 30.0
else if longAboveFastMA
allocation := 0.0
else if fastAboveMediumMA and fastAboveSlowMA
allocation := 100.0
else if not fastAboveMediumMA and fastAboveSlowMA
allocation := 80.0
else if not fastAboveMediumMA and not fastAboveSlowMA
allocation := 50.0
else if not mediumAboveSlowMA and fastAboveSlowMA
allocation := 50.0
// Calculate adjusted allocation percentage based on crossing moving averages
allocation := allocation + (priceAboveFastMA ? 10.0 : -10.0)
allocation := allocation + (priceAboveMediumMA ? 10.0 : -10.0)
VWAP + 2 Moving Averages + RSI + Buy and SellIndicator: VWAP + 2 Moving Averages + RSI + Buy and Sell
Buy and Sell Arrows (Great for use alone or in conjunction with other scripts on the chart)
This indicator displays BUY (BUY) and SELL (SELL) arrows on the chart based on a combination of moving averages, VWAP and RSI. Arrows are a visual way to identify trading opportunities and can be useful for traders who want to follow a strategy based on these conditions.
The indicator uses two moving averages (20 and 50 periods) to identify upward crosses (buy) and downward crosses (sell). In addition, it takes into account VWAP (Volume Weighted Average Price) and RSI (Relative Strength Index) as additional filters to confirm buy and sell signals.
This script is great for use both independently and in conjunction with other indicators and strategies. You can combine it with other indicators and customize it to your preferences to create a more comprehensive trading strategy.
Please remember that this indicator is provided for educational purposes only and does not constitute financial advice. It is always recommended to carry out a thorough analysis before making any trading decisions.
Give this indicator a try and enjoy clear visualization of buy and sell arrows on your chart. Happy trading!
Volume Indicator (MA)Displays candles which have volume larger than the volume moving average (14-bars). Red is for down candles and Green is for up candles, works best on a light background.
MA Correlation CoefficientThis script helps you visualize the correlation between the price of an asset and 4 moving averages of your choice. This indicator can help you identify trendy markets as well as trend-shifts.
Disclaimer
Bear in mind that there is always some lag when using Moving-Averages, hence the purpose of this indicator is as a trend identification tool rather than an entry-exit strategy.
Working Principle
The basic idea behind this indicator is the following:
In a trendy market you will find high correlation between price and all kinds of Moving-Averages. This works both ways, no matter bull or bear trend.
In sideways markets you might find a mix of correlations accross timeframes (2018) or high correlation with Low-Timeframe averages and low correlation with High-Timeframe averages (2021/2022).
Trend shifts might be characterised by a 'staircase' type of correlation (yellow), where the asset regains correlation with higher timeframe averages
Indicator Options
1. Source : data used for indicator calculation
1. Correlation Window : size of moving window for correlation calculation
2. Average Type :
Simple-Moving-Average (SMA)
Exponential-Moving-Average (EMA)
Hull-Moving-Average (HMA)
Volume-Weighted-Moving-Average (VWMA)
3. Lookback : number of past candles to calculate average
4. Gradient : modify gradient colors. colors relate to correlation values.
Plot Explanation
The indicator plots, using colors, the correlation of the asset with 4 averages. For every candle, 4 correlation values are generated, corresponding to 4 colors. These 4 colors are stacked one on top of the other generating the patterns explained above. These patterns may help you identify what kind of market you're in.
5EMA BollingerBand Nifty Stock Scanner
What ?
We all heard about (well: over-heard) 5-EMA strategy. Which falls into the broader category of mean reversal type of trading setup.
What is mean reversal?
Price (or any time series, in fact) tries to follow a mean . Whenever price diverges from the mean it tries to meet it back.
It is empirically observed by some traders (I honestly don't know who first time observed it) that in Indian context specially, 5 Exponential Moving Average (5-EMA) works pretty good as that mean.
So whenever price moves away from that 5-EMA, it ultimately comes back and attain total nirvana :) Means: if price moved way higher than the 5EMA without touching it, then price will correct to meet it's 5-EMA and if price moved way lower, it will be uplifted to meet it's 5-EMA. Funny - but it works !
Now there are already enough social media coverage on this 5-EMA strategy/setup. Even TradingView has some excellent work done on these setups. Kudos to all those great souls.
So when we came to know about this, we were thinking what we should do for the community. Because it is well cover topic (specially in Indian context). Also, there are public indicators.
Then we thought why not come up with a scanner which will scan all the Nifty-50 constituent stocks and find out on the fly, real-time which all stocks are matching this 5-EMA setup and causing a Buy/Sell trade recommendation.
Hence here we are with the first version of our first scanner on the 5EMA setup (well it has some more masala than merely a 5-EMA setup).
Why?
Parts of why is already covered up.
Now instead of blindly following 5-EMA setup, we added the Bollinger band as well. Again: it's also not new. There are enough coverage in social media about the 5-EMA+BB strategy/setup. We mercilessly borrowed from all of these.
Suppose you have an indicator.
Now you apply the indicator in your chart. And then you need to (rock) and roll through your watchlist of Nifty-50 stocks (note: TradingView has no default watchlist of Nifty-50 stock by default - you have to create one custom watchlist to list all manually) to find out which all are matching the setup, need to take a note about the trade recomendations (entry, SL, target) and other stuffs like VWAP, Volume, volatility (Bollinger Band Width).
Not any more.
This scanner will track all the Nifty-50 stocks (technically: 40 stocks other than Banking stocks) and provide which one to Buy or Sell (if any), what's the entry, SL, target, where is the VWAP of the day, what's the picture in volume (high, low, rising, falling) and the implied volatility (using Bolling band width). Also it has a naive alerting mechanism as well.
In fact the code is there to monitor the (Future) OI also and all the OI drama (OI vs price and all the 4 stuffs like long build up, long unwinding, short covering, short buildup). But unfortunately, due to some limitations of the TradingView (that one can not monitor more than 40 `ta.security` call) we have to comment out the code. If you wish you can monitor only 20 stocks and enable the OI monitoring also (20 for stocks + 20 for their OI monitoring .. total 40 `ta.security` call).
How?
To know the divergence from 5-EMA we just check if the high of the candle (on closing) is below the 5-EMA. Then we check if the closing is inside the Bollinger Band (BB). That's a Buy signal. SL: low of the candle, T: middle and higher BB.
Just opposite for selling. 5-EMA low should be above 5-EMA and closing should be inside BB (lesser than BB higher level). That's a Sell signal. SL: high of the candle, T: middle and lower BB.
Along with we compare the current bar's volume with the last-20 bar VWMA (volume weighted moving average) to determine if the volume is high or low.
Present bar's volume is compared with the previous bar's volume to know if it's rising or falling.
VWAP is also determined using `ta.vwap` built-in support of TradingView.
The Bolling Band width is also notified, along with whether it is rising or falling (comparing with previous candle).
Simple, but effective.
Customization
As usual the EMA setup (5 default), the BB setup (20 SMA with 1.5 standard deviation), we provided option wherther to include or exclude BB role in the 5-EMA setup (as we found out there are two schools of thought .. some people use BB some don't. Lets make all happy :))
We also provide options to choose other symbols using Settings if they wish so. We have the default 40 non banking Nifty stocks (why non-banking? - Bank Nifty is in ATH :) .. enough :)). But if user wishes can monitor others too (provided the symbol is there in TradingView).
Although we strongly recommend the timeframe as 30 minutes , you can choose what's fit you most.
The output of the scanner is a table. By default the table is placed in the right-bottom (as we are most comfortable with that). However you can change per your wish. We have the option to choose that.
What is unique in it ?
This is more of an indicator. This is a scanner (of Nifty-50 stocks). So you can apply (our recommendation is in 30m timeframe) it to any chart (does not matter which chart it is) and it will show every 30 mins (which is also configurable) which all stocks (along with trade levels) to Buy and Sell according to the setup.
It will ease your trading activity.
You can concentrate only on the execution, the filtering you can leave it to this one.
Limitations
There is a build in limitation of the TradingView platform is that one can call only upto 40 securities API. Not beyond that. So naturally we are constraint by that. Otherwise we could monitor 190 Nifty F&O stocks itself.
30m is the recommended timeframe. In very lower (say 5m) this script tends to go out of heap (out of memory). Please note that also.
How to trade using this?
Put any chart in 30m (recommended) timeframe.
Apply this screener from Indicators (shortcut to launch indicators is just type / in your keyboard).
This will provide the Buy (shown in green color) or Sell (shown in red color) recommendations in a table, at every 30m candle closing.
Note the volume and BB width as well.
Wait for at least 2 5-minutes candles to close above/below the recommended level .
Take the trade with the SL and target mentioned.
Mentions
@QuantNomad. The whole implementation concept we mercilessly borrowed from him, even some of his code snippet we took it (after asking him through one of his videos comment section and seeking explicit permission which he readily granted within an hour). Thank You sir @QuantNomad. Indebted to you.
Monika (Rawat) ji: for reviewing, correcting, providing real time examples during live market hours, often compromising her own trading activities, about the effectiveness and usefulness of this setup. Thank You madam ji. Indebted to you.
There are innumerable contents in social media about this. Don't even know whom all we checked. Thanks to all of them.
Happy Trading (in stocks - isn't enough of Indices already?)
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.
Crypto Trend IndicatorThe Crypto Trend Indicator is a trend-following indicator specifically designed to identify bullish and bearish trends in the price of Bitcoin, and other cryptocurrencies. This indicator doesn't provide explicit instructions on when to buy or sell, but rather offers an understanding of whether the trend is bullish or bearish. It's important to note that this indicator is only useful for trend trading.
The band is a visual representation of the 30-day and 60-day Exponential Moving Average (EMA). When the 30-day EMA is above the 60-day EMA, the trend is bullish and the band is green. When the 30-day EMA is below the 60-day EMA, the trend is bearish and the band is red. When the 30-day EMA starts to converge with the 60-day EMA, the trend is neutral and the band is grey.
The line is a visual representation of the 20-week Simple Moving Average (SMA) in the daily timeframe. "Bull" and "Bear" signals are generated when the 20-day EMA is either above or below the 20-week SMA, in conjunction with a bullish or bearish trend. When the band is green and the 20-day EMA is above the 20-week SMA, a “Bull” signal emerges. When the band is red and the 20-day EMA is below the 20-week SMA, a “Bear” signal emerges. The 20-week SMA can potentially also function as a leading indicator, as substantial price deviations from the SMA typically indicate an overextended market.
While this indicator has traditionally identified bullish and bearish trends in various cryptocurrency assets, past performance does not guarantee future results. Therefore, it is advisable to supplement this indicator with other technical tools. For instance, range-bound indicators can greatly improve the decision-making process when planning for entries and exits points.
MultiMovesCombines 3 different moving averages together with the linear regression. The moving averages are the HMA, EMA, and SMA. The script makes use of two different lengths to allow the end user to utilize common crossovers in order to determine entry into a trade. The edge of each "cloud" is where each of the moving averages actually are. The bar color is the average of the shorter length combined moving averages.
-The Hull Moving Average (HMA), developed by Alan Hull, is an extremely fast and smooth moving average. In fact, the HMA almost eliminates lag altogether and manages to improve smoothing at the same time. A longer period HMA may be used to identify trend.
-The exponential moving average (EMA) is a technical chart indicator that tracks the price of an investment (like a stock or commodity) over time. The EMA is a type of weighted moving average (WMA) that gives more weighting or importance to recent price data.
-A simple moving average (SMA) is an arithmetic moving average calculated by adding recent prices and then dividing that figure by the number of time periods in the calculation average.
-The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. Instead of plotting an average of past price action, it is plotting where a Linear Regression Line would expect the price to be, making the Linear Regression Indicator more responsive than a moving average.
The lighter colors = default 50 MA
The darker colors = default 200 MA
PhenomIt is a simple and effective tool for trading on moving averages.
The main advantage is that an ATR-based risk management system is included here. The system is based on the work of FullTimeTradingRu and the FBMA indicator
How to use the system:
1. I recommend using a daily timeframe.
2. Look for a rebound from the moving average, the most effective 20 Ema. For convenience, the colors of the bars are painted green in an uptrend.
3. Enter the transaction using hints. The recommended number of shares to buy is indicated in the table, taking into account your deposit and the risk per transaction from the deposit (by default 1%). Stop 1.5 ATR. Everything is the same for opening short positions.
4. I recommend entering the second trade only if the previous one passed 0.5 ATR, thereby confirming the trend and the fact that you correctly guessed the movement.
There are ATR settings in the script
Last bar show — How many bars to show
ATR lines ATR Step — For a more convenient view, ATR lines can be turned into a ladder.
Rainbow Drift BetaRainbow Drift Beta is an indicator that detects the triggers of long and short positions at any TF.
It's based on two different type of approaches to the EMAs periods:
- Classic EMAs periods: 10 and 50
- Cycle EMAs perdios: 16, 64 and 256
The 256 period EMA (Annual Cycle) detects the trend: if the EMA 64 (Three-Weekly Cycle) is above, it shows an uptrend; while the EMA 64 is below, it means that the price action is in downtrend.
10 and 16 periods EMAs are working together as well as the 50 and the 64. The first couple reacts faster than the second one and as soon as the 10 is above the 16, the band shows the first attempt of the price action to go in the uptrend direction. The same concept is applied to the second couple (50, 64): when EMA 50 > EMA 64 it's a confirmation of the faster EMAs long direction. Viceverca happens for the downtrend but with the same concept.
As the EMA periods taken in consideration are quite often a sensitive level of reaction of the price, the indicator detects when there is trigger of a long or a short set up and plots a label on the chart. It's possibile to set up an alert as well.
Quite important, the indicator is looking for sideways patterns as the breakout of them shows a clear direction of the price.
Moreover, in order to privide the first and the best entry possibile, the indicator has a function that is triggering only one time as the trend reverted: for example, a long entry on the EMA 10-16 happens only one time since they crossover the EMA 64.
As included in the name, this is a beta version and new improvements will be added in the near future like suggested price entry, SL and TP, and the focus of the development is to avoid as much as possibile the false triggers.
Of course the best way to improve the code is to receive the users' feedbacks, so please feel free to post your comments and questions.
Biddles OI Weighted Average PriceAhoy!
This script calculates Open Interested Weighted Average Price for the following lookback periods:
- 7, 30, 60
e.g. On the 1D chart, you will see OIWAP for the past 7, 30, and 60 days. It works on any timeframe though.
It works with any ticker that TV's OI indicator supports, and has ticker override if you are looking at an exchange that's unsupported, but for an asset that is.
e.g. If you're looking at Bybit's BTCUSDT.P which is unsupported- you can override to get OI data from Binance's BTCUSDT.P which is supported.
=====
Open-Sourced + Crowd Sourcing Goals
=====
I am open sourcing this in hopes we can work together to find interesting signal/observation, and make the script better.
The only way I could think of to calculate the OIWAP for the lookback periods was to manually factor in each period in the formula.
e.g. For the 60-period lookback, it's manually taking price and OI for each individual period.
I am also hoping other folks will make interesting observations.
With the few hours I've spent thus far, they seem to operate much like MA bands, with crossovers having similar implications.
But I feel like there are many other observations left unnoticed!
If you find any, hmu on twitter: @thalamu_
=====
Interesting Calculations in the Script, but not Plotted on the Chart
=====
There are calculations for up to 60 days of OIWAP taking change in OI rather than just OI.
There's one set for absolute value of change in OI, and one set for raw change in OI.
I didn't notice anything spectacularly interesting - but perhaps you will if you tinker with it!
=====
Find something cool? Have an improvement?
=====
Hmu on twitter: @thalamu_
[SMT] Binary Option 1 MinuteThis indicator called " Binary Option 1 Minute" is designed to trade binary options on 1-minute time frames. It is based on two moving averages and a crossover signal. The moving averages used are calculated from the average prices of the last time periods. The first moving average is calculated with a shorter period, while the second is calculated with a longer period.
The signal is generated when the first moving average crosses above or below the second moving average, and then an additional filter is applied. The signal filter is calculated using an exponentially weighted moving average of the difference between the two moving averages. When the signal crosses above the zero line, a buy signal is generated, and when the signal crosses below the zero line, a sell signal is generated.
The indicator plots buy and sell arrows on the chart when a signal is generated. Additionally, it can also display gains and losses in the form of background colors. The green color indicates a gain, and the red color indicates a loss. Finally, the indicator includes sound and text alerts to inform the trader about the generation of a signal.
Attention: This indicator does not repaint! Wait for the candle to close to confirm the entry signal. Remember that signals do not imply guarantees of accuracy or gains. It is highly recommended that you test the indicator on a demo account before using it on a real account.
Average Trend with Deviation Bands v2TL;DR: An average based trend incl. micro trend spotting and multiple display options.
This script is basically an update of my "Average Trend with Deviation Bands" script. I made the following changes:
Not an overlay anymore - The amount of drawn lines makes the chart pretty messy. That's why I moved it to a pane. If you preferred the overlay you can use my "Average Trend with Deviation Bands" script. *This is also the reason why I publish this script instead of updating the existing one.
I added an EMA to represent the price movement instead of candles
I added a signal (SMA) to spot micro trends and early entry/exit signals
I added the option to switch between a "line view" which shows the average trend and deviation bands and an "oscillator view" which shows an oscillator and histogram (MACD style)
General usage:
1. The white line is the average trend (which is an average of the last N bars open, close, high, low price).
2. Bands around the average trend are standard deviations which can be adjusted in the options menu and are only visible in "lines view". Basically they are like the clouds in the Ichimoku Cloud indicator - In big deviation bands the price movement needs more "power" to break through the average trend and vice versa.
3. Indicator line (blue line) - This is the EMA which represents the price. Crossing the average trend from below indicates an uptrend and vice versa (crossing from above indicates a down trend).
4. Signal line (red line) - This is a smoothed version of the indicator line which can be used to predict the movement of the price when crossed by the indicator line (like at MACD and many other indicators).
Oscillator usage:
When switched to "oscillator view" the indicator line oscillates around a zero line which can be seen as the average trend. The usage is basically the same as described above. However there is also the histogram which shows the difference between the indicator and signal. Of course the histogram can be deactivated. Additionally a color filling can be added to easily spot entry/exit signals.
As always: Code is free do whatever you like. If you have any questions/comments/etc. just drop it in the comment section.
Volume Channel - [With Volume Filter]The indicator calculates two volume-weighted moving averages (VWMA) using different lengths, and filters them based on a moving average of volume. The filtered VWMA values are then plotted on the chart as lines, representing the fast and slow moving averages. In addition, upper and lower bands are calculated based on the slow VWMA and plotted as lines on the chart.
The fast and slow VWMA lines can be used to identify trends in the market. When the fast VWMA is above the slow VWMA, it is an indication of an uptrend, and when the fast VWMA is below the slow VWMA, it is an indication of a downtrend. The position of the VWMA lines relative to the upper and lower bands can also be used to identify potential trade signals.
When the price is near the upper band, it indicates that the market is overbought, and when the price is near the lower band, it indicates that the market is oversold. Traders can use these signals to enter or exit trades.
The indicator also includes a volume filter, which means that the VWMA values are only calculated when the volume is above a certain moving average of volume. This helps to filter out noise in the market and provide more accurate signals.
Explanation for each parameter
vwmaLength1: This is the length of the fast volume-weighted moving average (VWMA) used in the calculation. The default value is 10, and it can be adjusted by the user.
vwmaLength2: This is the length of the slow volume-weighted moving average (VWMA) used in the calculation. The default value is 25, and it can be adjusted by the user.
bandLength: This is the length of the moving average used to calculate the upper and lower bands. The default value is 34, and it is not adjustable by the user.
volumeFilterLength: This is the length of the moving average of volume used as a filter for the VWMA calculation. The default value is 5, and it can be adjusted by the user.
src: This is the input source for the VWMA calculation. The default value is close, which means the indicator is using the closing price of each bar. However, the user can select a different input source by changing this parameter.
filteredVwma1: This is the filtered VWMA calculated based on the volume filter and the fast VWMA length. It is plotted as a line on the chart and can be used to identify short-term trends.
filteredVwma2: This is the filtered VWMA calculated based on the volume filter and the slow VWMA length. It is plotted as a line on the chart and can be used to identify long-term trends.
ma: This is the moving average of the filtered slow VWMA values, which is used to calculate the upper and lower bands. It is plotted as a line on the chart.
offs: This is the offset used to calculate the upper and lower bands. It is based on the standard deviation of the filtered slow VWMA values and is multiplied by 1.6185 * 3. It is plotted as a line on the chart.
up: This is the upper band calculated as the moving average plus the offset. It is plotted as a line on the chart and can be used to identify overbought conditions.
dn: This is the lower band calculated as the moving average minus the offset. It is plotted as a line on the chart and can be used to identify oversold conditions.
RB_Dynamic_No_Trade_ZoneThis indicator provides dynamic range information to help traders identify when a value moves out of a certain zone. This can be useful in making trading decisions. When the value falls outside of the specified range, it may indicate a good time to enter or exit a trade
Multi-Timeframe SMA with Percentage DifferencesShort Description: Visualize multiple SMAs and track percentage differences between them.
Long Description:
This indicator helps traders visualize multiple Simple Moving Averages (SMAs) on various timeframes and track the percentage differences between them. By showing the percentage differences, traders can quickly understand the relative distance between SMAs, making it easier to identify potential trends, reversals, or support and resistance levels.
Key Features:
Displays four different SMAs (20, 50, 100, and 200) on the chart.
Calculates and shows the percentage differences between consecutive SMAs.
Adjusts the SMAs and percentage differences based on the selected timeframe.
How to Use:
Add the indicator to your chart.
Customize the SMA lengths according to your preferences.
Observe the plotted SMAs and percentage differences between them.
When the shorter-term SMA is above the longer-term SMA, it is generally considered a bullish signal. Conversely, if the shorter-term SMA is below the longer-term SMA, it is considered a bearish signal. The percentage differences between the SMAs can help traders gauge the strength of the trend and potential for reversals.
Please note that this indicator should be used in conjunction with other technical analysis tools and should not be solely relied upon for making trading decisions. Always consider additional factors and consult with a financial professional before making any investment decisions.
Chandelier Exit ZLSMA StrategyIntroducing a Powerful Trading Indicator: Chandelier Exit with ZLSMA
If you're a trader, you know the importance of having the right tools and indicators to make informed decisions. That's why we're excited to introduce a powerful new trading indicator that combines the Chandelier Exit and ZLSMA: two widely-used and effective indicators for technical analysis.
The Chandelier Exit (CE) is a popular trailing stop-loss indicator developed by Chuck LeBeau. It's designed to follow the price trend of a security and provide an exit signal when the price crosses below the CE line. The CE line is based on the Average True Range (ATR), which is a measure of volatility. This means that the CE line adjusts to the volatility of the security, making it a reliable indicator for trailing stop-losses.
The ZLEMA (Zero Lag Exponential Moving Average) is a type of exponential moving average that's designed to reduce lag and improve signal accuracy. The ZLSMA takes into account not only the current price but also past prices, using a weighted formula to calculate the moving average. This makes it a smoother indicator than traditional moving averages, and less prone to giving false signals.
When combined, the CE and ZLSMA create a powerful indicator that can help traders identify trend changes and make more informed trading decisions. The CE provides the trailing stop-loss signal, while the ZLSMA provides a smoother trend line to help identify potential entry and exit points.
In our indicator, the CE and ZLSMA are plotted together on the chart, making it easy to see both the trailing stop-loss and the trend line at the same time. The CE line is displayed as a dotted line, while the ZLSMA line is displayed as a solid line.
Using this indicator, traders can set their stop-loss levels based on the CE line, while also using the ZLSMA line to identify potential entry and exit points. The combination of these two indicators can help traders reduce their risk and improve their trading performance.
In conclusion, the Chandelier Exit with ZLSMA is a powerful trading indicator that combines two effective technical analysis tools. By using this indicator, traders can identify trend changes, set stop-loss levels, and make more informed trading decisions. Try it out for yourself and see how it can improve your trading performance.
Warning: The results in the backtest are from a repainting strategy. Don't take them seriously. You need to do a dry live test in order to test it for its useability.
-
Here is a description of each input field in the provided source code:
length: An integer input used as the period for the ATR (Average True Range) calculation. Default value is 1.
mult: A float input used as a multiplier for the ATR value. Default value is 2.
showLabels: A boolean input that determines whether to display buy/sell labels on the chart. Default value is false.
isSignalLabelEnabled: A boolean input that determines whether to display signal labels on the chart. Default value is true.
useClose: A boolean input that determines whether to use the close price for extrema calculations. Default value is true.
zcolorchange: A boolean input that determines whether to enable rising/decreasing highlighting for the ZLSMA (Zero-Lag Exponential Moving Average) line. Default value is false.
zlsmaLength: An integer input used as the length for the ZLSMA calculation. Default value is 50.
offset: An integer input used as an offset for the ZLSMA calculation. Default value is 0.
-
Ty for checking this out and good luck on your trading journey! Likes and comments are appreciated. 👍
--
Credits to:
▪ @everget – Chandelier Exit (CE)
▪ @netweaver2022 – ZLSMA
Dominant Period-Based Moving Average (DPBMA)Exploit Market Cycles with the Dominant Period-Based Moving Average Indicator
Introduction:
In the world of trading, market cycles play a crucial role in determining the rhythm of the market. These cycles often consist of recurring patterns that traders can exploit to maximize their profits. One effective way to capitalize on these cycles is by using a moving average (MA) indicator. Today, we are going to introduce you to a unique indicator that takes the most frequent dominant period of the market and uses it as the length of the moving average. This indicator is designed to adapt to the ever-changing market conditions, providing traders with a dynamic tool to better analyze the market.
Dominant Period-Based Moving Average Indicator Overview:
The Dominant Period-Based Moving Average (DPBMA) Indicator is a custom indicator designed to find the most frequent dominant period of the market and use that period as the length of the moving average. This innovative approach allows the indicator to adapt to the market cycles, making it more responsive to the market's changing conditions.
Here's a quick overview of the DPBMA Indicator's features:
Takes the most frequent dominant period of the market.
Uses the dominant period as the length of the moving average.
Adapts to the changing market cycles.
Works as an overlay on your price chart.
Using the Dominant Period-Based Moving Average Indicator:
How the Dominant Period-Based Moving Average Indicator Works:
The DPBMA Indicator works by first importing the DominantCycle function from the lastguru/DominantCycle/2 script. This function calculates the dominant cycle period of the given market data. The DPBMA Indicator then calculates the Exponential Moving Average (EMA) using the dominant period as the length parameter.
The EMA calculation uses an alpha factor, which is calculated as 2 / (length + 1). The alpha factor is then used to smooth the source data (closing prices) and calculate the adaptive moving average.
The DPBMA Indicator also includes a harmonic input, which allows you to multiply the dominant cycle period by an integer value. This can help you fine-tune the indicator to better fit your trading strategy or style.
The Raw Dominant Frequency:
The raw dominant frequency represents the primary cycle period present in the given market data. By identifying the raw dominant frequency, traders can gain insights into the market's current cycle and use this information to make informed trading decisions. The raw dominant frequency can be useful for detecting major trend reversals, support and resistance levels, and potential entry and exit points.
However, using the raw dominant frequency alone has its limitations. For instance, it may not always provide a clear picture of the market's prevailing trend, especially during periods of high market volatility. Additionally, relying solely on the raw dominant frequency may not capture the nuances of shorter-term cycles that can also impact price movements.
The Most Likely Dominant Frequency:
Our approach takes a different angle by focusing on the most likely dominant frequency. This method aims to identify the frequency with the highest probability of being the dominant frequency in the market data. The idea behind this approach is to filter out potential noise and improve the accuracy of the dominant frequency analysis. By using the most likely dominant frequency, traders can gain a more reliable understanding of the market's primary cycle, which can lead to better trading decisions.
In our Dominant Period-Based Moving Average Indicator, we calculate the most likely dominant frequency by analyzing an array of cycle periods and their occurrences in the given market data. We then determine the cycle period with the highest occurrence, representing the most likely dominant frequency. This method allows the indicator to be more adaptive and responsive to the changing market conditions, capturing the nuances of both long-term and short-term cycles.
Why Not the Average Dominant Frequency?
While using the average dominant frequency might seem like a reasonable approach, it can be less effective in accurately capturing the market's primary cycle. Averaging the dominant frequencies may dilute the impact of the true dominant frequency, resulting in a less accurate representation of the market's current cycle. By focusing on the most likely dominant frequency, our approach provides a more accurate and reliable analysis of the market's primary cycle, which can ultimately lead to more effective trading decisions.
Conclusion:
The Dominant Period-Based Moving Average Indicator, enhanced with the most likely dominant frequency approach, offers traders a powerful tool for exploiting market cycles. By adapting to the most frequent dominant period and focusing on the most likely dominant frequency, this indicator provides a more accurate and reliable analysis of the market's primary cycle. As a result, traders can make better-informed decisions, ultimately leading to improved trading performance. Incorporate the DPBMA Indicator into your trading toolbox today, and take advantage of the enhanced market analysis it provides.
Simple Moving Average Extrapolation via Monte Carlo (SMAE)In this post, I will dive into my Moving Average Extrapolator, a tool that I created to help traders predict future price movements based on past data. I will discuss the underlying logic, its limitations, and the importance of accounting for delays in the moving average. The following code, my Moving Average Extrapolator, will serve as the basis for our discussion.
The Moving Average Extrapolator uses a simple moving average (SMA) to analyze past price movements and make predictions about future price movements. It uses a Monte Carlo simulation to generate possible future price movements based on historical probabilities.
Let's start by understanding the different components of the code:
The movement_probability function calculates the probability of green and red price movements, where green movements indicate an increase in price, and red movements indicate a decrease in price.
The monte function generates an array of potential price movements using a Monte Carlo simulation.
The sim function uses the generated Monte Carlo array to simulate potential future price movements based on the probabilities calculated earlier.
The draw_lines function draws lines connecting the current price to the extrapolated future price movements.
The extrapolate function calculates the extrapolated future price movements based on the provided source, length, and accuracy.
Limitations of My Moving Average Extrapolator:
Reliance on historical data: My Moving Average Extrapolator relies heavily on historical data to make future price predictions. This can be a limitation, as past performance does not guarantee future results. Market conditions can change, making the extrapolator less reliable in predicting future price movements.
Inherent randomness: The Monte Carlo simulation introduces an element of randomness in the extrapolator's predictions. While this can help in exploring various scenarios, it may not always accurately predict future price movements.
Delay in the moving average: Moving averages inherently have a delay, as they are based on past data. This delay can cause my Moving Average Extrapolator to be less accurate in predicting immediate price movements.
Accounting for Delays in the Moving Average:
It is essential to account for the delay in the moving average to improve the accuracy of my Moving Average Extrapolator. I have taken this into account by introducing a delay variable (delay) in the draw_lines function. The delay variable calculates the delay as half the moving average's length and adjusts the time axis accordingly.
This adjustment helps in reducing the lag in the extrapolator's predictions, making it more accurate and useful for traders. However, it is important to note that even with this adjustment, my Moving Average Extrapolator is still subject to the limitations discussed earlier.
Adding Custom Lookback Period to My Moving Average Extrapolator:
To enhance the functionality and adaptability of my Moving Average Extrapolator, I have implemented an option to set a custom lookback period. The lookback period determines how far back in the historical data the Moving Average Extrapolator should start its analysis.
To achieve this, I have included a method to obtain the current bar index and then calculate the starting bar index by subtracting the desired lookback period.
Here's how to implement the custom lookback period in the Moving Average Extrapolator:
Get the current bar index: I use the bar_index built-in variable to get the current bar index, which represents the current position in the historical data.
Set the start index: To set the start index, you can subtract the desired lookback period from the current bar index. In the code, I have defined a user-input number variable, which can be set to the desired lookback period. By default, it is set to 20800. The starting index for the Moving Average Extrapolator's analysis is calculated as bar_index - number.
Here's the relevant code snippet:
number = input.int(20800, "Bar Start")
And to conditionally run the calculations:
if bar_index > number
draw_lines(avg, extrapolate(close, length, 10), length, extrapolate)
By implementing this custom lookback period, users can easily adjust the starting point of the Moving Average Extrapolator based on their preferences and trading strategies. This allows for more flexibility and adaptability to different market scenarios and ensures that the Moving Average Extrapolator remains a valuable tool for traders.
Conclusion:
My Moving Average Extrapolator can be a valuable tool for traders looking to predict future price movements based on historical data. However, it is essential to understand its limitations and the need to account for the delay in the moving average. By considering these factors, traders can make better-informed decisions and use my Moving Average Extrapolator to complement their trading strategies effectively.
MESThe Double Bollinger Bands strategy is a trend-following strategy that aims to identify high-probability trading opportunities in trending markets. The strategy involves using two sets of Bollinger Bands with different standard deviation values to identify potential entry and exit points.
Bollinger Bands are a technical analysis tool that consists of three lines plotted on a price chart: a simple moving average (SMA) in the middle, and an upper and lower band that are each a certain number of standard deviations away from the SMA. The standard deviation value determines the width of the bands, with a larger deviation resulting in wider bands.
In this indicator, the first set of Bollinger Bands is calculated using a length of 20 bars and a standard deviation of 2, while the second set uses a length of 20 bars and a standard deviation of 3. The bands are plotted on the price chart along with the SMA for each set.
The buy signal is generated when the price falls below the lower band of the second set of Bollinger Bands (the 3-standard deviation band) and then rises above the lower band of the first set (the 2-standard deviation band). This is interpreted as a potential reversal point in a downtrend and a signal to enter a long position.
Conversely, the sell signal is generated when the price rises above the upper band of the second set of Bollinger Bands and then falls below the upper band of the first set. This is interpreted as a potential reversal point in an uptrend and a signal to enter a short position.
To make it easier to identify buy and sell signals on the price chart, the indicator plots triangles above the bars for sell signals and below the bars for buy signals.
Overall, the Double Bollinger Bands strategy can be a useful tool for traders who want to follow trends and identify potential entry and exit points. However, as with any trading strategy, it is important to backtest and thoroughly evaluate its performance before using it in live trading.
Mean ReversionThe "Mean Reversion" indicator in this script is a popular trading strategy that is based on the concept that over time, prices tend to move back towards their mean or average. This trading strategy seeks to identify instances where the price has deviated significantly from its mean and therefore presents an opportunity to profit from its eventual reversion to the mean.
The script calculates the distance between the current price and the EMA using the ATR, which is a measure of volatility. By multiplying the ATR by a specified factor, the script establishes a distance between the current price and the EMA. If the price falls below this distance, it triggers a potential buy signal, indicating that the price may be oversold and due for a rebound.
The script also uses Bollinger Bands to help identify potential buying and selling opportunities. The Bollinger Bands are a technical indicator that measures the volatility of an asset by plotting two standard deviations away from a moving average. When the price moves outside of the Bollinger Bands, it can indicate that the asset is overbought or oversold, potentially triggering a buy or sell signal.
The script's "buySignal" variable is triggered when the price is below the EMA by the specified ATR distance and also falls below the lower Bollinger Band. Conversely, the "sellSignal" variable is triggered when the price is above the EMA by the specified ATR distance and also rises above the upper Bollinger Band.
The script plots the EMA, Bollinger Bands, and the buy and sell signals on the chart for easy visualization. Additionally, the script includes alerts that can be set up to notify the user when a buy or sell signal is triggered, so that they can act on the information in a timely manner.
In summary, this script is a Mean Reversion indicator that aims to identify potential opportunities to buy or sell assets based on deviations from their mean price using a combination of the ATR, EMA, and Bollinger Bands.
T3 OscillatorTL;DR - An Oscillator based on T3 moving average
The T3 moving average is a well known moving average created by Tim TIllson. Oscillator values are created by using the simple formula "source (close by default) - T3 moving average". Tim Tillson used a "volume factor" of 0.7 in his original T3 calculation. I changed this value to 0.618 and added the option to change it if needed/wanted. I also added alarms for zero line crossing upwards and downward, a smoothing option and custom time frames.
Compared to other oscillators like TSI, MACD etc. I observed better signals, especially in trending market situations, from the T3 oscillator (I tested Forex and Crypto).
Usage is simple: If the oscillator is above 0 it indicates a bearish trend. If below 0 it indicates a bullish trend. -> Really simple to use. However it can also be used to determine micro trends and reversals when combined with price action analysis. To keeps things simple I have not added a moving average like many other oscillators because I think it is confusing and does not help (in this particular case).
P.S. I haven't found a T3 oscillator on Trading View. Code is free - do whatever you want with it ;)