Example - MA-Cross Retracement DetectionThe retracement tracker function(s) in this script outline how to:
Track conditions using "toggle" booleans.
Use multiple coinciding conditions to trigger an event just once.
What is a retracement?
"Retracements are temporary price reversals that take place within a
larger trend. The key here is that these price reversals are temporary
and do not indicate a change in the larger trend."
Quote Source: www.investopedia.com
Trend
Inverse BandsThis was the result of quite some time spent examining how much information could be gleamed by studying the interactions between Keltner Channels, STARC Bands and Bollinger Bands. I was surprised by the results.
First of all, there are four fills that are black. Set the transparency of those to 0 and you'll see this indicator the way that it's meant to be seen. Those fills belong to unused sections of the Bollinger Bands.
There are two clouds which represent STARC Bands and the Keltner Channel. There is some delay when they flip from bullish (green) to bearish (red), but they are indicative of the trend. The space between them is black and the narrower that space is, the greater volatility is. Because of this, we don't need the exterior Bollinger Bands.
The Bollinger Bands remain visible as the yellow interior clouds on the top cloud and the blue interior clouds on the bottom cloud. Often, the thicker the yellow or blue cloud is, the less severe a throwback from a given trend reversal will be. Often the thinner that yellow or blue cloud is, the more severe the trend reversal will be. If price is rising into a thin interior yellow cloud, the following dip will be substantial. If price action dips towards a thicker interior blue cloud, often the pump following that dump will be less enthusiastic.
We preserve the Keltner Channel and STARC bands as our cloud because the way that they interact with the three basis lines yields a lot of information.
The yellow Bollinger basis line tells us about trend strength. The closer the BB basis line is to the top of the top cloud or the bottom of the bottom cloud, the stronger the trend is. When it enters the cloud very close to the bottom of the bottom cloud, you know you're looking at a strong pump, and vice versa when it's close to the top of the top cloud.
The purple Keltner Channel basis line and orange STARC Band basis line can forecast short term trend changes one candlestick in advance by contacting any line in either cloud. The moment either basis line touches or crosses any boundary of the clouds, you know that the next candle will change directions. In an uptrend, a touch or cross means the next candle will have a lower high point. In a downtrend, a cross or touch means the next candle will have a higher high point. This is most useful in scalping.
It'd be pretty easy to slap some crossover alerts on to this and useful considering that they come a candle in advance. Feel free to further explore and develop this.
Entry master RSI pullbackSimply using a single RSI and placing a signal after it crosses the 50 level after being overbought or oversold in the same direction.
WTT Volume Trend [Morty]WTT Volume Trend by Morty
Inspired by Natural Trading Theory
It is a colored volume indicator based on the strength of single candlestick pattern.
It also paints two weighted volume SMA, which shows the strength and trend of the market.
Version 1.0, Updated at 20210327
Features:
- Colored volume bars (Optional)
- Weighted Bullish volume SMA trend lines according to candlestick pattern
- Weighted Bearish volume SMA trend lines according to candlestick pattern
- Adjustable volume SMA length
- Adjustable weighting factors
- Filling the background between volume SMA trend lines
LH-LL/HL-HH Confirmation Trend LineBased on Dow Theory, a series of successive higher highs (HH) and higher lows (HL) is the sign of an uptrend (bull trend) and a series of successive lower highs (LH) and lower lows (LL) is the sign of a downtrend (bear trend).
So this script indicates the trends using the concept and draws corresponding trend lines.
It took some effort to make it possible for users to see as many trend lines as they wish. Eventually the user could set the number alongside some other options in the indicator settings.
Use the script and send me your thoughts!
Color Changing Moving Average
Hello everybody!
I'm not much of a coder but I do make indicators for myself for fun sometimes and found this one super cool. Hope it helps!
Basically it's a moving average that changes colors based on the trend. How does it do it, you may ask? Simply put, it checks and makes sure that the open and close price is above the moving average, then it checks and sees if the 50-period RSI (length adjustable) is above 50. If both conditions are met, the moving average turns green. Simple as that.
If the price is below the moving average and the RSI is below 50, the moving average turns red.
If the price is above the moving average but the RSI is below 50, the line is grey and I advise to simply waiting for the trend direction to be decided. Likewise, if the price is below the moving average, but the RSI is above 50, the line is also grey.
This is NOT a comprehensive system, and the changing color of the moving average does not indicate a buy or sell signal. It simply indicates that the price is trending. You should use your own entry and exit strategy, such as the MACD, Wave Trend, Schaff Trend Cycle, etc.
As well, I would recommend waiting for confirmation of a trend change when the color changes, since in a range price can cross multiple times before deciding on the right direction.
The slope of the moving average can help too, since in a range the moving average is typically flat.
I would recommend using a fixed risk to reward ratio, to limit emotions. But, this would also help with a trend-following strategy due to the trend filter functionality.
The length of the moving average is adjustable, as well as the RSI period- though I wouldn't recommend selecting an RSI lower than 30 because it will whipsaw more. Disabling the EMA option will give you an SMA that does the same thing as the EMA. You can also disable the RSI filter and simply have a moving average that changes color when the price is above/below- but that's pretty boring, huh?
Anyways, hope this helps, happy trading everybody :)
PRIME - R.o.c.M Ind. W/ TrendsThis experimental script is a variant of a model that allows a separate indicator window to be opened, revealing data for on balance volume, rsi, consumer commodity index and momentum indications. By use of the settings key, you can change the parameter of the source input as well as the desired lengths. After data compilation, the indicator will automatically draw any trend lines applicable to what is presented. The additional code is an attempt to allow the system to apply pivot points for alerts within the indicator itself.
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold the publishing TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
PRIME - ShadoW ZoneZ with RSI LevelsIn This experimental study, we've taken RSI data, Volume Profile, and Trend analysis, combining them into one unique package that will allow a trader to analyze market trend lines and their proposed channels, trend momentum through candle color augmentation similar to "Pulse", and Visible Volume index price levels on chart for the current sequence. Below are explanations of each function within the system.
The Semafor is used to spot future multi-level Supports and Resistance zones.
It is also useful to spot HL or LL or HH or LH zones at different Depth settings.
The red zones are the extreme places where the market has a higher chance of reversing while the green zones have the lowest setting with lower chances of the market reversal
Automatic Trend Lines
The indicator takes in 2 timeframes to detect High and Low values from which to draw the trend lines of each timeframe.
As the values change with price movement, the lines are updated. They are color coded for uptrend and downtrend based on the direction of each individual line. Trend lines can be set up to color with only the default value on the configurations panel.
- Toggle on/off Color Coded
- Change Default, Uptrend, Downtrend color
- Change Line Width
- Change Line Style
- Toggle on/off Line Extensions
- Change Extended Line Width
- Change Extended Line Style
- Toggle On/Off labels for 7 data points of each timeframe
Automatic Trend Sights
This is a neat feature that may help you get a better feel for the direction the current movement is heading towards in correlation with the short or medium length timeframe trends. The sight draws a line from the middle vertical point of the trend coordinates towards the current price. They are toggled off by default but can be enabled in the configurations panel.
- Toggle on/off sight on each timeframe
- Change Width
- Change Line Style
Support & Resistance Levels, the main aim of the study. Level calculations are based on Relative Strength Index ( RSI ) threshold levels of oversold/overbought and bull/bear zones, where all threshold values are customizable through the user dialog box. Background of the levels can be colored optionally.
RSI Weighted Colored Bars and/or Mark Overbought/Oversold Bars , Bar colors can be painted to better emphasis RSI values. Darker colors when the oscillator is in oversold/overbought zones, light colors when oscillator readings are below/above the bull/bear zone respectively, and remain unchanged otherwise. Besides the colors, with “Display RSI Overbought/Oversold Price Bars” option little triangle shapes can be plotted on top or bottom of the bars when RSI is in oversold/overbought zones .
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
Action Trend LineAction Trend Line is different of Moving Average between ema26 and ema260
My idea is, if ema26 drop to ema260 means downtrend
if ema26 increase or moving out of ema260 means uptrend
then writting a different line by 100 scale to be clear vision
at the bottom have plot sign up and down for each candle, it is status information
The chart show Action Trend Line, by 2 color and 2 sign at the bottom of chart.
If the line is growing up then color is green. you could know that is uptrend.
If the line is going down then color is red. you could know that is downtrend.
The triangle sign at the bottom of chart show trend folowing.
If previous and this line are uptrend, the triangle up and green color.
If previous and this line are downtrend, the triangle down and redcolor.
otherwise, the trend going to change it dosen't plot any sign, you cloud know warning the trend going to be change.
Must try and make you clearly understand.
Ripster EMA CloudsEMA Cloud By Ripster
EMA Cloud System is a Trading System Invented by Ripster where areas are shaded between two desired EMAs. The concept implies the EMA cloud area serves as support or resistance for Intraday & Swing Trading. This can be utilized effectively on 10 Min for day trading and 1Hr/Daily for Swings. Ripster himself utilizes various combinations of the 5-12, 34-50, 8-9, 20-21 EMA clouds but the possibilities are endless to find what works best for you.
“Ideally, 5-12 or 5-13 EMA cloud acts as a fluid trendline for day trades. 8-9 EMA Clouds can be used as pullback Levels –(optional). Additionally, a high level price over or under 34-50 EMA clouds confirms either bullish or bearish bias on the price action for any timeframe” – Ripster
Hurst ExponentMy first try to implement Full Hurst Exponent.
The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series and the rate at which these decrease as the lag between pairs of values increases
The Hurst exponent is referred to as the "index of dependence" or "index of long-range dependence". It quantifies the relative tendency of a time series either to regress strongly to the mean or to cluster in a direction.
In short, depending on the value you can spot the trending / reversing market.
Values 0.5 to 1 - market trending
Values 0 to 0.5 - market tend to mean revert
Hurst Exponent is computed using Rescaled range (R/S) analysis.
I split the lookback period (N) in the number of shorter samples (for ex. N/2, N/4, N/8, etc.). Then I calculate rescaled range for each sample size.
The Hurst exponent is estimated by fitting the power law. Basically finding the slope of log(samples_size) to log(RS).
You can choose lookback and sample sizes yourself. Max 8 possible at the moment, if you want to use less use 0 in inputs.
It's pretty computational intensive, so I added an input so you can limit from what date you want it to be calculated. If you hit the time limit in PineScript - limit the history you're using for calculations.
####################
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
Electrified Momentum OverlayVisualizes a moving average and changes in momentum in one overlay.
8 phase alert options.
First Week Trend [MX]I created this indicator based on one of my ways of analyzing the BTC trend in particular, I noticed that the break of the first weekly candle usually indicates the trend for the rest of the month.
This indicator has a bug in which if you change the timeframe of the indicator it will show erroneous values
If you use the candlestick chart, you will need to pull the visual order of this indicator to the top to overlay the colors of the standard candles, or simply hide the standard candles
the trend colors are bugged in timeframes other than the weekly
special thanks to @xdecow who helped me with the code
////////////////////////////////////////////////////////////////////////
Eu criei esse indicador baseado em uma das minhas formas de analisar a tendência do BTC em específico, eu notei que o rompimento do primeiro candle do semanal costuma indicar a tendência para o resto do mês.
Esse script tem um bug em que se mudar o timeframe do indicador ele irá mostrar valores errados
Se você usa o gráfico de candlesticks, você precisará puxar para o topo a ordem visual desse indicador para sobrepor as cores do candles padrões, ou simplesmente ocultar os candles padrões
as cores da tendencia estão bugados em outros timeframes diferentes do semanal
agradecimentos especiais ao @xdecow que me ajudou no código
Follow Line Trend SignalThis Script is a Trend Following system built over the concepts of normalising ATR over Bollinger Bands and Pivot points high low,
This Script Can be used over AnyTimeframe
and Can be treated as a stable alternative to Supertrend
Script has provisions for BUY and SELL Alerts
Enjoy!
Combo Backtest 123 Reversal & Modified Price-Volume Trend This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The related article is copyrighted material from
Stocks & Commodities.
WARNING:
- For purpose educate only
- This script to change bars colors.
Buy/Sell/Hold/Away? This script based on Simple Moving Average and Exponential Moving Average.
The Red Line is an exponential moving average with small length. It act as a main line.
The Black Line is an average of some past data of exponential moving average. Act as Trend Line
The green circles is an exponential moving average with medium length. It act as a signal line.
The Idea is, when the price move higher from it past,past,past, repeatedly in some duration, it will gain enough energy to fly to the highest.
Buy signal when red line cross down green circle. strong buy when red line cross down black line.
Sell signal when red line cross down green circle. strong buy when red line cross down black line.
Additional 1:
Triangle up(blue) indicate Buy Signal. it happen when the price break resistant with some condition and volume>1m
Triangle down(maroon) indicate Sell Signal. it happen when the price break support with some condition and volume>1m
The more triangle show in series, the strong the trend to move accordingly.
Additional 2:
Support and Resistance line.
Hope Benefit To You All.
Simple Hurst Exponent [QuantNomad]This is a simplified version of the Hurst Exponent indicator.
In the meantime, I'm working on the full version. It's computationally intensive, so it's a challenge to squeeze it to PineScript limits. It will require some time to optimize it, so I decided to publish a simplified version for now.
The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases
The Hurst exponent is referred to as the "index of dependence" or "index of long-range dependence". It quantifies the relative tendency of a time series either to regress strongly to the mean or to cluster in a direction.
In short depend on value you can spot trending / reversing market.
Values 0.5 to 1 - market trending
Values 0 to 0.5 - market tend to mean revert
####################
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
Moving Regression Prediction BandsIntroducing the Moving Regression Prediction Bands indicator.
Here I aimed to combine the principles of traditional band indicators (such as Bollinger Bands), regression channel and outlier detection methods. Its upper and lower bands define an interval in which the current price was expected to fall with a prescribed probability, as predicted by the previous-step result of the local polynomial regression (for the original Moving Regression script, see link below).
Algorithm
1. At every time step, the script performs local polynomial regression of the sample data within the lookback window specified by the Length input parameter.
2. The fitted polynomial is used to construct the Moving Regression time series as well as to extrapolate data, that is, to predict the next data point ( MRPrediction ).
3. The accuracy of local interpolation is estimated by means of the root-mean-square error ( RMSE ), that is, the deviation between the fitted polynomial and the observed values.
4. The MRPrediction and RMSE values calculated for the previous bar are then used to build the upper and lower bands , which I define as follows:
Upper Band = MRPrediction_prev + Multiplier *( RMSE_prev )
Lower Band = MRPrediction_prev - Multiplier *( RMSE_prev )
Here the Multiplier is a user-defined parameter that should be interpreted as a quantile in the standard normal distribution (the default value of 2.0 roughly corresponds to the 95% prediction interval).
To visualize the central line , the script offers the following options:
Previous-Period MR Prediction: MRPrediction_prev time series from the above equation.
MR: Conventional Moving Regression time series.
Ribbon: “Previous-Period MR Prediction” and “MR” curves plotted together and colored according to their relative value (green if MR > Previous MR Prediction; red otherwise).
Usage
My original idea was to use the band breakouts as potential trading signals. For example, the price crossing above the upper band is a bullish signal , being a potential sign that price is gaining momentum and is out of a previously predicted trend. The exit signal could be the crossing under the lower band or under the central line.
However, be aware that it is an experimental indicator, so you might fin some better strategies.
Feel free to play around!
Donchian Zig-Zag [LuxAlgo]The following indicator returns a line bouncing of the extremities of a Donchian channel, with the aim of replicating a "zig-zag" indicator. The indicator can both be lagging or lagging depending on the settings user uses.
Various extended lines are displayed in order to see if the peaks and troughs made by the Donchian zig-zag can act as potential support/resistance lines.
User Settings
Length : Period of the Donchian channel indicator, higher values will return fewer changes of directions from the zig-zag line
Bounce Speed : Determine the speed of bounces made by the zig-zag line, with higher values making the zig-zag line converge faster toward the extremities of the Donchian channel.
Gradient : Determine whether to use a gradient to color the area between each Donchian channel extremities, "On" by default.
Transparency : Transparency of the area between each Donchian channel extremities.
Usage
It is clear that this is not a very common indicator to see, as such usages can be limited and very hypothetical. Nonetheless, when a bounce speed value of 1 is used, the zig-zag line will have the tendency to lag behind the price, and as such can provides crosses with the prices which can provide potential entries.
The advantage of this approach against most indicators relying on crosses with the price is that the linear nature of the indicator allows avoiding retracements, thus potentially holding a position for the entirety of the trend.
Altho this indicator would not necessarily be the most adapted to this kind of usage.
When using a bounce speed superior to 1, we can see the predictive aspects of the indicator:
We can link the peaks/troughs made by the zig-zag with the precedent ones made to get potential support and resistance lines, while such a method is not necessarily accurate it still allows for an additional to interpret the indicator.
Conclusions
We presented an indicator aiming to replicate the behaviour of a zig-zag indicator. While somehow experimental, it has the benefits of being innovative and might inspire users in one way or another.
Put Call OscillatorThis is a volume-based oscillator used for detecting market sentiment.
This plots two moving averages of the CBOE S&P500 PCR (put call ratio), and a histogram to measure the distance between them. The histogram will generate signals of green (bullish) or red (bearish), depending on whether put volume is decreasing or increasing.
The moving averages are adjustable. They are set at 4 and 16 by default. Increasing the moving averages will generate less signals, while decreasing them will generate more signals.
The background will change color from red to green depending on whether the PCR is above or below 1.
I used capriole_charles script "Put/Call Ratio (PCR)" to help me build this.
New Map For TradersUsing previous principles, This setup plots 60 moving averages on the chart. The averages are colored using a normalized oscillation technique (FFT).
To achieve the same display as above, put the same indicator twice and set the 'osx' parameter of one to 0 and the other to 2.
Feel free to play with the 'mul' parameter in ranges between 1-90. Most useful ranges will be 4-16 in my opinion.
Leave me a message if you'd like to explore the behaviors of the fractal dimension further ;)
Trend MagicTrend Magic is originally a MT platform (MetaTrader) indicator and it can be used with any forex trading systems / strategies for additional confirmation of trading entries or exits. Converted the MT platform code to TradingView Pine version 4. Also you can use Multiple Time Frame.
It also works well with Crypto and Stock Markets.
Trend Magic consists of two main calculation parts as momentum and volatility:
First part is ATR based (like ATR Trailing Stop) logic, second part is all about CCI which also determines the color of Trend Magic.
Blue: when CCI is positive
Red: when CCI is negative
Also added alert condition regarding price crosses :
when LOW CrossesAbove TM
and HIGH CrossesBelow TM
Enjoy
Kıvanç Özbilgiç
Bollinger Band with Fib Golden Ratio (0.618)This startegy uses Fib level (0.618) of Bollinger Band for long entry. I find this is the only strategy which gives similar results on the different time frames. I have tested QQQ for 1H, 2H , 3H and 4H charts , all showed over 70% winning rate.
BB settings 50 , mult 1.5 (or you can use 2.5 or 3 )
Note: for the basis I have used VWMA instead of SMA .
BUY
=========
ema 50 is above ema 200
when the price close or low touches BB50(Fib0.615) lower band
Exit
=========
when the price crossover BB50(Fib0.615) upper band
Stop Loss
=========
Stop oss set to 5% , configurable
Strategy works similar to mean reversion style. When it touches the lower bans (which 0.615 level of the BB50) , it bounces from there.
Warning
=========
This strategy is for educational purposes only. Please do your own reserach for trading decissions.