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.
Moving Averages
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.
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 ;)
Fetch ATR + MA StrategyA trend following indicator that allows traders/investors to enter trades for the long term, as it is mainly tested on the daily chart. The indicator fires off buy and sell signals. The sell signals can be turned off as trader can decide to use this indicator for long term buy signals. The buy signals are indicated by the green diamonds, and the red diamonds show the points on then chart where the asset can be sold.
The indicator uses a couple indicators in order to generate the buy signals:
- ADX
- ATR
- Moving Average of ATR
- 50 SMA
- 200 SMA
The buy signal is generated at the cross overs of the 50 and 200 SMA's while the ATR is lower than then Moving Average of the ATR. The buy signal is fired when these conditions are met and if the ADX is lower than 30.
The thought process is as follows:
When the ATR is lower than its moving average, the price should be in a low volatilty environment. An ADX between 25 and 50 signals a Strong trend. Every value below 25 is an absent or weak trend. So entering a trade when the volatilty is still low but increasing, you'll be entering a trade at the start of a new uptrend. This mechanism also filters out lots of false signals of the simple cross overs.
The sell signals are fired every time the 50 SMA drops below the 200 SMA.
BUY/SELL + ADVANCE DECLINEThis script is a custom trading view indicator that helps to identify potential buy and sell signals based on the RSI (Relative Strength Index) and SMA (Simple Moving Average) indicators. The script also identifies potential reversals using a combination of RSI and price action. It plots buy, sell, and reversal signals on the chart along with an SMA line. Additionally, it provides alerts based on the buy, sell, and reversal conditions.
Changes made to the original script:
Fixed the undeclared identifier 'c' error by calculating the difference between the current closing price and the previous closing price: c = close - close .
Added an "ADD Value Floating Label" to the chart. The label shows the difference between the current and previous closing prices (ADD value) along with a "Bullish" or "Bearish" indicator based on the value of 'c'. The label is positioned at the top right of the visible chart area and remains static.
Here's a summary of the major components of the script:
Input settings: Define the input parameters for RSI and SMA.
Calculation of RSI and SMA: Compute the RSI and SMA values based on the input parameters.
Color definitions: Define colors for different conditions and levels.
Condition definitions: Define various conditions for buy, sell, reversal, and other criteria.
Buy and sell conditions: Determine buy and sell signals based on RSI, SMA, and price action.
Reversal conditions: Identify potential reversals using RSI and price action.
Plot signals: Display buy, sell, and reversal signals on the chart.
Bar colors: Color the bars based on the identified signals.
Plot SMA: Display the SMA line on the chart.
Alert conditions: Set up alerts for buy, sell, and reversal conditions.
ADD Value Floating Label: Add a label to the chart showing the ADD value and a "Bullish" or "Bearish" indicator.
Custom Log 21 Week SMAThe Custom Log 21 Week SMA (CL21SMA) indicator is a custom technical analysis tool that calculates and plots the log values of the asset's price relative to its 21-week simple moving average (SMA). This indicator can be used to identify potential trends and price deviations from the moving average.
The CL21SMA indicator performs the following calculations:
Compute the 21-week simple moving average (SMA) of the asset's closing price.
Calculate the log values by dividing the closing price by the 21-week SMA and then taking the base-10 logarithm of the result.
Plot the log values on the chart.
The CL21SMA indicator can help traders to:
Identify potential trends: A positive log value suggests that the price is above the 21-week SMA, indicating a potential uptrend. Conversely, a negative log value implies that the price is below the 21-week SMA, suggesting a potential downtrend.
Detect price deviations: Significant deviations from the 21-week SMA, as indicated by the log values, may highlight potential overbought or oversold conditions, which could prompt traders to take appropriate positions.
Please note that the CL21SMA indicator is best suited for longer-term analysis and should be used in conjunction with other technical indicators and trading strategies to improve the overall decision-making process.
[MiV] Trading SessionHello, everyone!
Today I want to present my new script, which I hope will help not only me!
I'm sure that many people, like me, went through such a stage as "building their strategy". This is when you sit and test on the history how you would enter or exit a trade.
Recently I was doing the same thing and realized that my "tests" involve night time, when in reality I would be asleep and not trading! So I decided to create an indicator that would display my "working hours" so that the backtest I conduct would be as realistic as possible.
Also this indicator is able to display sessions of major exchanges and forex working hours, so it will be useful not only for cryptocurrency lovers.
In addition, we don't always trade every day and, for example, I don't trade on Sunday. That's why we added a feature that "turns off" the day and does not highlight it in color if you're not planning to trade on that day.
And finally, I added a notification of the beginning and end of the trading session. A small thing, but it may also be a useful feature for those who like to sit at the chart!
I will be glad to receive any comments and suggestions!
-----
Всем привет!
Хочу сегодня представить свой новый скрипт, который, надеюсь, поможет не только мне!
Уверен, что многие, как и я, проходили такой этап как "постройка своей стратегии". Это когда ты сидишь и тестируешь на истории то как бы ты входил или выходил из сделки.
Вот недавно я ровно также занимался этим и осознал, что мои "тесты" затрагивают и ночное время, когда в реальности я бы спал и не торговал! Поэтому я решил создать индикатор, который будет отображать мои "рабочие часы", чтобы бектест, который я провожу, был максимально реалистичным.
Также данный индикатор умеет отображать сессии крупных бирж и время работы форекса, так что полезным он будет не только для любителей криптовалюты.
Кроме того, мы же не всегда торгуем каждый день и например я не торгую в воскресенье. Поэтому добавлен функционал, который "выключает" день и не подсвечивает его цветом, если ты в этот день не планируешь торговать.
Ну и в заключении, добавил уведомление о начале и завершении торговой сессии. Мелочь, а тоже может быть полезной фичей для тех кто любит засесть за графиком!
Буду рад любым замечаниям и предложениям!
RSI Exponential Smoothing (Expo)█ Background information
The Relative Strength Index (RSI) and the Exponential Moving Average (EMA) are two popular indicators. Traders use these indicators to understand market trends and predict future price changes. However, traders often wonder which indicator is better: RSI or EMA.
What if these indicators give similar results? To find out, we wanted to study the relationship between RSI and EMA. We focused on a hypothesis: when the RSI goes above 50, it might be similar to the price crossing above a certain length of EMA. Similarly, when the RSI goes below 50, it might be similar to the price crossing below a certain length of EMA.
Our goal was simple: to figure out if there is any connection between RSI and EMA.
Conclusion: Yes, it seems that there is a correlation between RSI and EMA, and this indicator clearly displays that relationship. Read more about the study here:
█ Overview of the indicator
The RSI Exponential Smoothing indicator displays RSI levels with clear overbought and oversold zones, shown as easy-to-understand moving averages, and the RSI 50 line as an EMA. Another excellent feature is the added FIB levels. To activate, open the settings and click on "FIB Bands." These levels act as short-term support and resistance levels which can be used for scalping.
█ Benefits of using this indicator instead of regular RSI
The findings about the Relative Strength Index (RSI) and the Exponential Moving Average (EMA) highlight that both indicators are equally accurate (when it comes to crossings), meaning traders can choose either one without compromising accuracy. This empowers traders to pick the indicator that suits their personal preferences and trading style.
█ How it works
Crossings over/under the value of 50
The EMA line in the indicator acts as the corresponding 50 line in the RSI. When the RSI crosses the value 50 equals when Close crosses the EMA line.
Bouncess from the value 50
In this example, we can see that the EMA line on the chart acts as support/resistance equals when RSI rejects the 50 level.
Overbought and Oversold
The indicator comes with overbought and oversold bands equal when RSI becomes overbought or oversold.
█ How to use
This visual representation helps traders to apply RSI strategies directly on the price chart, potentially making RSI trading easier for traders.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!