Forecasting - Seasonal Naive MethodFor completeness here is a naive method with seasonality. The idea behind naive method with seasonality is to take last value from same season and treat it as a forecast. Its counterpart, naive method without seasonality, involves taking last mean value, i.e forecast = sma(x, p) .
Forecasting
Forecasting - Simple Mean MethodThis is a continuation of my series on forecasting techniques. The idea behind the Simple Mean method is to somehow extend historical mean to the future. In this case a forecast equals to last value plus average change.
Forecasting - Locally Weighted Regression (rescaled)UPDATE: the original version works only with BTC. Here's a general version with rescaling.
Forecasting - Vanilla Locally Weighted RegressionThere is not much to say - just vanilla locally weighted regression in PineScript 4.
see: medium.com
also: cs229.stanford.edu
Forecasting - Holt’s Linear Trend ForecastingHolt's Forecasting method
Holt (1957) extended simple exponential smoothing to allow the forecasting of data with a trend. This method involves a forecast equation and two smoothing equations (one for the level and one for the trend):
Forecast equation: ŷ = l + h * b
Level equation: l = alpha * y + (1 - alpha) * (l + b)
Trend equation: b = beta * (l - l) + (1 - beta) * b
where:
l (or l) denotes an estimate of the level of the series at time t,
b (or b) denotes an estimate of the trend (slope) of the series at time t,
alpha is the smoothing parameter for the level, 0 ≤ alpha ≤ 1, and
beta is the smoothing parameter for the trend, 0 ≤ beta ≤ 1.
As with simple exponential smoothing, the level equation here shows that l is a weighted average of observation y and the one-step-ahead training forecast for time t, here given by l+b. The trend equation shows that b is a weighted average of the estimated trend at time t based on l-l and b, the previous estimate of the trend.
The forecast function is not flat but trending. The h-step-ahead forecast is equal to the last estimated level plus h times the last estimated trend value. Hence the forecasts are a linear function of h.
SMA collector MTF ForecastHello everyone
Here's the today indicator
That one is a true gift before X-mas. X-mas in July which bundles a lot more than what Santa Claus will offer you in December :)
So without further due, let's dive right in
This indicator will display the following algorithmic SMA :
SMA 20 Daily
SMA 50 Daily
SMA 50 Daily
SMA 100 Daily
SMA 200 Daily
SMA 20 Weekly
SMA 50 Weekly
SMA 100 Weekly
SMA 200 Weekly
SMA 7 Monthly
SMA 20 Monthly
SMA 50 Monthly
Those SMA usually work as big supports/resistances for all tradable assets (forex, index, crypto, stocks, ...)
That's it for the first feature, let's cover the next one
2/ I developped a small optimization to get those labels placed on the right hand side of your screen.
"Is it really useful sir ?" Well, you certainly noticed that looking at a chart on tradingview mobile is not ideal (indicators overlapping, indicator names taking too much space and so on...)
When you'll deactivate the indicator name label display from tradingview, you can activate mine which will look way nicer on your mobile (and even Desktop).
This concept was greatly inspired by @scarf :
3/ Now the cherry on the top of the cherry on the top of the.... cake
You'll have the cool option to display the forecasts for those SMAs based on either current price "flat" or a 3 period liner regressions "linreg".
You can play out with the forecasts options and find out which ones will make the most of sense to you
They're represented by small dots at the very right of the moving averages
This concept was greatly inspired by @yatrader2 :
That's a lot to digest but hope it went smoothly
As always if you have any question or feedback or complain or you want to show me some love (please), shoot it in the comments section
See y'all tomorrow for another indicator
Enjoy
Dave
Stationary Extrapolated Levels OscillatorIntroduction
The oscillator version of the stationary extrapolated levels indicator. The methodology behind the extrapolated levels where to minimize the risk of making a decision based only on a forecast, therefore the indicator plotted levels in order to determine possible reversal points, signals where generated when the detrended series crossed over/under those levels.
The Indicator
First we detrend the price, this is because forecasting the trend is often harder than a series without trend (stationarity > non-stationarity) , then we forecast the detrended price with a linear extrapolation over a period of length and apply a max/min filter twice to the forecast, the max/min filters are just the highest and lowest function in pine. So the max/min filter have lag length/2 , by applying it two times we have a lag of length which is the period of the forecast. Because we use highest and lowest we can apply min-max normalization in the form of :
x' = (x - min(x, min'))/(max(x,max') - min(x, min'))
where x is the detrended price, max' the highest of the forecast of x and min' the lowest of the forecast of x . This result in a scaled oscillator in a range of (1,0),
When the indicator is equal to 1 or 0 there are high chances of reversals, more in depth this mean that the detrended price have crossed the highest/lowest of the forecast, when the indicator is equal to 0 or 1 for a long time this mean that the forecast was quite inaccurate, you can minimize risk by focusing on the cross between the detrended price and the 0.8/0.2 levels.
Conclusion
I've shown an oscillator version of my previous "Stationary extrapolated levels" indicator, the method involving taking the highest and lowest of the forecast is a great way to minimize the risk involved by time-series forecasting driven decisions. So i hope you find an use to it.
Thanks for reading !
EW Correction on choppiness with CB Composite index [yoxxx]Sometimes it is more than convenient to differ fast from a genuine high or
a B in an expanded flat (a very impulsive counter within a correction, resulting in an higher high than the genuine.)
I tried to use the typical choppiness of Bs in general to indicate them (orange box in example).
Therefore i used a momentum of close, relative to the bar's heights (=vola).
I turned out, that it works like charme to show ALL correction phases in a trend cycle. (And hence the impulses as well.)
(Credit:The choppiness of the Bs is a hint of Constance Brown, which i adopted. Bow to her.)
Note1: I tested it on all Timeframes, but mainly on D; and only in bull markets.
Note 2: I added the composite index of Constance Brown which is faster than the rsi and - special skill -
can inidcate divergences to prices where rsi fails. Use it as a hint for choppiness changes to come.
Since its strength lies in being not normalized, sometimes you may adjust the composite for fitiing it to the EW bars.I inserted a line for that in the script.
Feedback welcome!
yoxxx
Alpha-Sutte ModelThe Alpha-Sutte model is an ongoing project run by Ansari Saleh Ahmar, a lecturer and researcher at Universitas Negeri Makassar in Indonesia, that attempts to make forecasts for time series like how Arima and Holt-Winters models do. Currently Ahmar and his team have conducted research and published papers comparing the efficacy of the Alpha-Sutte and other models, such as Arima and Holt-Winters, on topics ranging from forecasting Turkey's CPI data, Bitcoin prices, Apple's stock prices, primary energy supply of Indonesia, to infant mortality rates in China.
The Alpha-Sutte model in comparison to the other two models listed above shows promise in providing a more accurate forecast, and the project has been able to receive some of its funding from organizations such as the US Agency for International Development, which is a part of the US Federal Government, so maybe the project has some actual merit.
How it works:
In this model there are four values presented at the top of the window.
1) The first value in blue is the value of the Alpha-Sutte model whose purpose is to forecast the price of the current bar.
2) The second value in yellow is an adaptive version of the Alpha-Sutte model that I made. The purpose of the adaptive Alpha-Sutte model is to expand upon the Alpha-Sutte by allowing new information to be introduced, causing the value to change during the current period, hence the adaptiveness of it.
3) The third value in aqua is the moving average of the low% Sutte line which is a predictive line that is based off of the close and low of the current and previous periods.
4) The fourth value in red is the moving average of the high% Sutte line which is a predictive line that is based off of the close and high of the current and previous periods.
Trend signals:
If low% Sutte (aqua value/line) is greater than high% Sutte (red value/line) then this is a buy signal.
If high% Sutte (red value/line) is greater than low% Sutte (aqua value/line) then this is a sell signal.
Caveat:
Even though this model's purpose is to forecast the future, will it be able to predict periods of large movements? No, of course not, but it will adjust quickly to try to make more accurate forecasts for the next period. This was also a reason why I made an adaptive version of this model to try to reduce some of the discrepancies between the Alpha Sutte and price when there is a large unexpected move.
*WARNING before using this I would highly recommend that you look up "Sutte Indicator" online and read some of the papers about this model before you use this , even though this model has shown merit when compared to Arima and Holt-Winter models this is still an ongoing project.*
Hopefully this project will actually come to something in the near future as the calculation for this time series predictive model is much easier to calculate and program in pine editor than something like an Arima model.
*Also, if you know how to use R language there is a package for the "Alpha-Sutte model".*
CryptoScalper: NightMODE by BiO-618Hey guys!
It's me with a new version of the script.
Since a lot of people wanted to use it for scalping, I adjusted it for that.
More buy signals, more sell signals, 90% accuracy (at least ;) )
Remember to use the pivots to set Take Profits and Stop Losses, no software is 100% accurate, otherwise the market would trash it.
SELL SIGNALS
Red "S": Sell signal
Yellow "Sell": Strong+ sell signal
Orange "SELL": Strong++ sell signal. Shortable signal.
Red triangledown "SELL!": Strongest+++ sell signal, bearish divergences from MACD . Shortable signal.
BUY SIGNALS
Yellow triangleup "Weakening": Bear trend is getting weak, as the asset is getting oversold.
Green "BUY!": Strong buy, bullish divergence from MACD . Strongest buy signal.
Remember, again, to ALWAYS set your TP and SL beforehand. The key to be profitable is to act before the market acts.
It's better 3% in hand than 1% below your initial balance.
From a manual backtesting, I got a 53% profit on 2 weeks, trust my advice to manage the risk and you will be profitable aswell ;)
Check my other scripts to get more options :)
I also made a 4Hours and 12Hours optimized scripts, you might found that which one works better for your strategy, asset, and timeframe.
4Hours optimized CAR: NightMODEA night mode of my script.
Feel free to contact me with your suggestion, I'm working on the things people ask me more frequently.
Thanks and good profit!
12Hours-optimized Crypto Alert ReloadedSame as 4H, but this time 12H.
In my opinion this one is way more accurate, let me know yours.
UPDATES:
I added Short Sell signals, both Red and Blue means "Short Sell", but they use different formulas. The blue one seems pretty solid, meanwhile the red one get more oportunities but might give an earlier entrance aswell.
Remember no software is 100% accurate, but this one seems at least >90% accurate so I guess that with a decent risk management and order placing you will make great profit.
The script gave1 bad short signal in whole 2018, and 4 bad buy signals, pretty decent on a market as cryptos, and at a correction phase.
Again, let me know your opinion, feedback, and critics.
Stay aware since I will update it for sure, I'm already working on it.
Soon:
*Filtering signal by candlestick patterns
*Pivot levels for resistance and support forecast beforehand.
*and more cool features ;)
Thanks again!
Meister Shredder - Simple Moving Averages x4 ForecastIncludes the 21, 50, 100 and 200 SMA and 6 bar forecast
Coinpirate Channels BTCFrom a request to simplify the chart, here we have an easy to read map. It's built on calculated price forecast, math, geometry, historical movement, and fundamentals. Enjoy and invest wisely.
NOT INVESTMENT ADVICE. For educational and learning purposes only. BTCUSD -0.30% Bitcoin -0.30% BTC -0.30%
Linear ExtrapolationBasic extrapolator for forecast a time-series, all forecasts are mades length periods ahead.
This is not a estimation of the exact price
This should only be used for forecasting direction, dont expect the price to be at the same value of its forecast.
Bias, Mean absolute error, Mean percentage error...etc look useless here, its better to use correlation as a accuracy measurement.
Correlation(Forecast ,close,period)
Rescaling for a better forecast ?
Transforming a non-stationary signal to a stationary signal can increase the forecasting accuracy, this can be done by detrending. Here is a list of somes detrending methods:
Auto-Bias : price - price
Mean-Bias : price - price moving average
Log transform : log(price/price moving average)
Correlation : correlation(price,n,period)
[RS]Fractal MA V0EXPERIMENTAL: concept for fractal ma. can be used as zigzag as is, intended for hidden S&R extraction(kinda failed :p ).