Hurst Spectral Analysis SwamiChartHaving a hard time deciding which wavelength to use for a Hurst analysis? Try a handful at once! SwamiCharts by John Ehlers offers a comprehensive way to visualize an indicator used over a range of lookback periods. The Spectral Analysis SwamiChart shows the bullish or bearish state of a spectrum of bandpasses over a user-defined range of wavelengths. The trader simply selects a bandwidth, a base wavelength, and a step/multiple to see the Spectral Analysis SwamiChart. A vertical column of green or red tends to indicate a very bullish or bearish moment in time, meaning that all bandpasses in the analyzed spectrum are in a bullish or bearish orientation simultaneously.
🏆 Shoutout to DavidF at Sigma-L for all the helpful information, conversations together, & indicator feedback.
🏅Shoutout to @HPotter for the bandpass code, and shoutout to @TerryPascoe for sharing it with me
M-oscillator
Dark Energy Divergence OscillatorThe Dark Energy Divergence Oscillator (DEDO)
What makes The Universe grow at an accelerating pace?
Dark Energy.
What makes The Economy grow at an accelerating pace?
Debt.
Debt is the Dark Energy of The Economy.
I pronounce DEDO "Deed-oh", but variations are fine with me.
Note: The Pine Script version of DEDO is improved from the original formula, which used a constant all-time high calculation in the normalization factor. This was technically not as accurate for calculating liquidity pressure in historical data because it meant that historical prices were being tested against future liquidity factors. Now using Pine, the functions can be normalized for the bar at the time of calculation, so the liquidity factors are normalized per candle, not across the entire series, which feels like an improvement to me.
Thought Process:
It's all about the liquidity. What I started with is a correlation between major stock indices such as SPX and WRESBAL , a balance sheet metric on FRED
After September 2008, when QE was initiated, many asset valuations started to follow more closely with liquidity factors. This led me to create a function that could combine asset prices and liquidity in WRESBAL , in order to calculate their divergence and chart the signal in TradingView.
The original formula:
First, we don't want "non-QE" data. we only want data for the market affected by QE .
So, find SPX on the day of pre-QE: 1255.08 and subtract that from the 2022 top 4818.62 = 3563.54
With this post-QE SPX range, now you can normalize the price level simply by dividing by the range = ( SPX -1255.08)/3563.54)
Normalization produces values from 0 to 1 so that they can be compared with other normalized figures.
In order to test the 0 to 1 normalized SPX range measure against the liquidity number, WRESBAL , it's the same idea: normalize it using the max as the denominator and you get a 0 to 1 liquidity index:
( WRESBAL /4276000000000)
Subtract one from the other to get the divergence:
(( WRESBAL /4276000000000)-(( SPX -1255.08)/3563.54))*10
x10 to reduce decimal places, but this option is configurable in DEDO's input settings tab.
Positive values indicate there's ample liquidity to hold up price or even create bullish momentum in some cases. Negative values mean price levels are potentially extended beyond what liquidity levels can support.
Note: many viewers of the charts on social media wanted the values to go down in alignment with price moving down, so inverting the chart is what I do with Option + I. I like the fact that negative values represent a deficit in liquidity to hold up price but that's just me.
Now with Pine Script and some help from other liquidity focused accounts on TradingView , I was able to derive a script that includes central bank liquidity and Reverse Repo liquidity drain, all in one algorithm, with adjustable settings.
Central bank assets included in this version:
-JPY (Japan)
-CNY (China)
-UK (British Pound)
-SNB (Swiss National Bank)
-ECB (European Central Bank )
Central Bank assets can be adjusted to an allocation % so that the formula is adjusted for the market cap of the asset.
A handy table in the lower right corner displays useful information about the asset market cap, and percentage it represents in the liquidity pool.
Reverse repo soak is also an optional addition in the Input settings using the RRPONTSYD value from FRED. This value is subtracted from global liquidity used to determine divergence since it is swept away from markets when residing in the Fed's reverse repo facility.
There is an option to draw a line at the Zero bound. This provides a convenience so that the line doesn't keep having to be redrawn on every chart. The normalized equation produces a value that should oscillate around zero, as price/valuation grows past liquidity support, falls under it, and repeats in cycles.
Crypto McClellan Oscillator (SLN Fix)This is an adaption of the Mcclellan Oscillator for crypto. Instead of tracking the S&P500 it tracks a selection of cryptos to make sure the indicator follows this sector instead.
Full credit goes to the creator of this indicator: Fadior. It has since been fixed by SLN.
The following description explains the standard McClellan Oscillator. Full credit to Investopedia , my fav source of financial explanations.
The same principles applies to its use in the crypto sector, but please be cautious of the last point, the limitations. Since crypto is more volatile, that could amplify choppy behavior.
This is not financial advice, please be extremely cautious. This indicator is only suitable as a confirmation signal and needs support of other signals to be profitable.
This indicator usually produces the best signals on slightly above daily time frame. I personally like 2 or 3 day, but you have to find the settings suitable for your trading style.
What Is the McClellan Oscillator?
The McClellan Oscillator is a market breadth indicator that is based on the difference between the number of advancing and declining issues on a stock exchange, such as the New York Stock Exchange (NYSE) or NASDAQ.
The indicator is used to show strong shifts in sentiment in the indexes, called breadth thrusts. It also helps in analyzing the strength of an index trend via divergence or confirmation.
The McClellan Oscillator formula can be applied to any stock exchange or group of stocks.
A reading above zero helps confirm a rise in the index, while readings below zero confirm a decline in the index.
When the index is rising but the oscillator is falling, that warns that the index could start declining too. When the index is falling and the oscillator is rising, that indicates the index could start rising soon. This is called divergence.
A significant change, such as moving 100 points or more, from a negative reading to a positive reading is called a breadth thrust. It may indicate a strong reversal from downtrend to uptrend is underway on the stock exchange.
How to Calculate the McClellan Oscillator
To get the calculation started, track Advances - Declines on a stock exchange for 19 and 39 days. Calculate a simple average for these, not exponential moving average (EMA).
Use these simple values as the Prior Day EMA values in the 19- and 39-day EMA formulas.
Calculate the 19- and 39-day EMAs.
Calculate the McClellan Oscillator value.
Now that the value has been calculated, on the next calculation use this value for the Prior Day EMA. Start calculating EMAs for the formula instead of simple averages.
If using the adjusted formula, the steps are the same, except use ANA instead of using Advances - Declines.
What Does the McClellan Oscillator Tell You?
The McClellan Oscillator is an indicator based on market breadth which technical analysts can use in conjunction with other technical tools to determine the overall state of the stock market and assess the strength of its current trend.
Since the indicator is based on all the stocks in an exchange, it is compared to the price movements of indexes that reflect that exchange, or compared to major indexes such as the S&P 500.
Positive and negative values indicate whether more stocks, on average, are advancing or declining. The indicator is positive when the 19-day EMA is above the 39-day EMA, and negative when the 19-day EMA is below the 39-day EMA.
A positive and rising indicator suggests that stocks on the exchange are being accumulated. A negative and falling indicator signals that stocks are being sold. Typically such action confirms the current trend in the index.
Crossovers from positive to negative, or vice versa, may signal the trend has changed in the index or exchange being tracked. When the indicator makes a large move, typically of 100 points or more, from negative to positive territory, that is called a breadth thrust.
It means a large number of stocks moved up after a bearish move. Since the stock market tends to rise over time, this a positive signal and may indicate that a bottom in the index is in and prices are heading higher overall.
When index prices and the indicator are moving in different directions, then the current index trend may lack strength. Bullish divergence occurs when the oscillator is rising while the index is falling. This indicates the index could head higher soon since more stocks are starting to advance.
Bearish divergence is when the index is rising and the indicator is falling. This means fewer stocks are keeping the advance going and prices may start to head lower.
Limitations of Using the McClellan Oscillator
The indicator tends to produce lots of signals. Breadth thrusts, divergence, and crossovers all occur with some frequency, but not all these signals will result in the price/index moving in the expected direction.
The indicator is prone to producing false signals and therefore should be used in conjunction with price action analysis and other technical indicators.
The indicator can also be quite choppy, moving between positive and negative territory rapidly. Such action indicates a choppy market, but this isn't evident until the indicator has made this whipsaw move a few times.
Good luck and a big thanks to Fadior!
[blackcat] L3 Banker Fund SentimentLevel: 3
Background
If you like my banker fund series indicators, this may be another helpful one which describe banker fund sentiment with price and volume infomation.
c.
Function
Use price (major EMAs and SMAs) and volume infomation to model banker fund in a sensitive way which can be called banker fund sentiment. This was realized by a form of oscillator and 0 axis is an important boundary to define bull and bear senmtiments. I use different kind colors of columns to distinguish them.
I summarize how to use it in 1D timeframe:
1. When a fuchsia column appears below the 0 axis, start paying attention and watch for a bullish reversval around.
2. When a red column appears on the first day above the 0 axis, it is a signal of confirmed bullish trend.
3. There is a retraced in the middle and start doing T+0 trading to reduce costs.
4. When the pile of columns ( banker fund energy) breaks through the previous high in the late stage of the retracement, start to increase the bullish position, and be a short-term bullish relay, this is the best buying point!
5. Wait for 3-4 days to start reducing or flatting positions, and make your own decisions according to your personal risk preferences!
Remarks
When the pile of column breaks through the previous high point in the late stage of the retracement, and if the stock is a recent hot sector or concept stock,
Then increase your position and wait for the main force to pump! This indicator may not work alone, you should consider to combine your knowledge of other skills, e.g. candle pattern, news analysis etc.
B: long entry, green
S: short entry, red
column color
bullish trend: red color
confirmed bullish trend: maroon color
bullish retracement: blue color
bearish trend: green color
bearish retracement: fuchsia color
Feedbacks are appreciated.
Dominant Cycle Detection OscillatorThis is a Dominant Cycle Detection Oscillator that searches multiple ranges of wavelengths within a spectrum. Choose one of 4 different dominant cycle detection methods (MESA MAMA cycle, Pearson Autocorrelation, Discreet Fourier Transform, and Phase Accumulation) to determine the most dominant cycles and see the historical results. Straight lines can indicate a steady dominant cycle; while Wavy lines might indicate a varying dominant cycle length. The steadier the cycle, the easier it may be to predict future events in that cycle (keep the log scale in mind when considering steadiness). The presence of evenly divisible (or harmonic) cycle lengths may also indicate stronger cycles; for example, 19, 38, and 76 dominant lengths for the 2x, 4x, and 8x cycles. Practically, a trader can use these cycle outputs as the default settings for other Hurst/cycle indicators. For example, if you see dominant cycle oscillator outputs of 38 & 76 for the 4x and 8x cycle respectively, you might want to test/use defaults of 38 & 76 for the 4x & 8x lengths in the bandpass, diamond/semi-circle notation, moving average & envelope, and FLD instead of the defaults 40 & 80 for a more fine-tuned analysis.
Muting the oscillator's historical lines and overlaying the indicator on the chart can visually cue a trader to the cycle lengths without taking up extra panes. The DFT Cycle lengths with muted historical lines have been overlayed on the chart in the photo.
The y-axis scale for this indicator's pane (just the oscillator pane, not the chart) most likely needs to be changed to logarithmic to look normal, but it depends on the search ranges in your settings. There are instructions in the settings. In the photo, the MESA MAMA scale is set to regular (not logarithmic) which demonstrates how difficult it can be to read if not changed.
In the Spectral Analysis chapter of Hurst's book Profit Magic, he recommended doing a Fourier analysis across a spectrum of frequencies. Hurst acknowledged there were many ways to do this analysis but recommended the method described by Lanczos. Currently in this indicator, the closest thing to the method described by Lanczos is the DFT Discreet Fourier Transform method.
Shoutout to @lastguru for the dominant cycle library referenced in this code. He mentioned that he may add more methods in the future.
Limited Fisher Transformwhat is Limited Fisher Transform?
This indicator is a compressed version of the Fisher transform indicator between 100 and 0 values.
what it does?
It allows us to define overbought and oversold zones by compressing the values of the "fisher transform" indicator between 0 and 100. also these zones are the same for every timeframe and trading pair, just like RSI.
how it does it?
it use this formula:
x = fisher transform values
a = average
how to use it?
its use is indistinguishable from the standard fisher. You can use it to set alarms for overbought and oversold zones. so you will be notified when a possible opportunity arises in the market.
change in rsiThis indicator will show how fast the rsi of a symbol is changing. you can see this as a differentiation function on rsi .
this will show the change in rsi in percentage.
Ex: suppose the rsi of a symbol at present is 60 and the previous value of rsi was 52,
as you can see the rsi has increased, which is a sign of the symbol being bullish .
this indicator will tell by what percentage the rsi of the symbol has increased or decreased.
for the above example, the change in rsi is 15.38% increase.
this is set to default chart time-frame.
VWOP: Volume Weighted & Oscillated PriceWhile playing around with the standard "ta.vwap" I wondered why there was no length input, so I did some research on what the underlying calculation actually is, and did my best to augment it so as to allow for a variable length based on an oscillator value.
Normal VWAP = (Number of Shares Bought x Typical Price) / Total Volume
In my VWOP Calculation, typical price is replaced by selected moving average type or "matype" and then multiplied by the volume.
Then a total value is calculated using math.sum with a length value that changes according to a selected oscillator's value. The total is then divided by
the sum of just volume using the same oscillating length value. Result is then passed through the selected"matype" once more to give the final result.
Indicator designed for use as a entry/exit indicator in conjunction with more traditional moving averages and/or signal filters. Useful for taking volume + an oscillator into account along with price, instead of just the price as with a simple moving average.
Hurst Spectral Analysis Oscillator"It is a true fact that any given time history of any event (including the price history of a stock) can always be considered as reproducible to any desired degree of accuracy by the process of algebraically summing a particular series of sine waves. This is intuitively evident if you start with a number of sine waves of differing frequencies, amplitudes, and phases, and then sum them up to get a new and more complex waveform." (Spectral Analysis chapter of J M Hurst's book, Profit Magic )
Background: A band-pass filter or bandpass filter is a device that passes frequencies within a certain range and rejects (attenuates) frequencies outside that range. Bandpass filters are widely used in wireless transmitters and receivers. Well-designed bandpass filters (having the optimum bandwidth) maximize the number of signal transmitters that can exist in a system while minimizing the interference or competition among signals. Outside of electronics and signal processing, other examples of the use of bandpass filters include atmospheric sciences, neuroscience, astronomy, economics, and finance.
About the indicator: This indicator will accept float/decimal length inputs to display a spectrum of 11 bandpass filters. The trader can select a single bandpass for analysis that includes future high/low predictions. The trader can also select which bandpasses contribute to a composite model of expected price action.
10 Statements to describe the 5 elements of Hurst's price-motion model:
Random events account for only 2% of the price change of the overall market and of individual issues.
National and world historical events influence the market to a negligible degree.
Foreseeable fundamental events account for about 75% of all price motion. The effect is smooth and slow changing.
Unforeseeable fundamental events influence price motion. They occur relatively seldom, but the effect can be large and must be guarded against.
Approximately 23% of all price motion is cyclic in nature and semi-predictable (basis of the "cyclic model").
Cyclicality in price motion consists of the sum of a number of (non-ideal) periodic cyclic "waves" or "fluctuations" (summation principle).
Summed cyclicality is a common factor among all stocks (commonality principle).
Cyclic component magnitude and duration fluctuate slowly with the passage of time. In the course of such fluctuations, the greater the magnitude, the longer the duration and vice-versa (variation principle).
Principle of nominality: an element of commonality from which variation is expected.
The greater the nominal duration of a cyclic component, the larger the nominal magnitude (principle of proportionality).
Shoutouts & Credits for all the raw code, helpful information, ideas & collaboration, conversations together, introductions, indicator feedback, and genuine/selfless help:
🏆 @TerryPascoe
🏅 DavidF at Sigma-L, and @HPotter
👏 @Saviolis, parisboy, and @upslidedown
HS,HH,LL,and EMA by: rpalconitHello everyone,
HS,HH,LL, and EMA stands for Hull Suite, Higher High, Lower Low and Exponential Moving Average.
Signal Features:
• Long Position: If the Higher High and Lower Low signals are LL and LH at the SUPPORT LEVEL, plot the Fibonacci Retracement and get retracement from 0.382,0.5 and 0.618 for EP. and your SL should be at 1.1 level of the Fibonacci, target TP should be 1.5 ratio. For confirmations the Hull Suite (HS) should be green color and on or below the Exponential Moving Average (EMA).
• Short Position: If the Higher High and Lower Low signals are HH and HL at the RESISTANCE LEVEL, plot the Fibonacci Retracement and get retracement from 0.382,0.5 and 0.618 for EP. and your SL should be at 1.1 level of the Fibonacci, target TP should be 1.5 ratio. For confirmations the Hull Suite (HS) should be red color and on or above the Exponential Moving Average (EMA).
You can change EMA length in any of your preference. The Default is 50.
Details about the indicator
INPUTS
Time Frame
• Time Frames Chart: You can select your preferred timeframe at the dropdown list. Default is 4H. Aside from Time Fame, I advice not to change anything at input default for better result.
STYLE
• Note: For effective signals results and to minimize noise, you need to uncheck first on the style tab: MHULL, BAR COLOR AND LINES.
Best regards,
ruelpalconit
Any Oscillator Underlay [TTF]We are proud to release a new indicator that has been a while in the making - the Any Oscillator Underlay (AOU) !
Note: There is a lot to discuss regarding this indicator, including its intent and some of how it operates, so please be sure to read this entire description before using this indicator to help ensure you understand both the intent and some limitations with this tool.
Our intent for building this indicator was to accomplish the following:
Combine all of the oscillators that we like to use into a single indicator
Take up a bit less screen space for the underlay indicators for strategies that utilize multiple oscillators
Provide a tool for newer traders to be able to leverage multiple oscillators in a single indicator
Features:
Includes 8 separate, fully-functional indicators combined into one
Ability to easily enable/disable and configure each included indicator independently
Clearly named plots to support user customization of color and styling, as well as manual creation of alerts
Ability to customize sub-indicator title position and color
Ability to customize sub-indicator divider lines style and color
Indicators that are included in this initial release:
TSI
2x RSIs (dubbed the Twin RSI )
Stochastic RSI
Stochastic
Ultimate Oscillator
Awesome Oscillator
MACD
Outback RSI (Color-coding only)
Quick note on OB/OS:
Before we get into covering each included indicator, we first need to cover a core concept for how we're defining OB and OS levels. To help illustrate this, we will use the TSI as an example.
The TSI by default has a mid-point of 0 and a range of -100 to 100. As a result, a common practice is to place lines on the -30 and +30 levels to represent OS and OB zones, respectively. Most people tend to view these levels as distance from the edges/outer bounds or as absolute levels, but we feel a more way to frame the OB/OS concept is to instead define it as distance ("offset") from the mid-line. In keeping with the -30 and +30 levels in our example, the offset in this case would be "30".
Taking this a step further, let's say we decided we wanted an offset of 25. Since the mid-point is 0, we'd then calculate the OB level as 0 + 25 (+25), and the OS level as 0 - 25 (-25).
Now that we've covered the concept of how we approach defining OB and OS levels (based on offset/distance from the mid-line), and since we did apply some transformations, rescaling, and/or repositioning to all of the indicators noted above, we are going to discuss each component indicator to detail both how it was modified from the original to fit the stacked-indicator model, as well as the various major components that the indicator contains.
TSI:
This indicator contains the following major elements:
TSI and TSI Signal Line
Color-coded fill for the TSI/TSI Signal lines
Moving Average for the TSI
TSI Histogram
Mid-line and OB/OS lines
Default TSI fill color coding:
Green : TSI is above the signal line
Red : TSI is below the signal line
Note: The TSI traditionally has a range of -100 to +100 with a mid-point of 0 (range of 200). To fit into our stacking model, we first shrunk the range to 100 (-50 to +50 - cut it in half), then repositioned it to have a mid-point of 50. Since this is the "bottom" of our indicator-stack, no additional repositioning is necessary.
Twin RSI:
This indicator contains the following major elements:
Fast RSI (useful if you want to leverage 2x RSIs as it makes it easier to see the overlaps and crosses - can be disabled if desired)
Slow RSI (primary RSI)
Color-coded fill for the Fast/Slow RSI lines (if Fast RSI is enabled and configured)
Moving Average for the Slow RSI
Mid-line and OB/OS lines
Default Twin RSI fill color coding:
Dark Red : Fast RSI below Slow RSI and Slow RSI below Slow RSI MA
Light Red : Fast RSI below Slow RSI and Slow RSI above Slow RSI MA
Dark Green : Fast RSI above Slow RSI and Slow RSI below Slow RSI MA
Light Green : Fast RSI above Slow RSI and Slow RSI above Slow RSI MA
Note: The RSI naturally has a range of 0 to 100 with a mid-point of 50, so no rescaling or transformation is done on this indicator. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Stochastic and Stochastic RSI:
These indicators contain the following major elements:
Configurable lengths for the RSI (for the Stochastic RSI only), K, and D values
Configurable base price source
Mid-line and OB/OS lines
Note: The Stochastic and Stochastic RSI both have a normal range of 0 to 100 with a mid-point of 50, so no rescaling or transformations are done on either of these indicators. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Ultimate Oscillator (UO):
This indicator contains the following major elements:
Configurable lengths for the Fast, Middle, and Slow BP/TR components
Mid-line and OB/OS lines
Moving Average for the UO
Color-coded fill for the UO/UO MA lines (if UO MA is enabled and configured)
Default UO fill color coding:
Green : UO is above the moving average line
Red : UO is below the moving average line
Note: The UO naturally has a range of 0 to 100 with a mid-point of 50, so no rescaling or transformation is done on this indicator. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Awesome Oscillator (AO):
This indicator contains the following major elements:
Configurable lengths for the Fast and Slow moving averages used in the AO calculation
Configurable price source for the moving averages used in the AO calculation
Mid-line
Option to display the AO as a line or pseudo-histogram
Moving Average for the AO
Color-coded fill for the AO/AO MA lines (if AO MA is enabled and configured)
Default AO fill color coding (Note: Fill was disabled in the image above to improve clarity):
Green : AO is above the moving average line
Red : AO is below the moving average line
Note: The AO is technically has an infinite (unbound) range - -∞ to ∞ - and the effective range is bound to the underlying security price (e.g. BTC will have a wider range than SP500, and SP500 will have a wider range than EUR/USD). We employed some special techniques to rescale this indicator into our desired range of 100 (-50 to 50), and then repositioned it to have a midpoint of 50 (range of 0 to 100) to meet the constraints of our stacking model. We then do one final repositioning to place it in the correct position the indicator-stack based on which other indicators are also enabled. For more details on how we accomplished this, read our section "Binding Infinity" below.
MACD:
This indicator contains the following major elements:
Configurable lengths for the Fast and Slow moving averages used in the MACD calculation
Configurable price source for the moving averages used in the MACD calculation
Configurable length and calculation method for the MACD Signal Line calculation
Mid-line
Note: Like the AO, the MACD also technically has an infinite (unbound) range. We employed the same principles here as we did with the AO to rescale and reposition this indicator as well. For more details on how we accomplished this, read our section "Binding Infinity" below.
Outback RSI (ORSI):
This is a stripped-down version of the Outback RSI indicator (linked above) that only includes the color-coding background (suffice it to say that it was not technically feasible to attempt to rescale the other components in a way that could consistently be clearly seen on-chart). As this component is a bit of a niche/special-purpose sub-indicator, it is disabled by default, and we suggest it remain disabled unless you have some pre-defined strategy that leverages the color-coding element of the Outback RSI that you wish to use.
Binding Infinity - How We Incorporated the AO and MACD (Warning - Math Talk Ahead!)
Note: This applies only to the AO and MACD at time of original publication. If any other indicators are added in the future that also fall into the category of "binding an infinite-range oscillator", we will make that clear in the release notes when that new addition is published.
To help set the stage for this discussion, it's important to note that the broader challenge of "equalizing inputs" is nothing new. In fact, it's a key element in many of the most popular fields of data science, such as AI and Machine Learning. They need to take a diverse set of inputs with a wide variety of ranges and seemingly-random inputs (referred to as "features"), and build a mathematical or computational model in order to work. But, when the raw inputs can vary significantly from one another, there is an inherent need to do some pre-processing to those inputs so that one doesn't overwhelm another simply due to the difference in raw values between them. This is where feature scaling comes into play.
With this in mind, we implemented 2 of the most common methods of Feature Scaling - Min-Max Normalization (which we call "Normalization" in our settings), and Z-Score Normalization (which we call "Standardization" in our settings). Let's take a look at each of those methods as they have been implemented in this script.
Min-Max Normalization (Normalization)
This is one of the most common - and most basic - methods of feature scaling. The basic formula is: y = (x - min)/(max - min) - where x is the current data sample, min is the lowest value in the dataset, and max is the highest value in the dataset. In this transformation, the max would evaluate to 1, and the min would evaluate to 0, and any value in between the min and the max would evaluate somewhere between 0 and 1.
The key benefits of this method are:
It can be used to transform datasets of any range into a new dataset with a consistent and known range (0 to 1).
It has no dependency on the "shape" of the raw input dataset (i.e. does not assume the input dataset can be approximated to a normal distribution).
But there are a couple of "gotchas" with this technique...
First, it assumes the input dataset is complete, or an accurate representation of the population via random sampling. While in most situations this is a valid assumption, in trading indicators we don't really have that luxury as we're often limited in what sample data we can access (i.e. number of historical bars available).
Second, this method is highly sensitive to outliers. Since the crux of this transformation is based on the max-min to define the initial range, a single significant outlier can result in skewing the post-transformation dataset (i.e. major price movement as a reaction to a significant news event).
You can potentially mitigate those 2 "gotchas" by using a mechanism or technique to find and discard outliers (e.g. calculate the mean and standard deviation of the input dataset and discard any raw values more than 5 standard deviations from the mean), but if your most recent datapoint is an "outlier" as defined by that algorithm, processing it using the "scrubbed" dataset would result in that new datapoint being outside the intended range of 0 to 1 (e.g. if the new datapoint is greater than the "scrubbed" max, it's post-transformation value would be greater than 1). Even though this is a bit of an edge-case scenario, it is still sure to happen in live markets processing live data, so it's not an ideal solution in our opinion (which is why we chose not to attempt to discard outliers in this manner).
Z-Score Normalization (Standardization)
This method of rescaling is a bit more complex than the Min-Max Normalization method noted above, but it is also a widely used process. The basic formula is: y = (x – μ) / σ - where x is the current data sample, μ is the mean (average) of the input dataset, and σ is the standard deviation of the input dataset. While this transformation still results in a technically-infinite possible range, the output of this transformation has a 2 very significant properties - the mean (average) of the output dataset has a mean (μ) of 0 and a standard deviation (σ) of 1.
The key benefits of this method are:
As it's based on normalizing the mean and standard deviation of the input dataset instead of a linear range conversion, it is far less susceptible to outliers significantly affecting the result (and in fact has the effect of "squishing" outliers).
It can be used to accurately transform disparate sets of data into a similar range regardless of the original dataset's raw/actual range.
But there are a couple of "gotchas" with this technique as well...
First, it still technically does not do any form of range-binding, so it is still technically unbounded (range -∞ to ∞ with a mid-point of 0).
Second, it implicitly assumes that the raw input dataset to be transformed is normally distributed, which won't always be the case in financial markets.
The first "gotcha" is a bit of an annoyance, but isn't a huge issue as we can apply principles of normal distribution to conceptually limit the range by defining a fixed number of standard deviations from the mean. While this doesn't totally solve the "infinite range" problem (a strong enough sudden move can still break out of our "conceptual range" boundaries), the amount of movement needed to achieve that kind of impact will generally be pretty rare.
The bigger challenge is how to deal with the assumption of the input dataset being normally distributed. While most financial markets (and indicators) do tend towards a normal distribution, they are almost never going to match that distribution exactly. So let's dig a bit deeper into distributions are defined and how things like trending markets can affect them.
Skew (skewness): This is a measure of asymmetry of the bell curve, or put another way, how and in what way the bell curve is disfigured when comparing the 2 halves. The easiest way to visualize this is to draw an imaginary vertical line through the apex of the bell curve, then fold the curve in half along that line. If both halves are exactly the same, the skew is 0 (no skew/perfectly symmetrical) - which is what a normal distribution has (skew = 0). Most financial markets tend to have short, medium, and long-term trends, and these trends will cause the distribution curve to skew in one direction or another. Bullish markets tend to skew to the right (positive), and bearish markets to the left (negative).
Kurtosis: This is a measure of the "tail size" of the bell curve. Another way to state this could be how "flat" or "steep" the bell-shape is. If the bell is steep with a strong drop from the apex (like a steep cliff), it has low kurtosis. If the bell has a shallow, more sweeping drop from the apex (like a tall hill), is has high kurtosis. Translating this to financial markets, kurtosis is generally a metric of volatility as the bell shape is largely defined by the strength and frequency of outliers. This is effectively a measure of volatility - volatile markets tend to have a high level of kurtosis (>3), and stable/consolidating markets tend to have a low level of kurtosis (<3). A normal distribution (our reference), has a kurtosis value of 3.
So to try and bring all that back together, here's a quick recap of the Standardization rescaling method:
The Standardization method has an assumption of a normal distribution of input data by using the mean (average) and standard deviation to handle the transformation
Most financial markets do NOT have a normal distribution (as discussed above), and will have varying degrees of skew and kurtosis
Q: Why are we still favoring the Standardization method over the Normalization method, and how are we accounting for the innate skew and/or kurtosis inherent in most financial markets?
A: Well, since we're only trying to rescale oscillators that by-definition have a midpoint of 0, kurtosis isn't a major concern beyond the affect it has on the post-transformation scaling (specifically, the number of standard deviations from the mean we need to include in our "artificially-bound" range definition).
Q: So that answers the question about kurtosis, but what about skew?
A: So - for skew, the answer is in the formula - specifically the mean (average) element. The standard mean calculation assumes a complete dataset and therefore uses a standard (i.e. simple) average, but we're limited by the data history available to us. So we adapted the transformation formula to leverage a moving average that included a weighting element to it so that it favored recent datapoints more heavily than older ones. By making the average component more adaptive, we gained the effect of reducing the skew element by having the average itself be more responsive to recent movements, which significantly reduces the effect historical outliers have on the dataset as a whole. While this is certainly not a perfect solution, we've found that it serves the purpose of rescaling the MACD and AO to a far more well-defined range while still preserving the oscillator behavior and mid-line exceptionally well.
The most difficult parts to compensate for are periods where markets have low volatility for an extended period of time - to the point where the oscillators are hovering around the 0/midline (in the case of the AO), or when the oscillator and signal lines converge and remain close to each other (in the case of the MACD). It's during these periods where even our best attempt at ensuring accurate mirrored-behavior when compared to the original can still occasionally lead or lag by a candle.
Note: If this is a make-or-break situation for you or your strategy, then we recommend you do not use any of the included indicators that leverage this kind of bounding technique (the AO and MACD at time of publication) and instead use the Trandingview built-in versions!
We know this is a lot to read and digest, so please take your time and feel free to ask questions - we will do our best to answer! And as always, constructive feedback is always welcome!
VolumeFlowVolume & price have a direct correlation with each other. If the fundamental value changes, the price changes and volume follows. If the technicals change, volume changes and price follows.
Because the relationship between volume and price is so connected, I created a script highlighting important volume flow measurements.
The VolumeFlow indicator combines several volume measurements into 1 indicator.
1) Volume net inflow / outflow
2) Volume total flow change
3) Volume cumulation flow
The VolumeFlow indicator uses a scale from 100 high to -100 low, with the zero level being neutral.
The VolumeFlow indicator has 4 inputs:
1) +Volume-
2) VolumeFast
3) VolumeSlow
4) Accum/Dist
Default inputs:
+Volume-
length = 1, color = + green or - red
VolumeFast
length = 2, color = blue
VolumeSlow
length = 3, color = white
Accum/Dist
length = 5, color = brown
Horizontal lines
length = 100, 50, 0, -50, -100, color = white
* The VolumeFlow indicator uses altered pieces of code from my Options360 FibVIP indicator, Tradingview "Up / down volume" indicator and Tradingview "Accumulation/Distribution" indicator. *
VIX OscillatorThis is my VIX Oscillator indicator.
About it:
This indicator takes the Z-Score of the VIX and of the current ticker you are on and presents them in the format of an oscillator.
Key parts of the indicator:
A diagram of the key elements of the indicator are displayed above.
Purple Line: Represents the Z-Score of the current Ticker.
Blue Line: Represents the Z-Score of the VIX
Green fill line: Represents bullish divergence
Red fill line: Represents bearish divergence
How to use it:
Characteristics for long entries:
- Look for recent bullish divergence (green fill line)
- Look for the ticker line (purple line) to be holding above 0 (neutrality)
- look for a bullish cross (purple line (ticker) crossing over blue line (VIX))
Characteristics for short entries:
- Look for recent Bearish divergence
- Look for the VIX line (blue line) to be holding above 0 and the Ticker
- Look for the ticker line to be holding below 0
- Look for a bearish cross (blue crossing above purple)
Some principles:
The bands represent oversold, overbought and neutral.
0 is absolute neutrality. No bias here.
Anything towards + 2.5 is considered normal, moving towards overbought (2.5 or higher).
Anything towards -2.5 is considered normal, moving towards oversold (-2.5 or lower).
+2.5 or higher is overbought.
-2.5 or lower is oversold.
As always, I have prepared a quick tutorial video for your reference of this indicator:
Please let me know your questions, comments or suggestions about this indicator below.
Thank you for checking it out!
Composite Cosmetic CandlesThis is effectively version 2 of my script "Candle Fill % Meter", with a few different/more options available in a more compact form. Choose between multiple oscillator sources, # of dividing lines, and solid or gradient candle fill. Once again this script is intended for use with hollow candles! This script enables you to see more information with less screen space taken up, not to mention it looks nice. Labels by last bar also toggleable in the settings.
[blackcat] L3 Jurik MACDLevel: 3
Background
Use Jurik MA to build MACD and many people need to judge the market trend against the main candlestick chart when using MACD .
Function
First of all, the MACD function is built with Jurik MA and ALMA for better performance.
Second, the principle of MACD is the difference between EMA's long-term and short-term values. So, I wonder if it is possible to use EMA to construct a set of candle charts that are similar in proportion to MACD values for overlapping comparisons? Because this can greatly facilitate traders to make quick trend judgments. So I used the 3-8 lines of EMA to simulate the KD of KDJ, constructed a set of candle charts, and generated buying and selling points through conditional constraints. Do you like this MACD + Candlestick chart?
Key Signal
Traditional Jurik MACD output signal
Candlesticks
Near Top --> Top is reached and reversal may happen soon. (fuchsia labels)
Near Bottom --> Bottom is reached and reversal may happen soon. (yellow labels)
Remarks
Feedbacks are appreciated.
Balance of Force (BOF)The script "Balance of Force" is an indicator that aims to provide insight into the bullish and bearish forces present in the market by analyzing the relationship between bullish and bearish true ranges. The indicator first calculates the bearish and bullish true ranges by taking the absolute difference between the open and close prices for each period and summing these values over a user-specified length. It then calculates the ratio of the bullish true range to the bearish true range and takes the natural logarithm of this value, resulting in the "bullish-bearish ratio".
The script then calculates the standard deviation of this ratio over a user-specified length to create a measure of volatility. Using this deviation and the dominant cycle, it then applies an exponential moving average to smooth the ratio. The indicator plots the smoothed ratio, the raw ratio, and the deviation of the ratio multiplied by 1, 2 and 3 in addition to filling the area between the deviation multiplied by 3 and the log(1) with red and green. The user can use the indicator to identify potential bullish or bearish market conditions by analyzing the relationship between the smoothed ratio and the log(1) and the deviation of the ratio.
Rotational Gravity OscillatorMade using elements from two Cheatcountry scripts:
Includes a Bollinger Band for bounds that forms a trend follower based on the 0 point.
Includes CheatCountry color code signals, different color scheme. Bright colors are strong signals, ark are weak, green bull, red bear, the basics.
Switches for Bollinger Band color codes, which can actually be useful signals.
This oscillator can be used for divergences, trends, signal strength, confirmation, volatility readings, you name it.
It is a comparative oscillator, that compares adaptively smoothed, weighted modified Change of Gravity oscillators between 2 symbols and multiple lengths to determine directional momentum as one asset compares to another.
The default uses the Crypto TOTAL market cap to help trade cryptocurrencies. You will notice that BTC will give sell signals in uptrends at times. That is because it is being compared to an index of the total Crypto market cap, and since alt-coins move faster, BTC will lag behind this index.
Give CheatCountry a follow, hes one of the MVPs of Tradingview Pinescripters, constantly giving us access to novel new concepts as they are published by professionals.
True Range Adjusted Exponential Momentum [CC]-[burgered]Original Script by CheatCountry, used with permission (chill guy):
I have made a sort of conversion of CheatCountries implementation of the True Range Adjusted Exponential Moving Average into a momentum oscillator.
Being True Range based, it the bounds vary based on the chart.
Includes a Bollinger Band for bounds that forms a trend follower based on the 0 point.
Includes CheatCountry color code signals, different color scheme. Bright colors are strong signals, ark are weak, green bull, red bear, the basics.
This oscillator can be used for divergences, trends, signal strength, confirmation, volatility readings, you name it.
Works well on smoothed/filtered signals as well.
Give CheatCountry a follow, hes one of the MVPs of Tradingview Pinescripters, constantly giving us access to novel new concepts as they are published by professionals.
Dynamic Linear Regression Oscillator | AdulariDescription:
This dynamic linear regression oscillator visualizes the general price trend of specific ranges in the chart based on the linear regression calculation, it automatically determines these ranges with pivot detection. The central line of the indicator is the baseline of the linear regression itself. This is a good tool to use to determine when a price is unusually far away from its baseline. The lines above or below it are overbought and oversold zones. These zones are based on the high or low of the range, in combination with the set multipliers.
The overbought and oversold lines indicate support and resistance; when the prices stay outside these levels for a significant period of time, a reversal can be expected soon. When the oscillator's value crosses above the signal or smoothed line the trend may become bullish. When it crosses below, the trend may become bearish.
This indicator is quite special, as it first determines price ranges using pivot detection. It then uses the middle of the range to determine how far the current price is from the baseline. This value is then rescaled compared to a set amount of bars back, putting it into relevant proportions with the current price action.
How do I use it?
Never use this indicator as standalone trading signal, it should be used as confluence.
When the value crosses above the signal this indicates the current bearish trend is getting weak and may reverse upwards.
When the value crosses below the signal this indicates the current bullish trend is getting weak and may reverse downwards.
When the value is above the middle line this shows the bullish trend is strong.
When the value is below the middle line this shows the bearish trend is strong.
When the value crosses above the upper line this indicates the trend may reverse downwards.
When the value crosses below the lower line this indicates the trend may reverse upwards.
Features:
Oscillator value indicating how far the price has currently deviated from the middle of the range. Proportioned to data from a set amount of bars ago.
Signal value to indicate whether or not the price is abnormally far from the middle of the range.
Horizontal lines such as oversold, overbought and middle lines, indicating possible reversal zones.
Automatic range detection using pivots.
Built-in rescaling functionality to ensure values are proportionate with the latest data.
How does it work? (simplified)
1 — Calculate the middle of the range.
2 — Define whether the current price is above the middle of the range or below.
3 — If above the middle of the range, calculate the difference of the current high and the middle line. If below, calculate the difference of the current low and the middle line.
4 — Smooth the value using a set moving average type.
5 — Rescale the value to proportionate it with the latest data.
RAINBOW_13thHi Dears!
hereby, I present you one of my indicators which is a kind of artistic indicator.
It calculates different ranks of functions and based on them suggests a buy or sell order which is depicted on right-side separately.
Inputs:
(For calculating)
+Source:
+Length: Number of previous bars in calculation
+Topology:
++EMA
++RMA
++SMA
++RSI
+OVER BOUGHT RSI: Define your boundary for overbought in RSI-TOPOLOGY.
+OVER SOLD RSI: Define your boundary for oversold in RSI-TOPOLOGY.
(Visual)
+Transparency: affect colors of rainbow!
Wish you good deals!
BY USING PLZ DO NOT FORGET TO BOOST IT!
Shakib.
RSI Pull-BackA pull-back occurs whenever the price or the value of an indicator breaks a line and comes back to test it before continuing in the prevailing trend.
The RSI has oversold and overbought levels such as 20 and 80 and whenever the market breaks them returns to normality, we can await a pull-back to them before the reversal continues.
This indicator shows the following signals:
* A bullish signal is generated whenever the RSI surpasses the chosen oversold level then directly shapes a pull-back to it without breaking it again.
* A bearish signal is generated whenever the RSI breaks the chosen overbought level then directly shapes a pull-back to it without surpassing it again.
TOTAL:(RSI+TSI)TOTAL:(RSI+TSI)
This indicator collects instant data of RSI and TSI oscillators. RSI moves between (0) and (100) values as a moving line, while TSI moves between (-100) and (+100) values as two moving lines.
The top value of the sum of these values is graphically;
It takes the total value (+300) from RSI (+100), TSI (+100) and (+100).
The lowest value of the sum of these values is graphically;
It takes the value (-200) from the RSI (0), (-100) and (-100) from the TSI.
In case this indicator approaches (+300) graphically; It can be seen that price candlesticks mostly move upwards. This may not always give accurate results. Past incompatibilities can affect this situation.
In case this indicator approaches (-200) graphically; It can be seen that price candlesticks mostly move downwards. This may not always give accurate results. Past incompatibilities can affect this situation.
The graphical movements and numerical values created by this indicator do not give precise results for price candles.
RSI Accumulation/Distribution [M]Hello everyone,
After my long tests, I observed that the rate of change of direction of the price was high after the periods when the RSI spent a long time outside the band. As a result of my observations, I prepared this indicator.
This indicator shows you the accumulation and distribution areas that occur outside the rsi band.
There are 3 different levels available.
Level 1 = 5 Bars
Level 2 = 7 Bars
Level 3 = 9 Bars
For example, if the RSI spends more than 9 bars below the 30 level or above the 70 level, it will paint that area red. Levels can be changed from the indicator settings. The rsi is smoothed with simple moving average to reduce fake signals.
Using the RSI A/D indicator with different indicators or patterns will increase your success rate.
Examples: