Feature scalerFeature scaler | Pine Utilities series, ready to be used in "study-on-study" fashion |
Includes min-max, normalization, standardization and unit length scaling.
One and only source: en.wikipedia.org
Endpoint inputs allow to set an interval of interest for min-max scaler.
Can be (and should be) applied to other studies, or to the chart itself. In this example, I applied min-max scaling to weighted linear regression's slope values.
Unfortunately, "All data" is still "experimental" and works only on charts where less than 5000 bars are available. max_bars_back() didn't help.
Sup TV
Standardization
[RS]Standardized Trend Mapnothing excessively new here..
a map of standardized trend over multiple lengths, extra parameter for smoothing the input source(close) will remove noise.
Z Score Enhanced Time Segmented Volume (Multi MA)**THIS VERSION HAS BEEN STANDARDIZED WITH A Z SCORE CALCULATION AND ALLOWS THE USER TO SELECT WHICH MOVING AVERAGE THEY WOULD LIKE TO UTILIZE FOR THE SIGNAL LINE**
Chart shows the Non-Standardized Enhanced Time Segmented Volume (Multi MA) with default settings on top and the Standardized version with default settings on the bottom.
Time Segmented Volume was developed by Worden Brothers, Inc to be a leading indicator by comparing various time segments of both price and volume . Essentialy it is designed to measure the amount of money flowing in and out of an instrument.
Time Segmented Volume was originally ported to TradingView by user @liw0 and later corrected by user @vitelot. I never quite understood how to read Time Segmented Volume until I ran across a version by user @storma where they indicated when price would be long or short, but that code also utilized the incorrect calculation from user @liw0.
In an effort to make Time Segmented Volume more accessible and easier to read, I have re-coded it here. The calculations are based on the code from @vitelot and I have added direction indicators below the chart.
If the histogram (TSV) is greater than zero and greater than the moving average, price should be moving long and there will be a green box below the chart.
If TSV falls below the moving average while still being greater than zero, the trend may be exhausting and has been coded to read Price Action Long - FAILURE with a black x below the chart.
If the histogram (TSV) is less than zero and less than the moving average, price should be moving short and there will be a red box below the chart.
If TSV rises above the moving average while still being less than zero, the trend may be exhausting and has been coded to read Price Action Short - FAILURE with a black x below the chart.
At times, the moving average may be above zero while TSV is below zero or vice versa. In these situations the chart will indicate long or short based on whether or not TSV is greater or less than zero. It is possible a new trend may be forming as the moving average obviously lags, but also possible price is consolidating with little volume and causing TSV to oscillate close to zero.
**Z Score // Standardized Option **
Thist Standardized code implements all of the above but also allows the user to select a threshold level that should not need to be adjusted for each instrument (since the output is standardized).
If the TSV value meets the long and short signal requirements above and TSV is greater than the threshold values a green or red box will print ABOVE the oscillator. The histogram will also change color based on which threshold TSV has met.
This calculation allows us to compare current volatility to the mean (moving average) of the population (Z-Length). The closer the TSV Z-Score is to the mean, the closer it will be to the Zero Line and therefore price is likely consolidating and choppy. The farther TSV Z-Score is from the mean, the more likely price is trending.
The MA Mode determines the Moving Average used to calculate TSV itself. The Z-Score is ALWAYS calculated with a simple moving average (as that is the standard calculation for Z-Score).
The Threshold Levels are the levels at which TSV Z-Score will change from gray to yellow, orange, green ( bullish ), or red ( bearish ).
Statistically speaking, confidence levels in relation to Z-Score are noted below. The built in Threshold Levels are the positive and negative values for 90%, 95%, and 99%. This would indicate when volatility is greater than these values they are out of the ordinary from the standard range. You may wish to adjust these levels for TSV Z-Score to be more responsive to your trading needs
80% :: 1.28
85% :: 1.44
90% :: 1.64
95% :: 1.96
99% :: 2.58
The Z Length is the period for which the Z Score is calculated
More information regarding Time Segmented Volume can be found here: www.worden.com
Original code ported by @liw0
Corrected by @vitelot
Updated/Enhancements by @eylwithsteph with inspiration from @storma
Multiple MA Options Credits to @Fractured and @lejmer
Bits and Pieces from @AlexGrover, @Montyjus, and @Jiehonglim
As always, trade at your own risk.
WhipLashThis is a study to determine if small candle bodies (little difference between open and close), regardless of overall candle length (high/low), can be used to filter choppy markets.
The indicator will calculate the selected average "MA Mode" of (close-open). To standardize this result and ensure any filters/thresholds do not need to be recalculated for each instrument the result will be used to calculate the Z Score.
The idea is that when candle bodies are small there is very little actual price movement, and therefore price is choppy. When considering the Z Score of that result, any outliers ie larger candle bodies, could show a potential trend forming. This indicator is similar to QStick but allows more customization by the user.
MA Mode determines which MA is used to smooth the results of (close-open)
Price Smoothing is the number of running periods the MA Mode is calculated for.
The three Thresholds are preset to the 90%, 95%, and 99% levels for Z Score. If these thresholds are altered you may wish to also alter the horizontal lines programmed for each level on the positive and negative sides.
The Z Length is the period for which the Z Score is calculated
Multiple MA Options Credits to @Fractured
Bits and Pieces from @AlexGrover, @Montyjus, and @Jiehonglim
As always, trade at your own risk.
[RS]Normalized Standard SelectorEXPERIMENTAL:
market state, text says it all most of the time at least.