Mean Reversion Strategy v2 [KL]Description :
This strategy will enter a position when the following conditions are met:
a) Main signal: When source data (ATR) diverts from its moving average value, and
b) Confirmation: If predicted direction of trend is favorable.
Assumptions :
During periods of high price volatility, ATR diverts from its moving average value. Eventually, ATR should revert. But since just knowing the magnitude of increase/decrease of ATR does not indicate a trend signal, we need to introduce a model to predict the current trend.
In short:
• Trend Prediction : This strategy calculates the expected logarithmic return of the security (the "Drift") and considers prices to be moving in uptrend if the drift curve is upward sloping.
• Assessment of ATR diversion : To determine "yes/no" regarding whether ATR at a given point in time has diverted, this script conducts a two-tailed hypothesis test at each candlestick period. The null hypothesis (H0) is that the fast moving average value should equal the slow moving average value (say, denoted as H0: atr14 == atr28; it is assumed that atr28 is more meaningful for the purpose of describing the current trend because it has a larger sample size). Investopedia has an article summarizing this topic .
Exit Condition :
When trailing stop loss hits.
Previous version :
This strategy is based on Version 1 published back in September . This older version considers +/- one standard deviation to be the critical values relative to average ATR when testing whether ATR has diverted from the mean. This does not take Standard Error ("SE") into account. As a result, the threshold is often too wide and it generates too many entry signals.
Meanreversion
Percentile Rank [racer8]The Percentile is a mathematical tool developed in the field of statistics. It determines how a value compares to a set of values.
There are many applications for this like ...
... determining your rank in your college math class
... your rank in terms of height, weight, economic status, etc.
... determining the 3-month percentile of the current stock price (which is what this indicator performs)
This indicator calculates the percentile rank for the current stock price for n periods.
For example, if the stock's current price is above 80% of the previous stock's prices over a 100-period span, then it has a percentile rank of 80.
For traders, this is extremely valuable information because it tells you if the current stock price is overbought or oversold.
If the stock's price is in the 95th percentile, then it is highly likely that it is OVERBOUGHT, and that it will revert back to the mean price.
Helplful TIP: I recommend that you set the indicator to look back over at LEAST 100 periods for accuracy!
Thanks for reading! 👍
Volume Breakout (ValueRay)Easy visuals on, if volume is way over average. Good for Mean Reverting. Higher Volume tends to higher breakout chances.
Please whisper me for for ideas how to make this better. Its a very simple script, but got some alpha. If you know how to improve, let me know and i will code it into.
Bitcoin - CME Futures Friday Close
This indicator displays the weekly Friday closing price according to the CME trading hours (Friday 4pm CT).
A horizontal line is displayed until the CME opens again on Sunday 5pm CT.
This indicator is based on the thesis, that during the weekend the Bitcoin price tends to mean reverse to the CME closing price of the prior Friday. The level can also act as support/resistance. This indicator gives a visualization of this key level for the relevant time window.
Furthermore the indicator helps to easily identify, if there is an up or down gap in the CME Bitcoin contract.
[KL] Mean Reversion (ATR) StrategyThis strategy will enter into a position when price volatility is relative high, betting that price will subsequently trend in a favourable direction.
Hypothesis : During periods of high price volatility, ATR will divert from its moving average by at least +/- one standard deviation. Eventually, ATR will revert back to the mean. However, just knowing the magnitude of increase/decrease of ATR does not give a trend signal, so we need to introduce a model in this script to predict whether the next bars will be up/down.
Trend Prediction : This strategy calculates the expected logarithmic return of the security (the "Drift") and considers prices to be moving in uptrend if the drift curve is upward sloping or if the drift value is positive.
Entry Conditions : Long position is entered when:
(a) ATR has diverted from mean by one standard deviation, and
(b) trend is predicted to move in our favor.
Exit Condition : When trailing stop loss is hit.
Results from backtesting against VOO (1H timeframe):
- approx 46% win rate over 491 trades, on average holding for 20 hours per trade
- price at the beginning of backtest (Jan. 2015) was $187.52, giving holding period return of ~120% had we not sold in between ("HPR of HODL'ing")
- this strategy gained ~159%, exceeding ~120% HPR of HODL'ing
Roc Mean Reversion (ValueRay)This Indicator shows the Absolute Rate of Change in correlation to its Moving Average.
Values over 3 (gray dotted line) can savely be considered as a breakout; values over 4.5 got a high mean-reverting chance (red dotted line).
This Indicator can be used in all timeframes, however, i recommend to use it <30m, when you want search for meaningful Mean-Reverting Signals.
Please like, share and subscribe. With your love, im encouraged to write and publish more Indicators.
Percentile - Price vs FundamentalsThis is done in the same lines of below scripts
Drawdown-Price-vs-Fundamentals
Drawdown-Range
Instead of using drawdown, here we are only plotting percentile of drawdown. Also added few more fundamental stats to the indicator. Also using part of the code from Random-Color-Generator/ to automatically generate colors. This in turn uses code from @RicardoSantos for convering color based on HSL to RGB
This is how the study can be used:
Study plots percentile of price and each of the listed fundamentals based on history. History can be chose All time or particular window. If any fundamental or price is near 100 - which means it is nearer to its peak. And if something is near its bottom, it is nearer to its 0th percentile.
Price of the stock is considered undervalued based on historical levels when it is below most of the fundamentals. Price is considered overvalued based on historical levels when it is above all the fundamentals. Please note, being undervalued does not guarantee immediate mean reversion. Stocks can stay undervalued for prolonged time and can go further down. Similarly overvalued stock can stay overvalued for prolonged time before correcting itself or justifying the position. Hence, further discretion needs to be used while using this study.
Few examples:
AMZN seems to be trading in range and so are the fundamentals:
MSFT at peak along with half of the fundamentals. But, debt levels are going up along with margins reducing.
LPX is trading at 15% discount whereas most of the fundamentals are at the peak.
FLGT price seems to have gone down further whereas fundamentals look pretty healthy.
MA Visualizer™TradeChartist MA Visualizer is a Moving Average based indicator aimed to visualize price action in relation to the Moving Average in a visually engaging way.
===================================================================================================================
█ MA Visualizer Features
11 different Moving Averages to choose from the settings to visualize based on MA Visualizer Length (Default - 55 period SMA).
2 Smoothing options (default - 0, 0 uses MA length as Smoothing factor, 1 uses no Smoothing).
4 colour themes to choose from and option to adjust Visualizer Vibrance.
█ Example Charts
1. 1hr chart of OANDA:XAUUSD using 55 period WMA.
2. 15m chart of OANDA:EURUSD using 144 period Tillson T3 MA.
3. 4 hr chart of OANDA:US30USD using 55 period SMMA.
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
HYE Combo Market [Indicator] (Vwap Mean Reversion+Trend Hunter)Indicator version of the strategy:
* Alerts added.
TIPS AND WARNINGS
1-) The standard settings of this combo script is designed and tested with daily timeframe. For lower timeframes, you should change the indicator settings and find the best value for yourself.
2-) Only the mean vwap line is displayed on the graph. For a detailed view, you can delete the "//" marks from the plot codes in the script code.
3-) This is an indicator for educational and experimental purposes. It cannot be considered as investment advice. You should be careful and make your own risk assessment when opening real market trades using this indicator.
HYE Combo Market [Strategy] (Vwap Mean Reversion + Trend Hunter)In this strategy, I used a combination of trend hunter and vwap mean reversion strategies that I published before.
Trend Hunter Strategy:
Mean Reversion Vwap Strategy:
The results are quite impressive, especially for bitcoin.
While the hodl return for bitcoin was 13419%, the strategy's return in the same period was about 5 times (65000%) of this.
s3.tradingview.com
In this combo strategy, I made some changes to the original settings of the strategies used together and added some more new features.
Trend Hunter Strategy Settings: (Original / Combo)
- Slow Tenkansen Period : 9 / 9
- Slow Kijunsen Period : 26 / 13
- Fast Tenkansen Period : 5 / 3
- Fast Kijunsen Period : 13 / 7
- BB Length : 20 / 20
- BB Stdev : 2 / 2
- TSV Length : 13 / 20
- TSV Ema Length : 7 / 7
* I also added a "vidya moving average" to be used as a confirmation tool to open a long position. (Candle close must be above the vidya line.)
Vwap Mean Reversion Strategy Settings: (Original / Combo)
- Small Vwap : 2 / 8
- Big Vwap : 5 / 10
- Percent Below to Buy : 3 / 2
- RSI Period : 2 / 2
- RSI Ema Period : 5 / 5
- Maximum RSI Level for Buy : 30
* I also added a "mean vwap line" to be used for exits in this part of the strategy. In the original version, when small vwap crossovers big vwap, we close the position, but in this strategy we will wait for the close above the mean vwap.
TIPS AND WARNINGS
1-) The standard settings of this combo strategy is designed and tested with daily timeframe. For lower timeframes, you should change the strategy settings and find the best value for yourself.
2-) Only the mean vwap line is displayed on the graph. For a detailed view, you can delete the "//" marks from the plot codes in the strategy code.
3-) This is a strategy for educational and experimental purposes. It cannot be considered as investment advice. You should be careful and make your own risk assessment when opening real market trades using this strategy.
________________________________________________________
Bu stratejide, daha önce yayınladığım trend avcısı ve vwap ortalamaya geri dönüş stratejilerinin bir kombinasyonunu kullandım.
Sonuçlar özellikle bitcoin için oldukça etkileyici.
Bitcoin için hodl getirisi %13419 iken, stratejinin aynı dönemdeki getirisi bunun yaklaşık 5 katı (%65000) idi.
Bu kombo stratejide, birlikte kullanılan stratejilerin orijinal ayarlarında bazı değişiklikler yaptım ve bazı yeni özellikler ekledim.
Trend Avcısı Strateji Ayarları: (Orijinal / Combo)
- Yavaş Tenkansen Periyodu : 9 / 9
- Yavaş Kijunsen Periyodu : 26 / 13
- Hızlı Tenkansen Periyodu : 5 / 3
- Hızlı Kijunsen Periyodu : 13 / 7
- BB Uzunluğu : 20 / 20
- BB Standart Sapması : 2 / 2
- TSV Uzunluğu : 13 / 20
- TSV Ema Uzunluğu : 7 / 7
* Ayrıca long pozisyon açmak için onay aracı olarak kullanılmak üzere "vidya hareketli ortalama" ekledim. (Mum kapanışı vidya çizgisinin üzerinde olmalıdır.)
Vwap Ortalamaya Dönüş Stratejisi Ayarları: (Orijinal / Combo)
- Küçük Vwap : 2 / 8
- Büyük Vwap : 5 / 10
- Alış İçin Gerekli Fark Oranı : 3 / 2
- RSI Periyodu : 2 / 2
- RSI Ema Periyodu: 5 / 5
- Alış için gerekli maksimum RSI seviyesi : 30
* Stratejinin bu bölümünde pozisyondan çıkışlar için kullanılacak bir "ortalama vwap çizgisi" de ekledim. Orijinal versiyonda, küçük vwap, büyük vwap'ı yukarı kestiğinde pozisyonu kapatıyoruz, ancak bu stratejide, ortalama vwap'ın üzerindeki kapanışı bekleyeceğiz.
İPUÇLARI VE UYARILAR
1-) Bu birleşik stratejinin standart ayarları, günlük zaman dilimi ile tasarlanmış ve test edilmiştir. Daha düşük zaman dilimleri için strateji ayarlarını değiştirmeli ve kendiniz için en iyi değeri bulmalısınız.
2-) Grafikte sadece ortalama vwap çizgisi görüntülenir. Ayrıntılı bir görünüm için strateji kodundaki "plot" ile başlayan satırlarda grafikte görünmesini istediğiniz özelliğin önündeki "//" işaretlerini silebilirsiniz.
3-) Eğitim ve deneysel amaçlı bir stratejidir. Yatırım tavsiyesi olarak değerlendirilemez. Bu stratejiyi kullanarak gerçek piyasa işlem açarken dikkatli olmalı ve kendi risk değerlendirmenizi yapmalısınız.
HYE Mean Reversion SMAIndicator version of the strategy "HYE Mean Reversion SMA "
"Long", "Short", "Exit Long" and "Exit Short" alarms added.
Use with "Once Per Bar Close".
GMS: GW-VWAPAlright, as per usual with these, I end up adapting an existing indicator to what I want to accomplish. So this is based off the built in VWAP indicator. I added in the gummy worm to easily identify the trend, as well as the related bands to identify potential areas to either reverse position or to trim an existing one.
The middle part of the bands are the gummy worm version of VWAP. It is the VWAP using the high and another VWAP using the low. The black line is HL2 VWAP (technically 3 VWAPs).
The bands follow what I was mentioning above. So the outer most part of the bands are the high & low VWAP (with the same multiplier) and the inner bands are the HL2 VWAP.
Of course you can set whatever input source you want for these. The default is how I use it. If you want to get rid of the bar color just go to the indicator settings and un-select it at the bottom.
Source code is open so feel free to poke around.
Hope this helps,
Andre
Peak Reversal v2This is a brand new version of my Peak Reversal indicator. As with the older version, the idea behind this indicator is simple: identify potential price reversal areas, and identifying markets which are trending. In this new version I focused on improving on the old concept, but introduced a bunch of features heavily inspired by Adam Grimes' ideas from The Art and Science of Trading. (I also blatantly stole the way he colors candles outside of the bands. Sorry.)
As you can see below this indicator gives traders a plethora of tools to judge whether a market is trending, and might be mean reverting soon.
Follow me, join my group, like the script. You know the drill.
Basic functions:
You have a triplet of Keltner (ATR-based) bands in Peak Reversal. They are defined by a multiplier and an EMA, which is referred to as "the mean". There's a tight, normal, and an extreme band. The multiplier defines how far apart your bands are. By default the indicator uses 1.125, 2.25, and 3.375. The tight band is off by default, but you can turn it on in the options. The mean is also off by default. This is more a personal preference thing for me, because I happen to use a different indicator to show a couple of moving averages.
Band crosses:
Peak Reversal can indicate whenever price crosses one of the bands. This can help traders identify points where a mean reversal play could be an option. Triangles indicate these crosses. New in version 2 is the ability to choose which of the bands to use to show these crosses. If you are more of an aggressive trader, you might find it better to show tight band crosses. If you are looking for more extreme market conditions, then choose extreme. The default is "normal".
Free bars:
Indicating free bars is also a concept from the book. A "free bar" is one which stands "freely" above the bands, which means its low price is completely outside of the bands. It can be argued that a freely standing bar is an even more extreme mean deviation, than just a band cross. Traders can gain an additional advantage studying the markets this way. Free bars are not shown by default, when on, a star shape on the candles indicates free bars. Both band crosses and free bars can be shown at the same time, but there might be overlap.
Deviations:
Also based on a concept from The Art and Science of Trading, is an indication of price "deviations". You will notice that when a candle "touches" a band (high and close above band), its colored. The idea here is to show traders when a market is in motion, but also when a mean reversal might be coming next. To accomplish this, the more colors deviate, the darker the color is. The idea here is also simple, the more price deviates off the mean, the likelier it is to return to it. This uses three different shades to show these deviations. 1-2 is one shade, 3-4 another, and upwards of 5 there's only the darkest shade. I didn't make extensive studies, which color for how many candles would be appropriate to use, but I do believe it doesn't matter that much in usage. It's clear what traders gain from using this information: more deviation, the likelier a snapback becomes.
Advanced mode:
Last but not least, I decided to add an advanced mode for advanced traders. This does nothing more than flip all colors and shapes upside down. Everything that is red, becomes green. The idea is where some traders say "buy low, sell high" (standard mode), other traders might say "buy high, sell higher" (advanced mode). See for yourself, which one you like better.
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.
ema exhaustion (exa)The exa is an oscillator that combines fisher transform with distance from moving average and it is based on a theory that exhaustion can be derived from how far price is able to extend from a moving average, on average.
The fisher transform converts price into a gaussian normal distribution, also known as a bell curve {1}. A normal distribution is a type of probability distribution for a real-valued random variable {2}. Applying this method to the price of an asset can help to identify probabilities, but it will never identify certainties.
‘exa’ is an abbreviation for ema exhaustion. It can be used to identify when price is probable to revert to the mean but I prefer using it to confirm entries that are signaled following a reversion to the mean (aka buying the dip in bull markets). When price gets oversold into support, in a bull trend, then that can provide a good opportunity to enter long. However that isn’t necessarily the case when the same metrics indicate oversold conditions in a bear trend. In this situation the exa is best suited for identifying profit taking opportunities on shorts.
The default settings are a 9 lookback period and a 50 ema. By default signals will be derived from how far price is from the 50 ema relative to the probable distribution of the last 9 periods. If the exa is above 2, or below -2, then the price is in the 80th percentile of the prior 9 candles. Being outside of 3, or -3, represents the 90th percentile and 4, or -4, represents the 95th percentile.
Those ranges will never indicate a necessity of reverting to the mean, but they will indicate a higher and higher probability. I prefer to use this oscillator in combination with an indicator(s) that identifies the trend. When the oscillator reaches -2 in a bull trend then it can confirm long entry signals, whereas if it reaches +2 in a bull trend then it can be used to confirm signals to take profit.
Crossovers are especially significant because they indicate a shift in the tide. When the exa reaches 2 without crossing over then it is very much in a position to move to 3 or 4+. When it crosses above 2 then it is an indication that price is extended from the mean and exhausted.
This is certainly not a situation that implies price will revert to the mean, it simply provides confirmation.
The default settings are what I have been finding most effective personally, however that is mostly a function of the trend following tools that I use. The same principles should apply with all settings and I would encourage users to experiment with various lookback periods and emas.
{1} www.investopedia.com
{2} en.wikipedia.org
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.
Coefficient of Variation - EMA and SMA StDevYet another way to try and measure volatility. An alternative to using ATR is Standard Deviation, it can be used to measure volatility or what is also known as risk. SD measures how dispersed or far away the data is from the mean. It's commonly seen in risk management formulas or portfolio diversification formulas. The problem however is that the numbers that ATR and SD give off from one equity might not be relative to others or its own past. For example, SPY can give a large number despite not being as volatile as other equities while others being compared to can have smaller volatility numbers and still be more volatile looking.
A solution I thought of is to use percentages that are relatable to different equities. I found out another name for this idea comes from statistics and is known as coefficient of variation, also known as relative standard deviation. This helps see the volatility as a percentage and not just a number that only relates to what is being seen at the moment. I put in a border line on the zero level to see where zero is at but also to edit in case there is such a thing as a percentage number that can be too high or too low for volatility to be looked at if needed. The average and standard deviation formulas can use either simple moving average or exponential moving average.
Ark Crypto HeatlineThis is the 'on chart' indicator. See also "Ark Crypto Heatband" indicator for a side-by-side BTC view, without a re-scaled line.
The crypto landscape is largely dominated by BTC and characterised by cyclical stages with varying degrees of mean reversion.
To understand what stage of the cycle we are currently experiencing, it is useful to examine to what degree the current price has extended beyond the long term average that BTC has established. This is true even when analysing other crypto assets as BTC is the dominant force in the crypto asset class.
This indicator uses the 1400 period daily SMA , which is broadly the 200 period weekly SMA. This can be configured, but historically has represented a baseline to which BTC commonly returns.
The graph plots current price in terms of multiples of this long term average. Traditionally, at multiples beyond 10, BTC is considered overextended with a higher likelihood of trending towards the mean thereafter. Colors indicate the extent of price extension.
Where the indicator is applied to non BTCUSD pairs, a smoothed conversion is applied, seeking to superimpose the BTC long period SMA onto the current chart.
The indicator specifically references BTC by default on all charts, as it is designed to use BTC as general purpose indication of where crypto as a whole currently sits. Accordingly the indicator is only to be used on crypto charts.
For best results on BTC, using BNC:BLX will give the longest historical view.
Ark Crypto HeatbandThe crypto landscape is largely dominated by BTC and characterised by cyclical stages with varying degrees of mean reversion.
To understand what stage of the cycle we are currently experiencing, it is useful to examine to what degree the current BTC price has extended beyond a long term average. This is true even when analysing other crypto assets and helpful to view side by side.
This indicator uses the 1400 period daily SMA, which is broadly the 200 period weekly SMA. This can be configured, but historically has represented a baseline to which BTC commonly returns.
The graph plots current price in terms of multiples of this long term average. Traditionally, at multiples beyond 10, BTC is considered overextended with a higher likelihood of trending towards the mean thereafter. Colors indicate the extend of price extension.
The indicator specifically references BTC by default on all charts as it is designed to use BTC as general purpose indication of where crypto as a whole currently sits. Accordingly the indicator is only to be used on crypto charts.
Mean Reversion Channel - (fareid's MRI Variant)Description :
Mean Reversion Channel objective, based on Mean Reversion theory ( everything has a tendency to revert back to its mean), is to help visualizing:
Inner Channel -> Dynamic Support and Resistance
Outer Channel -> Overbought/Oversold Zone which may signal consolidation phase or potential reversal due to unsustainable move
Details on some of the filtering type used for mean calculation can be read in Ehlers Technical Papers: "Swiss Army Knife Indicator" and/or his book "Cybernetics Analysis for Stock and Futures"
Disclaimer:
These study scripts was built only to test/visualize an idea to see its viability and if it can be used to optimize existing strategy.
Any ideas to further improve this indicator are welcome :)
dirt cheap yet elegant RSI StrategyFor Educational Purposes. Results can differ on different markets and can fail at any time. Profit is not guaranteed.
This only works in a few markets and in certain situations. Changing the settings can give better or worse results for other markets. This is a good way to show off a good looking strategy, atleast in paper, with minimal effort involved in the making and usage. It can be made with the most minimal lines of code if needed to bring shame unto others. It only works in a few markets and who knows if it will actually rebound from the overbought or oversold levels but in case it doesn't I put in a time-based stop to exit in case of that worst case scenario. There's not much to it, good for trolling others, or serious business, you decide.
Bollinger Bands Strategy with Intraday Intensity IndexFor Educational Purposes. Results can differ on different markets and can fail at any time. Profit is not guaranteed.
This only works in a few markets and in certain situations. Changing the settings can give better or worse results for other markets.
This is a mean reversion strategy based on Bollinger Bands and the Intraday Intensity Index (a volume indicator). John Bollinger mentions that the Intraday Intensity Index can be used with Bollinger Bands and is one of the top indicators he recommends in his book. It seems he prefers it over the other volume indicators that he compares to for some reason. III looks a lot like Chaikin Money Flow but without the denominator in that calculation. On the default settings of the BBs, the III helps give off better entry signals. John Bollinger however is vague on how to use the BBs and it's hard to say if one should enter when it is below/above the bands or when the price crosses them. I find that with many indicators and strategies it's best to wait for a confirmation of some sort, in this case by waiting for some crossover of a band. Like most mean reversion strategies, the exit is very loose if using BBs alone. Usually the plan to exit is when the price finally reverts back to the mean or in this case the middle band. This can potentially lead to huge drawdowns and/or losses. Mean reversion strategies can have high win/loss ratios but can still end up unprofitable because of the huge losses that can occur. These drawdowns/losses that mean reversion strategies suffer from can potentially eat away at a large chunk of all that was previously made or perhaps up to all of it in the worst cases, can occur weeks or perhaps up to months after being profitable trading such a strategy, and will take a while and several trades to make it all back or keep a profitable track record. It is important to have a stop loss, trailing stop, or some sort of stop plan with these types of strategies. For this one, in addition to exiting the trade when price reverts to the middle band, I included a time-based stop plan that exits with a gain or with a loss to avoid potentially large losses, and to exit after only a few periods after taking the trade if in profit instead of waiting for the price to revert back to the mean.
GMS: Mr. Yen's Color ZoneThis is Mr. Yen's color zone. I have also added an input to adjust the sizes of each box. Mainly targeted for MES and ES.
The default settings are as he describes:
white line is the previous day close
red zone = +/- 20 from the previous day close
yellow zone = +/- 40 from the previous day close
green zone = +/- 60 from the previous day close
blue zone = +/- 100 from the previous day close
The source code is open, so feel free to take a look and see whats up. This indicator is quite similar to his, however there is a gap at the cash close to overnight open on his chart that I'm not sure how to adjust for. In any case, this one is still pretty good!
I hope it helps,
Andre