Volume Weighted Pivot Point Moving Averages VPPMAAs traders and investors, we are constantly on the lookout for tools that can assist us in making informed decisions. While there are countless technical analysis tools available, sometimes even small, simple scripts can provide valuable insights. In this post, we will explore the Volume-Weighted Pivot Point Moving Average (PPMA) Indicator – a modest yet helpful script that could potentially enhance your trading experience.
Background
// © peacefulLizard50262
//@version=5
indicator("PPMA", overlay = true)
vppma(left, right)=>
signal = ta.change(ta.pivothigh(high, left, right)) or ta.change(ta.pivotlow(low, left, right))
var int count = na
var float sum = na
var float volume_sum = na
if not signal
count := nz(count ) + 1
sum := nz(sum ) + close * volume
volume_sum := nz(volume_sum ) + volume
else
count := na
sum := na
volume_sum := na
sum/volume_sum
left = input.int(50, "Pivot Left", 0)
plot(vppma(left, 0))
The Concept Behind PPMA Indicator
The Volume-Weighted Pivot Point Moving Average (PPMA) Indicator is a straightforward technical analysis tool that aims to help traders identify potential market turning points and trends. It does this by calculating a moving average based on price and volume data while considering pivot highs and pivot lows. The PPMA Indicator is designed to be more responsive than traditional moving averages by incorporating volume into its calculations.
Understanding the Script
The script is compatible with version 5 of the TradingView Pine Script language, and it features an overlay setting, allowing the indicator to be plotted directly onto the price chart. The customizable pivot left input enables traders to adjust the sensitivity of the pivot points.
The script first identifies pivot points, which are areas where the price changes direction. It then calculates the volume-weighted average price (VWAP) of each trading period between the pivot points. Finally, it plots the PPMA line on the chart, providing a visual representation of the volume-weighted average prices.
Using the PPMA Indicator
To use the PPMA Indicator, simply add the script to your TradingView chart. The indicator will plot the PPMA line directly onto the price chart. You can adjust the pivot left input to modify the sensitivity of the pivot points, depending on your preferred trading style.
When the PPMA line is trending upward, it may indicate a potential bullish trend. Conversely, a downward-trending PPMA line could suggest a bearish trend. The PPMA Indicator can be used in conjunction with other technical analysis tools to confirm potential trend changes and to establish entry or exit points for trades.
Conclusion
While the Volume-Weighted Pivot Point Moving Average (PPMA) Indicator may not be a game-changer, it is a modest yet helpful tool for traders looking to enhance their technical analysis. By incorporating volume into its calculations, the PPMA Indicator aims to provide more responsive signals compared to traditional moving averages. As with any trading tool, it is crucial to conduct your own analysis and combine multiple indicators before making any trading decisions.
Скользящие средние
Simple Moving Average Slope [AstrideUnicorn]The Simple Moving Average Slope indicator (SMAS) is a technical analysis tool designed to help traders detect the direction and strength of the current trend in the price of an asset. It is also a great tool for identifying sideways markets. The indicator plots the slope of a simple moving average (SMA) of the closing prices over a specified time period. The slope is normalized by dividing it by the standard deviation of the slope over a longer time period.
HOW TO USE
Traders can use the Simple Moving Average Slope indicator in various ways. One common way is to look for bullish or bearish signals. A bullish signal occurs when the normalized slope rises above a predetermined threshold, resulting in the indicator turning green, indicating an upward trend in the market. Conversely, a bearish signal is generated when the normalized slope falls below the negative value of the threshold, causing the indicator to turn red, signaling a downtrend in the market. When the normalized slope falls between the positive and negative threshold values, a neutral signal is generated, indicating that the market is moving sideways. This can help traders avoid false trend signals from other indicators and strategies that may occur when the market is in a sideways regime. Additionally, traders can use the Simple Moving Average Slope indicator in conjunction with other technical indicators to confirm the trend direction.
SETTINGS
Window - specifies the number of bars used to calculate the SMA slope. The default value is 20.
Threshold - specifies the threshold value used to generate the bullish and bearish signals. The default value is 0.6. Traders can adjust these settings based on their trading strategy and the asset being analyzed.
Aggregate Medians [wbburgin]This indicator recursively finds the average of all high/low medians under your chosen length. This can be very, very helpful for analyzing trends where a moving average or a normal median would produce a bunch of false signals.
Settings:
The "Length" setting is the maximum median that you want the algorithm to add into the sum. The "Start at Period" setting is the the minimum median that you want the algorithm to take into account. Starting at a higher period means that the faster, more sensitive medians of lower lengths are not included, and will smooth out your curve.
I haven't seen many recursive algorithms on TradingView so feel free to use this script as inspiration for any of your ideas. In theory, you can essentially replace the median function with any other function - a moving average, a supertrend, or anything else.
The start must be lower than the length, because this is a sum from the start to the length of all medians in between.
EMA + ATR Support and Resistance + Take Profit SignalThe 'EMA+ ATR Support Resistance Take Profit signal' indicator is a technical analysis tool designed to help traders identify potential support and resistance levels, using the Exponential Moving Average (EMA) and the Average True Range (ATR) indicators. This indicator not only tracks the EMA and ATR but also plots these levels as support and resistance lines, providing useful insights into potential buy and sell points.
The indicator allows you to set the lengths for both the EMA and ATR, with default values set to 20 and 14, respectively. Moreover, you can specify the multiplier for the ATR in the Support/Resistance (S/R) length setting, which defaults to 2. The line width for the plotted lines can also be adjusted according to your preference.
The EMA line in center is invisible by default but you can change that by going to the setting of the indicator. The support and resistance lines are plotted in green and red, respectively. When the price hits the support or resistance levels, the indicator provides a visual signal with a cross shape below or above the respective bars, in lime and red, respectively. If you do not need the take profit signals you can disable them in the setting.
How to Use:
1. Define the EMA and ATR lengths according to your trading strategy. Higher lengths will provide smoother lines but may also lag the current price action.
2. Set the S/R length to determine the distance of the support and resistance lines from the EMA line. Higher values will place these lines further away from the EMA.
3. Monitor the chart for instances when the price hits the support or resistance levels. This is indicated by a cross shape below (for support hit) or above (for resistance hit) the price bar. These points may be considered as potential take profit points or entry/exit points, depending on your strategy.
4. Use the indicator in conjunction with other tools and indicators to confirm signals and reduce the risk of false signals. So the assumption is you enter a trade using your other indicators but you can rely on this indicator to remind you to take profit if you are long by a red cross of the resistance line and if you are short reminds you by a green cross on the support line.
Disclaimer: This indicator should not be used as the sole determinant for any investment decision. Always conduct thorough research and consider multiple factors before trading.
Display Trade Volume with MA Angle and Price VelocityThis Pine Script indicator is designed to provide traders with a visual representation of trade volume, moving average (MA) angle, and price velocity on a chart. The primary components of this indicator are:
Trade Volume: The indicator compares the current bar's trade volume with the average volume over a user-defined lookback period. The volume is displayed as either "Low" or "Trade" in a table, with red or green background color, respectively, to indicate whether it's below or above the average volume.
MA Angle: The indicator calculates the angle of the moving average (either Simple, Exponential, or Hull) over a user-defined length. A positive angle is shown in green, while a negative angle is shown in red. The angle is displayed in degrees in the table.
Price Velocity: This component calculates the velocity of price movement by comparing the difference between high and low prices over a user-defined lookback period. It then displays the velocity as either "Slow" or "Fast" in the table, with red or green background color, respectively, depending on whether it's below or above the average difference.
The indicator also includes alert conditions for high and low volume situations, notifying the trader when the current bar's volume is significantly higher or lower than the average volume.
User Defined Momentum Change with Swing VisualsThis script is a groundbreaking, math-centric technical analysis tool that blends two well-established indicators, the Stochastic Oscillator and the Exponential Moving Average (EMA), to deliver a unique and visually engaging way of identifying momentum swings and stochastic indicators. Unlike mashups, this script is tailored to accommodate a wide range of trading strategies, providing traders with a distinctive perspective on market trends.
The innovation in this script lies in its mathematically-driven ability to effectively combine the Stochastic Oscillator and EMA, setting it apart from other available tools that simply offer a rehash of old ideas or slight modifications to popular indicators. The EMA is employed instead of a Simple Moving Average (SMA), enhancing the uniqueness of the calculations. This novel approach creates a new dimension for traders to evaluate potential momentum swings and visualize them on the chart, proving it to be more than just a mere mashup of existing indicators.
Central to the script's utility is its extensive customization options, which allow traders to adjust various inputs to suit their preferences and trading strategies. Users can modify the EMA length, swing range signal offsets, and smoothing factors for both the fast and slow components of the Stochastic Oscillator. Additionally, the script offers the ability to personalize the color thresholds, transparency, and line properties for the Stochastic Oscillator and swing range signal.
This script's visually dynamic representation of momentum swings empowers traders to make more informed trading decisions, particularly on the 6-hour timeframe. The swing range signal, represented by vertical lines on the chart, acts as a valuable visual aid for identifying potential entry or exit points. Furthermore, the Stochastic Oscillator provides insights into the strength and direction of momentum, which is beneficial for confirming potential trade signals.
To conclude, this script is not just another combination of MAs or a slightly modified version of a popular indicator. Instead, it offers traders a comprehensive, visually appealing, and customizable tool for technical analysis, which is both original and useful. By uniquely combining the EMA and the Stochastic Oscillator with a strong mathematical foundation, and allowing traders to adjust a variety of settings, this script adds value to the TradingView community and enhances the body of knowledge available for traders. It is designed to support traders in tailoring their analysis based on their own strategies and preferences, enabling them to make well-informed decisions in the financial markets.
Momentum-Adjusted Volatility Ratio (MAVR)The Momentum-Adjusted Volatility Ratio (MAVR) indicator is designed to help you understand the strength of price movements relative to the market's volatility. It combines the concepts of rate of change (ROC) and average true range (ATR) and then calculates their ratio, which is then smoothed using an exponential moving average (EMA). Here's a general guide on how to use the MAVR indicator:
Identify the trend: Look for the overall direction of the EMA of the MAVR. When the EMA is above the zero line, it indicates that the momentum is positive and the trend is generally bullish. Conversely, when the EMA is below the zero line, it indicates that the momentum is negative, and the trend is generally bearish.
Assess momentum strength: Pay attention to the distance between the EMA of the MAVR and the zero line. A larger distance indicates a stronger momentum, while a smaller distance suggests weaker momentum. If the EMA of the MAVR moves further away from the zero line, it indicates that the price movement is becoming more robust relative to the market's volatility.
Look for potential entry and exit signals: When the EMA of the MAVR crosses the zero line, it could provide a potential trading signal. For instance, a cross from below to above the zero line may indicate a potential buying opportunity, while a cross from above to below the zero line may signal a potential selling opportunity. Keep in mind that the MAVR indicator should not be used in isolation, and it's essential to combine it with other technical analysis tools and risk management techniques.
Monitor for divergences: Sometimes, the price and the EMA of the MAVR can show divergences. For example, if the price makes a higher high while the EMA of the MAVR makes a lower high, it could signal a bearish divergence, suggesting a potential trend reversal. Similarly, if the price makes a lower low while the EMA of the MAVR makes a higher low, it could indicate a bullish divergence, suggesting a possible trend reversal.
Remember that no indicator is perfect, and the MAVR should be used in conjunction with other technical analysis tools and a solid trading strategy to increase the chances of success. Always use proper risk management techniques to protect your capital.
ATR Adaptive EMA (AEMA)In the world of trading, it's essential to stay ahead of the curve and adapt to the ever-changing market conditions. One of the key aspects of successful trading is using the right tools to analyze and predict market trends. Traditional moving averages, such as the exponential moving average (EMA), have been a staple of technical analysis for decades. However, the limitations of fixed EMA lengths have prompted traders to look for more adaptable and dynamic alternatives. This is where our innovative Adaptive EMA Length Indicator, based on ATR, comes into play.
An Overview of the Adaptive EMA Length Indicator
Our Adaptive EMA Length Indicator is a powerful and versatile tool that utilizes the Average True Range (ATR) to dynamically determine the ideal EMA length based on current market conditions. This unique approach offers traders an edge by providing a more accurate representation of market trends, enabling them to make more informed trading decisions.
Key Features of the Adaptive EMA Length Indicator
Utilizing ATR for Enhanced Volatility Analysis: The Average True Range (ATR) is a well-established measure of market volatility. By incorporating ATR in our indicator, we ensure a more accurate representation of market conditions, allowing traders to better adapt their strategies to the prevailing volatility levels.
Customizable Parameters: Our Adaptive EMA Length Indicator allows traders to adjust key parameters, such as minimum and maximum EMA lengths, ATR length, outlier length, and outlier deviation level. This level of customization gives traders the ability to fine-tune the indicator according to their trading style and preferences.
Versatile Application Across Markets: The Adaptive EMA Length Indicator is designed to work with various financial markets, including stocks, commodities, and cryptocurrencies. Its versatility makes it a valuable addition to any trader's toolkit, regardless of their chosen market.
How to Use the Adaptive EMA Length Indicator
Set your preferred parameters: Begin by adjusting the minimum and maximum EMA lengths, ATR length, outlier length, and outlier deviation level to fit your trading style.
Apply the indicator to your chosen market: Add the Adaptive EMA Length Indicator to your chart and observe the dynamic EMA line adjusting based on current market conditions.
Use the dynamic EMA for trade entry and exit points: Monitor the EMA line in relation to the price action. When the price crosses the EMA line from below, consider it a potential buy signal. Conversely, when the price crosses the EMA line from above, it could indicate a sell signal. However, it's crucial to consider other technical analysis tools and market factors before making any trading decisions.
Continuously assess and adjust: As with any trading strategy, it's essential to keep monitoring market conditions and adjusting your parameters accordingly. Stay vigilant and be prepared to adapt your strategy as needed.
Our Adaptive EMA Length Indicator, based on ATR, offers a revolutionary approach to determining the ideal EMA length. By providing a more accurate representation of market trends, this innovative tool empowers traders to make better-informed decisions and stay ahead of the market. Try it out for yourself and see why it's a game-changer for traders seeking adaptable, dynamic, and effective trading strategies.
EMA bridge and dashboard with color coding.
Summary:
This is a custom moving average indicator script that calculates and plots different Exponential Moving Averages (EMAs) based on user-defined input values. The script also displays MACD and RSI, and provides a table that displays the current trend of the market in a color-coded format.
Explanation:
- The script starts by defining the name of the indicator and the different inputs that the user can customize.
- The inputs include bridge values for three different EMAs (high, close, and low), and four other EMAs (5, 50, 100, and 200).
- The script assigns values to these inputs using the `ta.ema()` function.
- Additionally, the script calculates EMAs for higher timeframes (3m, 5m, 15m, and 30m).
- The script then plots the EMAs on the chart using different colors and line widths.
- The script defines conditions for going long or short based on the crossover of two EMAs.
- It plots triangles above or below bars to indicate the crossover events.
- The script also calculates and displays the RSI and MACD of the asset.
- Finally, the script creates a table that displays the current trend of the market in a color-coded format. The table can be positioned on the top, middle, or bottom of the chart and on the left, center, or right side of the chart.
Parameters:
- i_ema_h: Bridge value for high EMA (default=34)
- i_ema_c: Bridge value for close EMA (default=34)
- i_ema_l: Bridge value for low EMA (default=34)
- i_ema_5: Value for 5-period EMA (default=5)
- i_ema_50: Value for 50-period EMA (default=50)
- i_ema_100: Value for 100-period EMA (default=100)
- i_ema_200: Value for 200-period EMA (default=200)
- i_f_ema: Value for fast EMA used in MACD calculation (default=9)
- i_s_ema: Value for slow EMA used in MACD calculation (default=21)
- fastInput: Value for fast length used in MACD calculation (default=7)
- slowInput: Value for slow length used in MACD calculation (default=14)
- tableYposInput: Vertical position of the table (options: top, middle, bottom; default=middle)
- tableXposInput: Horizontal position of the table (options: left, center, right; default=right)
- bullColorInput: Color of the table cell for a bullish trend (default=green)
- bearColorInput: Color of the table cell for a bearish trend (default=red)
- neutColorInput: Color of the table cell for a neutral trend (default=white)
- neutColorLabelInput: Color of the label for neutral trend in the table (default=fuchsia)
Usage:
To use this script, simply copy and paste it into the Pine Editor on TradingView. You can then customize the input values to your liking or leave them at their default values. Once you have added the script to your chart, you can view the EMAs, MACD, RSI, and trend table on the chart. The trend table provides a quick way to assess the current trend of the market at a glance.
Adaptive MACDIntroducing the "Adaptive MACD" indicator, an innovative and user-friendly script that utilizes the PeacefulIndicators library to provide traders with a dynamic and responsive version of the classic MACD indicator. This script effectively adapts the MACD calculation to account for the dominant market cycle, offering improved signals to help you make better-informed trading decisions.
The Adaptive MACD indicator incorporates the following features:
A selection of customizable input parameters, allowing you to adjust the short length, long length, signal length, and the dynamic high and low values to suit your individual trading preferences.
A visually appealing and informative display, using different colors to highlight MACD line crossovers and histogram bars, making it easier to interpret the indicator's signals.
The core functionality of the Adaptive MACD is powered by the macdDynamicLength function from the PeacefulIndicators library, ensuring accurate and reliable calculations.
To start using the Adaptive MACD indicator in your trading analysis, simply add the script to your chart, and customize the input parameters as needed. We hope this script, built upon the PeacefulIndicators library, proves to be a valuable addition to your trading strategy.
Higher TimeFrame Smooth Moving AveragesScript is designed for those who dislike how plotting a moving average from a higher timeframe on a lower timeframe chart results in a choppy zigzag line when using the standard request.security(syminfo.ticker,"x",ta.sma(src,len)) method.
My more elegant solution was to translate the chart's current timeframe, and the selected higher timeframe into seconds, then check if selected timeframe is Larger than chart timeframe, but not so large that too many bars would be necessary. Then the quotient is calculated by dividing the chosen timeframe (value in seconds) by the chart's timeframe (value in seconds).
Then take that quotient and multiply it by the chosen length. This gives us how many bars of the chart's timeframe would be used in calculating the higher timeframe Moving Average
Use the value to calculate a moving average of choice (SMA,EMA,WMA,LRC,DEMA,TEMA,TRIMA,FRAMA) thanks to @TradingView 's ta library () and @alexgrover 's () for their functions supporting series as length, making this possible.
Basically, get how many of the current chart's bars are in the higher timeframe moving average and use that as the length for calculation using chart's timeframe.
If the higher timeframe relative is too large relative to chart's timeframe, due to bar referencing limits some combinations may not be possible under current limitations, but most will work by either moving chart's timeframe higher or higher timeframe lower assuming you aren't trying to do something too extreme like plotting a weekly moving average onto a 30 second chart etc.
Advanced Price Direction bar colorsIn the advanced price direction algorithm situations of faltering price directions (fda) are identified.
These are very interesting, because this happens at tops, flags and trend turns.
I got the idea of coloring the bars with fda in a distinguishing color, reddish gray for fda down and blueish gray for faltering up.
The remaining bars retain standard color, but now this color 'confirms' the trend.
To show that this is true, I also plot a simple moving average (sma) with the same length in the chart.
It turns out that somehow the bars react to being above or below the sma, but also react to the direction of the sma.
Very interesting.
Have fun
KDJ Indicator with RSI FilterThe KDJ indicator is a technical analysis tool used by traders to identify potential buy and sell signals in financial markets. It is an extension of the Stochastic Oscillator, which consists of two lines, %K and %D, that move within a range of 0 to 100. The KDJ indicator introduces a third line, called %J, which is derived from the %K and %D lines. The KDJ indicator is primarily used to identify overbought and oversold conditions, as well as potential trend reversals.
Here's a brief overview of the KDJ indicator's components:
%K line: It is calculated by comparing the current closing price to the range of high and low prices over a specific period (usually 9 days).
%D line: It is a moving average of the %K line
%J line: It is calculated using the %K and %D lines
The KDJ indicator generates buy signals when the %K line crosses above the %D line and sell signals when the %K line crosses below the %D line. Additionally, when the %J line is above 100, it suggests that the asset is overbought, and when the %J line is below 0, it suggests that the asset is oversold. Traders often use these overbought and oversold signals to identify potential trend reversals.
I have taken KDJ script from and added RSI filter and alerts with and without RSI filter.
I was requested to create this script with alerts. And here it is. I have added alerts. And, I have added abilities to turn on and off the RSI filters from settings.
BB_MDL_V1Simple indicator that is based on the average line of the bollinger bands and the exponential average of 200 periods.
The customizable variable is bollinger bands length, currently the default is 35, you can tweak it to your liking and see how trend identification changes.
My recommendation is to work in 5-minute time frames in values such as SOL, FTM or MASK (cryptos)
This simple strategy can be combined with many others to gain more insight and get better market entries and exits.
[blackcat] L1 An Adaptive Moving Average For Swing TradingLevel 1
Background
Scott Cong published an article of “An Adaptive Moving Average For Swing Trading” on April 2023. I rewrite it for pine script.
Function
In "An Adaptive Moving Average For Swing Trading," author Scott Cong introduces a new adaptive moving average that is designed to be responsive, smooth, and robust. He begins with a discussion of Perry Kaufman's adaptive moving average and explains how an adaptive moving average (AMA) can adapt to different market environments. Later he explains his methods of adjusting and changing the smoothing factor, which has better response than traditional EMA and SMA. I rewrited this new kind of moving average in pine script and use yellow color for its fast line while fuchsia color for its trigger signal as a slow line. By the way, divergence detector is also added for divergence notification. You can change period or length, and signal source parameters in setting dialog.
Remarks
Feedbacks are appreciated.
Universal MA Trend(Republishing in Open source)
Hello traders,
Many existing moving average indicators have not been satisfactory in terms of the number, types, and length adjustments of moving averages.
Feeling the inconvenience, I created a moving average indicator and collected numerous famous moving averages.
Fortunately, there was a PineCoder "andre_007" who had already compiled various Moving Averages,
so I was able to find a new Moving Average and combine it with the indicator. Here is the link below
Among these, for the JMA, which has not been publicly disclosed, I utilized the source code from TradingView Wizard everget:
For VIDYA, I also used everget's source code:
And also MAMA / FAMA Coded from Pinescript Wizard everget :
Ehlers MESA Adaptive Moving Averages (MAMA & FAMA)
For Frama, I used the code from nemozny's source code :
Thanks to all these Pinecoders.
---
By using these excellent moving averages together, I found that the simultaneous Up/Down changes of various moving averages with different characteristics tend to be maintained for quite a long time.
Therefore, this indicator not only collects various moving averages but also displays areas with simultaneous trends as background.
An example can be found here:
Furthermore, to prevent the up/down changes of the moving averages due to factors like whipsaws, a smoothing filter has been introduced.
And Also, Alert is able when trend changes.
---
(오픈소스화 후 재발행)
안녕하세요 트레이더여러분.
기존의 이동평균선 지표들은, 이동평균선의 갯수, 종류, 길이조절 등에서 만족스럽지 못한 점들이 많았습니다.
불편함을 느끼고 직접 이동평균선 지표를 만들면서, 유명한 수 많은 이동평균선들을 모았습니다.
그리고 이미 이러한 수많은 이동평균선을 손수 모아서 정리해주신 고마우신 파인코더(andere_007 님)가 있어서, 그 분의 코드를 많이 이용했습니다. 링크는 아래와 같습니다.
이 중 소스가 공개되지 않은 이동평균선 중 JMA는 트레이딩뷰 위자드이신 everget의 소스코드를 이용했습니다.
VIDYA 역시 everget의 소스코드를 이용했습니다.
MAMA와 FAMA의 코드 역시 everget님의 코드를 가져왔습니다.
Ehlers MESA Adaptive Moving Averages (MAMA & FAMA)
Frama는 nemozny님의 코드를 이용했습니다.
의 코드를 이용했습니다.
이 자리를 빌어 위의 파인코더님들께 감사의 말씀을 전합니다.
---
이러한 좋은 이동평균선을 모아서 사용해보니, 다양한 특성을 갖고 있는 이동평균선의 동시적인 Up/Down 변화는 꽤 오랫동안 유지된다는 점을 발견했습니다.
그래서 이 지표는, 위의 여러가지 이동평균선을 모아놓은 것 뿐만 아니라,
그것에서 동시적인 트랜드가 나오는 곳을 배경화면으로 표시해두었습니다.
예시는 다음과 같습니다.
나아가 휩쏘 등으로 이동평균선의 up/down이 바뀌는 것을 막고자, Smoothing 필터도 도입했습니다.
또한 트랜드가 바뀔 때 얼러트가 울리도록, 얼러트 기능을 설정해놓을 수 있게 해놓았으며, 현재 이동평균선과 상태를 보기 쉽도록 테이블을 만들어놓았습니다.
Ema Short Long Indicator[CHE]█ CONCEPTS
This Pine Script is an EMA Short Long indicator that displays the crossing EMA lines on the chart. The indicator uses three exponential moving averages (EMAs) to generate the buy and sell signals. The EMA lines are plotted as green (uptrend) and red (downtrend) lines. When the green line is above the white signal line, the indicator generates a buy signal, when the green line is below the white signal line, the indicator generates a sell signal. Arrows are also displayed marking the buy and sell signals. There is also an option to allow indicator repainting or not. Finally, users can also set alerts to be alerted to potential trading opportunities.
Note: please do not disable "time frame gaps". Allows to calculate the indicator on a Timeframe (TF) different from that of the chart Time window. The TF should ideally be higher than the charts to provide a broader perspective than
the TF of the chart. Using TFs lower than the chart's will deliver fragmentary results, since only the last value of intrabar is displayed (multiple values cannot be displayed for a single chart bar). The Gaps setting determines the behavior when the TF is higher than the TF of the chart. If 'gaps' is checked, higher TF values only come in and are interconnected on the diagram when the higher TF completed. This has the advantage of avoidance Real-time epainting. If Gaps is not enabled, Gaps are filled with the last higher TF value calculated, which will not produce a repaint Values on historical bars but repaint values realtime.
█ HOW TO USE IT
Load the indicator on an active chart (see the Help Center if you don't know how).
Time period
By default, the script uses an auto-stepping mechanism to adjust the time period of its moving window to the chart's timeframe. The following table shows chart timeframes and the corresponding time period used by the script. When the chart's timeframe is less than or equal to the timeframe in the first column, the second column's time period is used to calculate the Ema Short Long Indicator :
Chart Time
timeframe period
1min 🠆 1H
5min 🠆 4H
1H 🠆 1D
4H 🠆 3D
12H 🠆 1W
1D 🠆 1M
1W 🠆 3M
█ DESCRIPTION
The script begins by setting up the chart indicator with a short title, "ESLI", and enabling it as an overlay. It then initializes several variables for time conversions, to be used later in the script.
The timeStep_translate() function converts the timeframe of the chart into a string representing a larger time interval, based on the number of seconds in the timeframe. The resulting string is used to label the horizontal axis of the chart.
Next, the script defines several input variables that can be modified by the user. These include the colors of the EMA lines and the signals, whether or not the indicator is allowed to repaint (i.e. update past values based on future data), and the number of periods used to calculate the EMA and signal lines.
The f_security() function calls the request.security() function to fetch data from the specified security and timeframe, and is used to calculate the EMA and signal lines using the ta.ema() function. The clo variable is assigned the closing price data, adjusted for repainting and timeframe.
The EMA line is calculated using a weighted average of the EMA over the specified period and two times that period, as well as three times that period, divided by six. The signal line is calculated as the EMA of the EMA line over the specified period.
The col_css variable sets the color of the EMA line based on whether it is currently above or below the signal line. The script then plots the EMA and signal lines, and uses the plotshape() function to indicate long and short signals based on the crossovers and crossunders of the EMA and signal lines.
Finally, the script sets up alert conditions using the alertcondition() function to notify the user when a long or short signal is generated, including information about the symbol and closing price.
█ SPECIAL THANKS
Special thanks to LOXX, I wanted to take a moment to express my gratitude for his valuable input in the EMA calculation. His insights and expertise have greatly helped me in improving my Pine Script coding skills. Thanks to his suggestion, I was able to better understand the EMA formula and implement it effectively in my script.
Your generosity in sharing your knowledge and experience is truly appreciated. It is through collaboration and exchanging ideas that we can all grow and become better in our craft.
This script provides exact signals that, with suitable additional indicators, provide very good results.
Best regards
Chervolino
TASC 2023.05 Cong Adaptive Moving Average█ OVERVIEW
TASC's May 2023 edition of Traders' Tips features an article titled "An Adaptive Moving Average For Swing Trading" by Scott Cong. The article presents a new adaptive moving average (AMA) that adjusts its parameters automatically based on market volatility. The AMA tracks price closely during trending movements and remains flat during congestion areas.
█ CONCEPTS
Conventional moving averages (MAs) use a fixed lookback period, which may lead to limited performance in constantly changing market conditions. Perry Kaufman's adaptive moving average , first described in his 1995 book Smarter Trading, is a great example of how an AMA can self-adjust to adapt to changing environments. Scott Cong draws inspiration from Kaufman's approach and proposes a new way to calculate the AMA smoothing factor.
█ CALCULATIONS
Following Perry Kaufman's approach, Scott Cong's AMA is calculated progressively as:
AMA = α * Close + (1 − α) * AMA(1),
where:
Close = Close of the current bar
AMA(1) = AMA value of the previous bar
α = Smoothing factor between 0 and 1, defined by the lookback period
The smoothing factor determines the performance of AMA. In Cong's approach, it is calculated as:
α = Result / Effort,
where:
Result = Highest price of the n period − Lowest price of the n period
Effort = Sum(TR, n ), where TR stands for Wilder’s true range values of individual bars of the n period
n = Lookback period
As the price range is always no greater than the total journey, α is ensured to be between 0 and 1.
SAR MACDSAR MACD is an idea of implementing Directional MACD with Parabolic SAR to exactly detect and confirm Trend. This p-SAR MACD consist of a HYBRID MACD which acts as MACD TREND oscillator, MACD Oscillator, PSAR Indicator combined with MA line. thus Fake MACD Signals can be eliminated using this SAR MACD. Sideways can be detected using Threshold Levels must be adjusted based on timeframe.
Indicators Hybrid model contains:
1.MACD (12,26,9) Standard with MA Crossovers
2.MACD Trend
3.Parabolic SAR with 0.02
4.Threshold level - indicates Sideways
How to use.
Histogram:
-> HIST MODE: normal MACD indicator
MA Line Color is based on PSAR Direction Blue-Up/ Pink -Down
A crossover upside with a Blue MA line denotes Up confirmation
A Crossover downwards with a red MA line denotes Down Confirmation
Additionally Histogram above zero line and below zero line are to be confirmed
-> MACD MODE: MACD Trend indicator
MA Line Color is based on PSAR Direction Blue-Up/ Pink -Down
A crossover upside with a Blue MA line denotes Up confirmation
A Crossover downwards with a red MA line denotes Down Confirmation
Additionally Histogram above zero line and below zero denotes long term Trend
-> Histogram Color: Indicates candles direction
Yellow indicates Unconfirmed Direction
Green Indicates up direction
Red Indicates Down Direction
Buy Condition:
MA Color - Blue
Histogram- Above Zero
Histogram/Candle -Green
MA Crossover is must
Sell Condition:
MA Color - Red
Histogram- Below Zero
Histogram/Candle -Red
MA Cross under is must
Warning: Must not be used as a standalone indicator. Use for confirmation of your Buy Sell Signals and Entry only.
Reverse PMAR & PMARPIntroducing the Reverse PMAR & PMARP
Concept
The PMAR/PMARP is an indicator which calculates :
The ratio between a chosen source price and a user defined moving average ( Price Moving Average Ratio ).
The percentile of the PMAR over an adjustable lookback period ( Price Moving Average Ratio Percentile ).
Here I have reverse engineered the PMAR / PMARP formulas to derive several functions.
These functions calculate the chart price at which the PMAR/PMARP will cross a particular scale value.
I have employed those functions here to give the "crossover" price levels for :
Upper alert level
Upper test level
Mid-Line
Lower test level
Lower alert level
Knowing the price at which these various user defined PMARP levels will be crossed can be useful in setting price levels that trigger components of various strategies.
For example: using the reverse engineered upper test price level, to set take a take profit limit order on a long trade, which was entered when PMARP was low.
The indicator displays either the PMAR or PMARP as a line plot with optional signal moving average.
It also plots optional visual alert level lines, test level lines, background signal bars, and a display panel with reverse engineered prices.
Main Properties :
Price Source :- Choice of price values or external value from another indicator ( default *Close ).
Indicator :- Choice between PMAR or PMARP ( default *PMAR ).
Price Moving Average Ratio Properties :
PMAR Length :- User defined time period to be used in calculating the Moving Average for the Price Moving Average Ratio and the PMAR component of the PMARP ( default *21 ).
MA Type :- User defined type of Moving Average which creates the MA for the Price Moving Average Ratio and the PMAR component of the PMARP ( default *EMA ).
PMAR Multiplier :- User defined multiplier which moves the decimal place to the right in order to make the scale readable in PMAR mode ( default *x1 ).
Price Moving Average Ratio Percentile Properties :
PMARP Length :- The lookback period to be used in calculating the Price Moving Average Ratio Percentile ( default *350 ).
PMAR Levels :
Hi PMAR Alert :- High alert level ( default *1.02 ).
Hi PMAR Test :- High test level ( default *1.01 ).
Lo PMAR Test :- Low test level ( default *0.99 ).
Lo PMAR Alert :- Low alert level ( default *0.98 ).
PMARP Levels :
Hi PMARP Alert :- High alert level ( default *99 ).
Hi PMARP Test :- High test level ( default *70 ).
Lo PMARP Test :- Low test level ( default *30 ).
Lo PMARP Alert :- Low alert level ( default *1 ).
Line Plot Settings :
Color Type :- User choice from dropdown between "solid" or "spectrum" line coloring ( default *Solid ).
Solid Color :- Color selection box ( default *Yellow ).
Spectrum :- User choice from dropdown between "high to low", or "high to mid to low" spectrum line coloring ( default *high to mid to low ).
High Color :- Color selection box ( default *Red ).
Mid Color :- Color selection box ( default *Green ).
Low Color :- Color selection box ( default *Blue ).
Line Width :- Defines the width of the signal line from 1 - 4 ( default *1 ).
Signal Moving Average Settings :
Signal MA Length :- The time period to be used in calculating the signal Moving Average for the Line Plot ( default *20 ).
Signal MA Type :- The type of Moving Average which creates the signal Moving Average for the Line Plot ( default *EMA ).
Color Type :- User choice from dropdown between "single" or "dual" line color ( default *dual ).
Single Color :- Color selection box ( default *White ).
Dual Color :- Color selection box ( default *Red ). Note: Defines the color of the signal MA when the MA is falling in "dual" line coloring mode.
Line Width :- Defines the width of the signal line from 1 - 4 ( default *1 ).
Visual Alert Level Settings :
Checkboxes and color selection boxes for Upper/Lower alert lines, midline & test lines.
Signal Bars Transparency :- Sets the transparency of the vertical signal bars ( default *50 ).
Checkboxes and color selection boxes for Upper/Lower signal bars.
Panel Properties :
Checkboxes and color selection boxes for the various info. panel components.
Text Size :- User choice from dropdown between Tiny, Small, Normal and Large ( default *Normal ).
Decimal Places :- Sets the decimal places shown for the values in the info. panel ( default *2 ).
Simple Chop ZoneThe original Chop Zone indicator by Trading View is good, but has a few limitations which I've addressed in this one
Too many colors which confuse and/or overwhelm users like me
Inability to change the EMA period
This one has just 3 customizable colors for
Uptrend - default = Turquoise
Downtrend - default = red
Everything else - default = lime
And you can set your own EMA length. The default is 34 as per the original Chop Zone indicator
Anchored Moving Averages - InteractiveWhat is an Anchored Moving Average?
An anchored moving average (AMA) is created when you select a point on the chart and start calculating the moving average from there.
Thus the moving average’s denominator is not fixed but cumulative and dynamic. It is similar to an Anchored VWAP, but neglecting the volume data, which may be useful when this data is not reliable and you want to focus just on price.
Main Features
This interactive indicator allows you to select 3 different points in time to plot their respective moving averages. As soon as you add the indicator to your chart you will be asked to click on the 3 different points where you want to start the calculation for each moving average.
Each AMA (Anchored Moving Average) will be colored according to its slope, using a gradient defined by two user chosen colors in the indicator menu.
The default source for the calculation is the pivot price (HLC3) but can also be modified in the menu.
Examples:
Enjoy!
Fundamental Value and Dividend Growth InvestingThis script is an original implementation of a Fundamental Value and Dividend Growth Investing Strategy for traders who want to incorporate these concepts in their trading decisions. The script uses technical indicators to determine buy and sell signals based on a set of criteria.
To use the script, traders can input various parameters, such as the length of the simple moving averages (SMA), the rate of change (ROC) length, and the dividend yield. The script calculates the SMA for the long and short periods, the ROC, and the dividend.
The buy signal is triggered when the current closing price is greater than the short-term SMA, the short-term SMA crosses above the long-term SMA, the ROC is positive, and the closing price is greater than the dividend. The sell signal is triggered when the current closing price is less than the long-term SMA, the long-term SMA crosses above the short-term SMA, and the ROC is negative.
The script plots the signals and the indicators, such as the SMA200, the SMS50, the dividend, and the ROC. The script also includes alert conditions for the buy and sell signals.
The concept underlying the calculations of this script is the Fundamental Value and Dividend Growth Investing Strategy. This strategy aims to identify stocks that are trading below their intrinsic value and have a history of increasing dividends. The SMA and ROC indicators help identify the trends in the stock price, while the dividend yield helps identify stocks with a history of dividend growth.
Overall, this script offers traders an original and useful tool for incorporating Fundamental Value and Dividend Growth Investing Strategy into their trading decisions.