From my observations and experiences, I've found that there are 2 major catalysts for price movement--
- Price is either trending and reaches a top or bottom, or
- Price is consolidating and ready to make a move in some direction
These movements can be seen quite well from a , which is what mostly gave me the inspiration. When I watch a chart with a BB on it I see that either you're looking to trade price moving out of a squeeze or riding price up/down the band until it crosses over and makes a move to the moving average.
My solution was to multiply the direction of price by the strength of its deviation.
- Price gets converted into a signal between -1.0 (bottom of the range) and 1.0 (top of the range)
- Standard Deviation gets converted into a signal between 0 (next to no deviation from mean) and 100 (highest deviation in lookback)
- These 2 get multiplied by each other
- The result tells you if price action is trending and if its approaching max strength (perhaps Overbought), example: Price is hitting highs (1.0) and deviation is also at its highest (100) = 100, opposite for
- Result can also tell you if price is at the top of the range but the deviation is so tiny and we're mostly pinned to the mean (1.0 * 5 = only 5)
How to Trade this Indicator--
If the indicator is stuck near the middle and purple:
- Don't make directional trades or you'll be eaten alive by the chop
- Good idea to sell options, Iron Condors/Butterflies, etc
- Wait for a move to breakout --> the purple will fade away and give way to a direction
--- As in all trading scenarios, be mindful of fakeouts/short moves to one direction that very quickly get reversed
If the indicator is heading higher:
- This would indicate there is a bull trend going on, get long
- If we are reaching the overbought area, this is an ideal place to take profits or look at spreads like Call Spreads (sell calls)
- I think you can make your own determination of when to sell by either selling when we're in the overbought area (if it reaches there) or staying so long as it is above the zone
If the indicator is heading lower:
- Bear trend, shorting is possible
- Can use this as a contrarian signal to buy lows
A couple of charts with the indicator and a purple squeeze box I've drawn (can sometimes get noisy in real-time, but hindsight is 20/20)--
Bitcoin on Daily with default 20 length
Gamestop on 30 minute time frame with 100 length
Please feel free to use this indicator for your trading or your own indicators. This particular script is very stripped down/bare bones from what I have been working on as an ongoing project. If TradingView ever returns scripts you can sell, I would probably open that up for a small premium.
- Added ability to separate the Standard Deviation length from its Stochastic length
- Added ability to adjust the "straddle box" as I like to call it
- Added some other options besides Standard Deviation to measure dispersion
Personally, I really like the Signal to Noise ratio squared, Coefficient of Variation, and Standard Deviation. StDev is probably the most simple measure and the default. These additions are mostly just an add for fun, but if you find better signals or trading using different ones, then great!
- Added Higher Time Frame functionality. I haven't seen much improvement in signals, I think what makes more sense is increasing the lengths instead, but some might find it more useful
- Added ability to use Bar Colors
- Added alert conditions and alerts-- I personally have not scripted these before and wasn't able to get any real-time alerts generated, so I am not sure this is done correctly... will likely revisit at another time
- Found a small typo in the oscillation tuple function
- Added a Range function to Dispersion methods
Have worked on variable/dynamic lengths, using On Balance Volume, Rates of Change, etc. but haven't seen a lot of improvement in signals, and getting to be a little too complicated for the basis of the script.
If you have any requests or additional feedback, please let me know!
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
It's not something I am uniquely doing, the Repainting function has become a mainstay in TradingView indicator scripts that use Higher Time Frames.