General Filter Estimator-An Experiment on Estimating EverythingIntroduction
The last indicators i posted where about estimating the least squares moving average, the task of estimating a filter is a funny one because its always a challenge and it require to be really creative. After the last publication of the 1LC-LSMA , who estimate the lsma with 1 line of code and only 3 functions i felt like i could maybe make something more flexible and less complex with the ability to approximate any filter output. Its possible, but the methods to do so are not something that pinescript can do, we have to use another base for our estimation using coefficients, so i inspired myself from the alpha-beta filter and i started writing the code.
Calculation and The Estimation Coefficients
Simplicity is the key word, its also my signature style, if i want something good it should be simple enough, so my code look like that :
p = length/beta
a = close - nz(b ,close)
b = nz(b ,close) + a/p*gamma
3 line, 2 function, its a good start, we could put everything in one line of code but its easier to see it this way. length control the smoothing amount of the filter, for any filter f(Period) Period should be equal to length and f(Period) = p , it would be inconvenient to have to use a different length period than the one used in the filter we want to estimate (imagine our estimation with length = 50 estimating an ema with period = 100) , this is where the first coefficients beta will be useful, it will allow us to leave length as it is. In general beta will be greater than 1, the greater it will be the less lag the filter will have, this coefficient will be useful to estimate low lagging filters, gamma however is the coefficient who will estimate lagging filters, in general it will range around .
We can get loose easily with those coefficients estimation but i will leave a coefficients table in the code for estimating popular filters, and some comparison below.
Estimating a Simple Moving Average
Of course, the boxcar filter, the running mean, the simple moving average, its an easy filter to use and calculate.
For an SMA use the following coefficients :
beta = 2
gamma = 0.5
Our filter is in red and the moving average in white with both length at 50 (This goes for every comparison we will do)
Its a bit imprecise but its a simple moving average, not the most interesting thing to estimate.
Estimating an Exponential Moving Average
The ema is a great filter because its length times more computing efficient than a simple moving average. For the EMA use the following coefficients :
beta = 3
gamma = 0.4
N.B : The EMA is rougher than the SMA, so it filter less, this is why its faster and closer to the price
Estimating The Hull Moving Average
Its a good filter for technical analysis with tons of use, lets try to estimate it ! For the HMA use the following coefficients :
beta = 4
gamma = 0.85
Looks ok, of course if you find better coefficients i will test them and actualize the coefficient table, i will also put a thank message.
Estimating a LSMA
Of course i was gonna estimate it, but this time this estimation does not have anything a lsma have, no moving average, no standard deviation, no correlation coefficient, lets do it.
For the LSMA use the following coefficients :
beta = 3.5
gamma = 0.9
Its far from being the best estimation, but its more efficient than any other i previously made.
Estimating the Quadratic Least Square Moving Average
I doubted about this one but it can be approximated as well. For the QLSMA use the following coefficients :
beta = 5.25
gamma = 1
Another ok estimate, the estimate filter a bit more than needed but its ok.
Jurik Moving Average
Its far from being a filter that i like and its a bit old. For the comparison i will use the JMA provided by @everget described in this article : c.mql5.com
For the JMA use the following coefficients :
for phase = 0
beta = pow*2 (pow is a parameter in the Jma)
gamma = 0.5
Here length = 50, phase = 0, pow = 5 so beta = 10
Looks pretty good considering the fact that the Jma use an adaptive architecture.
Discussion
I let you the task to judge if the estimation is good or not, my motivation was to estimate such filters using the less amount of calculations as possible, in itself i think that the code is quite elegant like all the codes of IIR filters (IIR Filters = Infinite Impulse Response : Filters using recursion) .
It could be possible to have a better estimate of the coefficients using optimization methods like the gradient descent. This is not feasible in pinescript but i could think about it using python or R.
Coefficients should be dependant of length but this would lead to a massive work, the variation of the estimation using fixed coefficients when using different length periods is just ok if we can allow some errors of precision.
I dont think it should be possible to estimate adaptive filter relying a lot on their adaptive parameter/smoothing constant except by making our coefficients adaptive (gamma could be)
So at the end ? What make a filter truly unique ? From my point of sight the architecture of a filter and the problem he is trying to solve is what make him unique rather than its output result. If you become a signal, hide yourself into noise, then look at the filters trying to find you, what a challenging game, this is why we need filters.
Conclusion
I wanted to give a simple filter estimator relying on two coefficients in order to estimate both lagging and low-lagging filters. I will try to give more precise estimate and update the indicator with new coefficients.
Thanks for reading !
Sma
Multi SMA TimeframeIn this indicator, it is possible to see SMA 8 and SMA 20 of 1m, 3m, 5m and 15m, in the same chart.
Moving Averages & Bollinger Bands with ForecastsMoving Averages & Bollinger Bands with Forecasts
11 Moving Averages
SMA, EMA, WMA
Highly Customizable
Linear Regression Forecast
Bollonger Bands
Personal Setup: Add indicator twice
1st indicator = SMA using #4, 7, 10, 11 (20, 50, 100, 200 SMAs) with bollonger bands on 20.
2nd indicator = EMA using #1, 2, 3, 5, 6, 8, 9 (5, 8, 13, 21 ,34, 55, 89 EMAs).
This allows easy toggling between SMAs/Bolls and Fib EMAs
Thank you to yatrader2 for the forecast code
Moving Averages & Bollinger Bands with ForecastsMoving Averages & Bollinger Bands with Forecasts
11 Moving Averages
SMA, EMA, WMA
Highly Customizable
Linear Regression Forecast
Bollonger Bands
Personal Setup: Add indicator twice
1st indicator = SMA using #4, 7, 10, 11 (20, 50, 100, 200 SMAs) with bollonger bands on 20.
2nd indicator = EMA using #1, 2, 3, 5, 6, 8, 9 (5, 8, 13, 21 ,34, 55, 89 EMAs).
This allows easy toggling between SMAs/Bolls and Fib EMAs
Thank you to yatrader2 for the forecast code
Moving Averages & Bollinger Bands with ForecastsMoving Averages & Bollinger Bands with Forecasts
11 Moving Averages
SMA, EMA, WMA
Highly Customizable
Linear Regression Forecast
Bollonger Bands
Personal Setup: Add indicator twice
1st indicator = SMA using #4, 7, 10, 11 (20, 50, 100, 200 SMAs) with bollonger bands on 20.
2nd indicator = EMA using #1, 2, 3, 5, 6, 8, 9 (5, 8, 13, 21 ,34, 55, 89 EMAs).
This allows easy toggling between SMAs/Bolls and Fib EMAs
Thank you to yatrader2 for the forecast code
SMA Cross (Short X Long)Its a graph for detecting the SMA cross points.
When short SMA crosses the long SMA downside up it may be a buy signal and the opposite is may be a sell signal.
Moving Averages & Bollinger Bands with ForecastsMoving Averages & Bollinger Bands with Forecasts
11 Moving Averages
SMA, EMA, WMA
Highly Customizable
Linear Regression Forecast
Bollonger Bands
Personal Setup: Add indicator twice
1st indicator = SMA using #4, 7, 10, 11 (20, 50, 100, 200 SMAs) with bollonger bands on 20.
2nd indicator = EMA using #1, 2, 3, 5, 6, 8, 9 (5, 8, 13, 21 ,34, 55, 89 EMAs).
This allows easy toggling between SMAs/Bolls and Fib EMAs
Thank you to yatrader2 for the forecast code
Fixed Moving AverageThis Indicator is a fixed moving average indicator.
By "fixed" I mean that you can choose for the MA to be based on the current resolution or fixed on a specific time-frame.
Default will be 128 D MA. It is fully customize able Moving Average.
It is a simple script. I created it because I wanted to be able to see the 128 D MA on any time-frame.
It can be used to determine your bias while trading:
- If the price is above the 128 day moving average, look for longs
- If the price is below the 128 day moving average, look for shorts
The 6 Line Death PunchIf you are looking to discover what trend you are in, you need to first what direction the price is going in...
I've been using and testing a mixture of EMA's and SMA's for a long time and I've found that these ones are by far the best.
EMA 3
EMA 8
MA 20
EMA 55
MA 100
MA 200
EMA 3 & 8 Crossover is a good method for confirming a coin going to the upside or to the downside.
EMA 8 is known as the Trigger Line (trademarked brand) as one of the fib numbers it shows good support or resistance of a trend.
MA 20 universal way of seeing trend direction in the stock market, works well with crypto too.
EMA 55, another trusty fib number. Works very well and could trade off that alone as support and resistance.
MA 100 and MA 200. Long ranged moving averages which govern the overall longer-term trend.
LONG ENTRY
Option 1 - 3/8 crossover
Option 2 - Candles above EMA 8
Option 3 - Candles above MA 20
Option 4 - Candles Above EMA 55.
SHORT ENTRY
Option 1 - 3/8 crossover
Option 2 - Candles below EMA 8
Option 3 - Candles below MA 20
Option 4 - Candles below EMA 55.
9 moyennes configurables3 moyennes mobiles simples, 3 moyennes exponentielles et 3 moyennes ponderées.
Longueurs configurables dans les paramètres d'entrée.
sma-pivotsThis model is based on this script
I change it to sma model . the model run on pivots high or low that are base on SMA
I make two SMA one for high pivots and one for low pivots ( I put for now at same distance but you need to change it according to needs)
because asset can be in bull period or bear period when we have two separate distance of SMA we can find the correct combination if to buy more or less by changing either the sma pivot of the low end or the sma pivots of the high end using the length . also global we can use the lookbar of bar numbers
one sma to both pivots is bad as it not consider the market situation but separation to two one for sell and one for buy can give you a better flexible model for enter or exit
so its your job to find what length is best suited for exit and what for enter .
example when we have two different length how it work on 4 hour
(JS) Moving Average Secuirty OscillatorThis is kind of like the Moving Average Crossover Oscillator - except this measures in % the distance between the security you're charting and the MA you have entered in.
The goal is to see when the price pulls too far from the MA.
Hope you like it!
(JS) Moving Average Crossover OscillatorPretty simple really - another indicator I built with the intention of keeping the price action as clear as possible.
This oscillator is pretty generic;
-You have a choice between two SMA or two EMA which you simply just check the box to decide.
-There is a box you can check to use the resolution on your chart, or you can turn it off and use a custom resolution instead.
-The oscillator is graphed on the percentage of distance - so positive 4 means the fast MA is 4% above the slow one.
I like to see the price action clearly without obstruction - so I hope that people who share my view like this as much as I do.
Enjoy!
ArkWork:: Switchable MA Package ExtensionThis indicator add many EMA (or SMA ).
Each EMA switchable to SMA .
If you need shiftable x, like "Ichimoku clouds", it's avalable.
This have "arithmetic progression" system.
If "AP" option isn't 0, "arithmetic progression" to active.
(* If "arithmetic progression" active, EMA 02 - EMA 10 isn't avalable)
Length01 = 20
Length02 = (Length01 + AP)
.... to 10.
Q. How many?
A. It’s 10 EMA .
Q. How much does it cost?
A. 850 JPY or other.
Q. How to buy.
A. note.mu
ArkWork:: Switchable MA PackageThis indicator add many EMA(or SMA).
Each EMA switchable to SMA.
Q. How many?
A. It’s 10 EMA.
Q. How much does it cost?
A. 600 JPY or other.
Q. How to buy.
A. note.mu
[ALERTS] CMYK-RMI-SMA
▼ This is the study version of the script, For usage with Autoview
◊ Introduction
This script makes use of three RMI's and SMA's, that indicate Overbought/Oversold on different Periods that correspond with Frequency’s that move the market.
◊ Origin
This is an update on █▓▒░ CMYK ♦ RMI ♦ TRIPLE ░▒▓█
◊ Usage
This script is intended for Automated Trading on the 1-5 minute chart.
◊ Features Summary
Two Part Indicator
Strategy Type Selection
Three RMI's SMA's
Trend adjustment
Pump/Dump Entry Delay
Pyramiding
Ignore first entries
Take Profit
Interval between Entries
Multiring Fix
Alert signal Seperation
◊ Community
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
AUTOVIEW :: discordapp.com
TRADINGVIEW UNOFFICIAL :: discord.gg
◊ Setting up Autoview Alerts
Use the study version of this script, To set up The Alerts Autoview Picks up on.
Goto the CMYK Discord for support and Settings.
◊ Backtesting
Use the strategy version of this script for backtesting.
◊ Contact
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
HAPPY TRADES!!!
[BACKTEST] CMYK-RMI-SMA◊ Introduction
This script makes use of three RMI's and SMA's, that indicate Overbought/Oversold on different Periods that correspond with Frequency’s that move the market.
◊ Origin
This is an update on █▓▒░ CMYK ♦ RMI ♦ TRIPLE ░▒▓█
◊ Usage
This script is intended for Automated Trading on the 1-5 minute chart.
◊ Features Summary
Two Part Indicator
Strategy Type Selection
Three RMI's SMA's
Trend adjustment
Pump/Dump Entry Delay
Pyramiding
Ignore first entries
Take Profit
Interval between Entries
Multiring Fix
Alert signal Seperation
◊ Community
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
AUTOVIEW :: discordapp.com
TRADINGVIEW UNOFFICIAL :: discord.gg
◊ Setting up Autoview Alerts
Use the study version of this script, To set up The Alerts Autoview Picks up on.
Goto the CMYK Discord for support and Settings.
◊ Backtesting
Use the strategy version of this script for backtesting.
◊ Contact
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
Happy trades!!!
13utc EUR/USD TariHi guys,
this new strategy is on 1hr chart eur/usd.
It's very easy to follow, becuase you will get 1 signal at 13Utc (1pm utc)
You have only to set Stop Loss @50 and Take Profit@60 (pips not ticks!), but to avoid mistakes green or red lines will appear on the chart to have a better view of Sl and TP.
So, what more? Nothing! Subscribe!
Enjoy your Wallet!
Tari.
Multiple Simple Moving AveragesOne no-fuss indicator for SMA for 6 different time period (10, 20, 50, 100, 200, 250), styled with sharp and thin line for shorter time period to light-coloured and wide line for longer time period.