Hybrid Triple Exponential Smoothing🙏🏻 TV, I present you HTES aka Hybrid Triple Exponential Smoothing, designed by Holt & Winters in the US, assembled by me in Saint P. I apply exponential smoothing individually to the data itself, then to residuals from the fitted values, and lastly to one-point forecast (OPF) errors, hence 'hybrid'. At the same time, the method is a closed-form solution and purely online, no need to make any recalculations & optimize anything, so the method is O(1).
^^ historical OPFs and one-point forecasting interval plotted instead of fitted values and prediction interval
Before the How-to, first let me tell you some non-obvious things about Triple Exponential smoothing (and about Exponential Smoothing in general) that not many catch. Expo smoothing seems very straightforward and obvious, but if you look deeper...
1) The whole point of exponential smoothing is its incremental/online nature, and its O(1) algorithm complexity, making it dope for high-frequency streaming data that is also univariate and has no weights. Consequently:
- Any hybrid models that involve expo smoothing and any type of ML models like gradient boosting applied to residuals rarely make much sense business-wise: if you have resources to boost the residuals, you prolly have resources to use something instead of expo smoothing;
- It also concerns the fashion of using optimizers to pick smoothing parameters; honestly, if you use this approach, you have to retrain on each datapoint, which is crazy in a streaming context. If you're not in a streaming context, why expo smoothing? What makes more sense is either picking smoothing parameters once, guided by exogenous info, or using dynamic ones calculated in a minimalistic and elegant way (more on that in further drops).
2) No matter how 'right' you choose the smoothing parameters, all the resulting components (level, trend, seasonal) are not pure; each of them contains a bit of info from the other components, this is just how non-sequential expo smoothing works. You gotta know this if you wanna use expo smoothing to decompose your time series into separate components. The only pure component there, lol, is the residuals;
3) Given what I've just said, treating the level (that does contain trend and seasonal components partially) as the resulting fit is a mistake. The resulting fit is level (l) + trend (b) + seasonal (s). And from this fit, you calculate residuals;
4) The residuals component is not some kind of bad thing; it is simply the component that contains info you consciously decide not to include in your model for whatever reason;
5) Forecasting Errors and Residuals from fitted values are 2 different things. The former are deltas between the forecasts you've made and actual values you've observed, the latter are simply differences between actual datapoints and in-sample fitted values;
6) Residuals are used for in-sample prediction intervals, errors for out-of-sample forecasting intervals;
7) Choosing between single, double, or triple expo smoothing should not be based exclusively on the nature of your data, but on what you need to do as well. For example:
- If you have trending seasonal data and you wanna do forecasting exclusively within the expo smoothing framework, then yes, you need Triple Exponential Smoothing;
- If you wanna use prediction intervals for generating trend-trading signals and you disregard seasonality, then you need single (simple) expo smoothing, even on trending data. Otherwise, the trend component will be included in your model's fitted values → prediction intervals.
8) Kind of not non-obvious, but when you put one smoothing parameter to zero, you basically disregard this component. E.g., in triple expo smoothing, when you put gamma and beta to zero, you basically end up with single exponential smoothing.
^^ data smoothing, beta and gamma zeroed out, forecasting steps = 0
About the implementation
* I use a simple power transform that results in a log transform with lambda = 0 instead of the mainstream-used transformers (if you put lambda on 2 in Box-Cox, you won't get a power of 2 transform)
* Separate set of smoothing parameters for data, residuals, and errors smoothing
* Separate band multipliers for residuals and errors
* Both typical error and typical residuals get multiplied by math.sqrt(math.pi / 2) in order to approach standard deviation so you can ~use Z values and get more or less corresponding probabilities
* In script settings → style, you can switch on/off plotting of many things that get calculated internally:
- You can visualize separate components (just remember they are not pure);
- You can switch off fit and switch on OPF plotting;
- You can plot residuals and their exponentially smoothed typical value to pick the smoothing parameters for both data and residuals;
- Or you might plot errors and play with data smoothing parameters to minimize them (consult SAE aka Sum of Absolute Errors plot);
^^ nuff said
More ideas on how to use the thing
1) Use Double Exponential Smoothing (data gamma = 0) to detrend your time series for further processing (Fourier likes at least weakly stationary data);
2) Put single expo smoothing on your strategy/subaccount equity chart (data alpha = data beta = 0), set prediction interval deviation multiplier to 1, run your strat live on simulator, start executing on real market when equity on simulator hits upper deviation (prediction interval), stop trading if equity hits lower deviation on simulator. Basically, let the strat always run on simulator, but send real orders to a real market when the strat is successful on your simulator;
3) Set up the model to minimize one-point forecasting errors, put error forecasting steps to 1, now you're doing nowcasting;
4) Forecast noisy trending sine waves for fun.
^^ nuff said 2
All Good TV ∞
Triple
Triple Ehlers Market StateClear trend identification is an important aspect of finding the right side to trade, another is getting the best buying/selling price on a pullback, retracement or reversal. Triple Ehlers Market State can do both.
Three is always better
Ehlers’ original formulation produces bullish, bearish and trendless signals. The indicator presented here gate stages three correlation cycles of adjustable lengths and degree thresholds, displaying a more refined view of bullish, bearish and trendless markets, in a compact and novel way.
Stick with the default settings, or experiment with the cycle period and threshold angle of each cycle, then choose whether ‘Recent trend weighting’ is included in candle colouring.
John Ehlers is a highly respected trading maths head who may need no introduction here. His idea for Market State was published in TASC June 2020 Traders Tips. The awesome interpretation of Ehlers’ work on which Triple Ehlers Market State’s correlation cycle calculations are based can be found at:
DISCLAIMER: None of this is financial advice.
Ignition Cha Cha ChaIgnition Cha Cha Cha (ICCC) is a 3 color coded moving average indicator which numerically quantify the angle of their trends. I have labeled them as fast, medium and slow. The trend colors are Green for bullish, Red for bearish and Grey for sideways. The sideways movement can be user defined for all 3 in the settings under Threshold. If you regard for example anything under 10º as sideways then place 10 in the corresponding threshold and any angle under 10º will give a grey moving average and a grey labeled text. I use this chart in several ways. If you don't want moving averages all over your Chartistic Masterpiece you can turn off the plots and leave the numeric angles which will give you an overview of the trend. Conversely if you want to make the ultimate trend chart you can setup a 4 chart layout, Weekly, Daily, 12 hour and 4 hour and add the indicator with 200/50/25 moving averages and look for confluence. I find the best way for this is turn off the candles and use the moving averages with the numeric labels. You also have the ability to turn off and on different aspects of the indicator so that there is good control over its look. Also I have given the indicator lots of Alert presets for all 3 of the moving averages so you can avoid demented screen-stairing. Please forgive the name, my mother made me do Ballroom dancing lessons as a kid.
Triple Colored Least Squares Moving Average + Crossover AlertsThis script is forked from the ‘ Double Colored Least Squares Moving Average + Crossover Alerts ‘ from @IronKnightmare.
First release & notes : 2021-11-03.
Overview:
The Least Squares Moving Average is used mainly as a crossover signal to identify bullish or bearish trends. When a shorter duration line cross a longer one a trend can be identified. When multiple lines or the price action cross a longterm trend the confirmation can be further validated. Tradingview contains already some indicators with 1 or two LSMA trendlines that can be configured and toggled.
The original script that I forked had two LSMA lines that could be plotted with other valuable functions, I added a third for further confirmation as some trading systems will use three lines or some combination of those for validation.
Usage:
In inputs
- You will see LSMA 1, LSMA 2 & LSMA 3. The default values are 40, 100 & 400 representing the number of periods plotted by that line : fast, medium and slow changing trendlines will be plotted. The offset value and source are standard for most scripts.
In Style
- You can toggle LSMA 1, 2 or 3 and any combination of those. There are much more possibilities this way.
- For each LSMA, Color 0 & Color 1 are for coloring the slope of the trendline,
- Color 0 for rising slope,
- Color 1 for descending slope.
- The script will automatically color the rise or fall of the trendline accordingly. You can also set one identical color in both slopes for one unique color.
- The ‘ Long Crossover 1 on 2 ’ is a signal for when the LSMA 1 cross over the LSMA 2, usually a shorter periods trendline, more volatile, climbing over the medium term one. A Signal will be traced on the chart at that crossing, you can configure this. The ‘Short Crossover 1 on 2’ is when the LSMA 1 cross under the LSMA 2, a signal will be traced on the chart accordingly.
- The Long Crossover 1 on 3 & Short Crossover 1 on 3 act on the same principle, although the crossing of the fast LSMA on the long / slow LSMA are used. Both can be toggled.
- The ‘ Background Coloring Line 1 : 0-Neutral, 1-Up, 2-Down ’ is an optional background coloring for the LSMA1 line. This can provide additional information at a quick glance, especially if you combine the two other lines backgrounds, the partial transparency will compound.
Triple EMA (20, 50, 200) w/ LabelsI've combined the 20, 50, and 200 day exponential moving averages and added labels.
I created this due to finding EMA scripts that are either nothing but ugly to look at or have extra "features" that serve no purpose.
This gets rid of the clutter and gives a simple triple EMA with labels.
Labels are optional, you can turn them off in the settings.
Tripple super Trend + EMA + RSI StrategyGreetings!
Here I show you the Tripple Super Trend Strategy.
I discovered the strategy on a YouTube channel and tried to transfer it as a strategy into a script.
Tested with the currency pair EUR/USD in the one hour chart.
Period: beginning of 2020 until today.
The strategy should also work with cryptocurrencies. But then the settings have to be adjusted.
There is the possibility to activate only long or only short position.
The EMA can be used in a time different from the chart.
-----------------------------------------------------------------------------------
How does the strategy work?
For long positions, the candle must be above the EMA .
The candle must be closed above at least two of the supertrend lines.
The stochastic RSI must show oversold and the k line must cross over the D line.
For short positions, the candle must be below the EMA .
The candle must be closed below at least two of the supertrend lines.
The stochastic RSI must indicate overbought and the K line must cross below the D line.
The stop loss is determined with the "lowest low/highest high lookback".
The profit factor is multiplied by the value of the lowest low/highest high lookback.
The results of the strategy are without commissions and levers.
If you have any questions or feedback, please let me know in the comments.
In the future I will add other types of stop loss / take profits. (ATR; %; eg.)
If you need more information about the strategy and want to know exactly how to apply it, check out my profile.
I wish you good luck with the strategy!
RSI Relative Strength Index 3X - DurbtradeDurbtrade Triple RSI - 3 individual RSI's on 1 indicator, each distinguishable by length, as well as line color, thickness, opacity, and type.
(note: usable line TYPES are limited... try experimenting)
1) RSI's
A) Each RSI can be customized to change color based on RSI vertical direction (default = only RSI #1 changes color).
B) All 3 RSI's use a single Source (default Close).
C) You may customize the length of each RSI individually (I LOVE my default 14, 7, and 3!).
D) RSI #1 is the primary RSI, and is plotted LAST, so that it is drawn ABOVE RSI #2, which is drawn above RSI #3.
2) Horizontal Lines
A) Horizontal lines are also drawn automatically, so you don't have to, and they don't extend past the current bar.
B) There are 11 customizable lines, and each one is set to non-customizable increments (zero, 10, 20, 30, 40, fifty, 60, 70, 80, 90, hundred).
C) The 11 lines are divided into 2 groups:
a) 4 PAIRS of lines WITH fill options (10/90, 20/80, 30/70, 40/60... 8 lines total), and
b) 3 INDIVIDUAL lines WITHOUT fill options (zero, fifty, hundred).
D) The 4 fills give you the option to fill the space between each pair with a customizable color and opacity (the default is what I personally feel is best for each).
3) Conclusion
A) As with my previous indicators, this one maximizes information, discernment, clarity, and customization.
B) It is optimized for your ability to be able to customize a relatively basic but important indicator with ease
for use on your own personal television, laptop, or cellular phone screen setup... and on all chart zoom levels and layouts.
B) And, this being my 3rd script, please feel free to comment, critique, or leave suggestions. I find them helpful!
C) Check out my previous pine scripts if you like this one. They work well together.
D) I hope that you find this useful.
E) Enjoy!
//Durbtrade
MultiTimeFrame Shifting Predictive Bollinger BandsThis is the optimized version of my MTFSBB indicator with capability of possible bands prediction in case of negative shifting (to the left).
Make me happy by using it and sending me your ideas about the prediction.
MTF Shifting BBs + Reverse Engineering RSIs Overlay on ChartAnother multi-timeframe indicator presents 3 MTF (each) Bollinger Bands and 3 MTF (each) Reverse Engineering RSI and of course with shifting (left/right) capability.
RERSI in a simple term is the RSI but on the main chart alongside with candles.
There are many adjustable options like:
- Show/Hide each BB
- Show/Hide each MA
- Non-integer BB deviation values
- Positive/Negative shifting values
- Show/Hide each RSI
- Show/Hide each RSI Mid Level
- Adjustable Overbought, Oversold and Mid Levels values
I wrote this after my first script MTFSBB, because it's very useful to have BBs and RSIs together on a chart.
Calculating RERSIs will take some time, so be patient with it and feel free to use it.
MultiTimeFrame Shifting Bollinger BandsJust 3 Bollinger Bands with different adjustable timeframes plus shifting (left/right) capability and non-integer deviation values.
I wrote this because I couldn't find the perfect BB indicator that matches my needs. Feel free to use it.
Triple SMA/EMAThis indicator displays the 50, 100 and 200 period SMA and EMA and shades the area between the corresponding SMAs and EMAs
Fancy Triple Moving Averages [BigBitsIO]This script is for three moving averages with as many features as I can possibly fit into a single moving average.
Features:
- Three moving averages (MA1, MA2, MA3).
- Standard MA inputs.
- MA type.
- MA period.
- MA price.
- MA resolution (time frame).
- Visibility toggle.
- MA Candle Type
- Fancy MA inputs.
- Toggle to show only candles included in the MA calculation ("Highlight inclusion") or display entire MA history.
- Toggle to show a ghost trail when Highlight inclusion is toggled on. Displays a shaded version of past MA history before the inclusion period (as seen on snapshot).
- Toggle to show forecast values for the MA.
- Other inputs related to forecasting:
- Forecast bias. (Neutral forecasts MA if the current price remains the same.)
- Forecast period.
- Forecast magnitude.
*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Scripting Tutorial 6 - Triple Many Moving Averages ForecastingThis script is for a triple moving average indicator where the user can select from different types of moving averages, price sources and lookback periods.
Features:
- 3 Moving Averages with variable MA types, periods, price sources and ability to disable each individually
- Crossovers are plotted on the chart with detailed information regarding the crossover (Ex: 50 SMA crossed over 200 SMA )
- Forecasting available for all three MAs. MA values are forecasted 5 values out and plotted as if a continuation to the MA.
- Forecast bias also applies to all forecasting. Bias means we can forecast based on an anticipated bullish, bearish or neutral direction in the market.
- To understand bias, please read the source code, or if you can't read the code just send me a message on here or Twitter. Twitter should be linked on my profile.
This script is meant as an educational script with well-formatted styling, and references for specific functions.
Triple Moving Averages with Bollinger BandsCombines 3 moving averages with Bollinger Bands. Each moving average can be configured to be SMA or EMA.
Ehlers Triple Delay-Line DetrenderThis indicator was originally developed by John F. Ehlers (Stocks & Commodities , V.18:7 (July, 2000): "Optimal Detrending").
Mr. Ehlers applied the ideas of the radar systems for the financial time series detrending.
Mr. Ehlers constructed the Triple Delay-Line Canceller first, then smoothed it with the Modified Optimum Elliptic Filter with minimal lag. The smoothed detrended signal is smoothed again with the Modified Optimum Elliptic Filter to obtain signal line.
As result, the crossings of the two indicator lines catch every major cyclic move and the detrender itself can be used as the first step in more sophisticated analyses.
TRIXThis indicator was originally developed by Jack K. Hutson (Stocks & Commodities (July 1983): "Good TRIX").
Derivative OscillatorThis indicator was originally developed by Constance (Connie) M. Brown (Journal of Technical Analysis (Winter-Spring 1994, 45-61): "Derivative Oscillator: A New Approach to an Old Problem").
Daily Triple Moving AveragesDisplays triple moving average (SMA calculation method) intended for use daily time frames. Equivalent to 7,30, & 50 on weekly time frame.
Orange = 49
Purple = 210
Blue = 350
CMYK RMI TRIPLE◊ Introduction
This script makes use of three RMI's, to indicate Overbought/Oversold.
Adjustments can easily be made, through its settings or script.
◊ Origin
The Relative Momentum Index was developed by Roger Altman and was introduced in his article in the February, 1993 issue of Technical Analysis of Stocks & Commodities magazine.
While RSI counts up and down days from close to close, the Relative Momentum Index counts up and down days from the close relative to a close x number of days ago.
This results in an RSI that is smoother.
This is a part of Project XIAM.
◊ Theoretical Approach
Philosophy γ :: consequential
◊ Usage
You can use this as an indicator for manual trading, or apply AUTOTVIEW to automate your trading.
My advice is to combine this with another indicator before you do this.
The script is written in an organized and flexible manner to do this.
◊ Features
3 RMI's with seperately adjustable HIGH / LOW levels.
Trend adjustment on the SLOW RMI.
Adjustable Interval between entries / Once per dip-top entry.
Take Profit & Stop loss
◊ Community
Wanna share your findings ? or need help resolving a problem ?
CMYK :: discord.gg
AUTOVIEW :: discordapp.com
TRADINGVIEW UNOFFICIAL :: discord.gg