Viking Fun PredictОсобая благодарность за оригинальную идею Александру Горчакову
Индикатор предсказывает вырастет или упадет цена на следующей свече
Индикатор отображает красные или зеленые кружки над каждой из свечей
Зеленый кружок прогноз роста
Красный кружок прогноз падения
Индикатор выдает прогноз для шестой свечи на основе пяти свечей
Индикатор берет цены максимумов и минимумов пяти свечей и усредняет их, получая 5 значений. На основе полученных 5 значений строится линейная регрессия
Если линия линейной регрессии возрастает, то индикатор прогнозирует рост (зеленый кружок)
Если линия линейной регрессии возрастает, то индикатор прогнозирует падение (красный кружок)
Компания Викинг предоставляет профессиональный сервис, позволяющий реализовать арбитражные стратегии и маркет-мейкинг, осуществляет обучение трейдеров-арбитражеров.
---------------------------
Special thanks for the original idea to Alexander Gorchakov
The indicator predicts whether the price will rise or fall on the next candle
The indicator displays red or green circles above each of the candles
Green circle growth forecast
Red circle forecast of the fall
The indicator gives a forecast for the sixth candle based on five candles
The indicator takes the prices of the highs and lows of five candles and averages them, getting 5 values. Based on the obtained 5 values, a linear regression is constructed
If the linear regression line increases, the indicator predicts growth (green circle)
If the linear regression line increases, the indicator predicts a fall (red circle)
Viking provides a professional service that allows you to implement arbitrage strategies and market making, and provides training for arbitrage traders.
Predict
YinYang Bar ForecastOverview:
YinYang Bar Forecast is a prediction indicator. It predicts the movement for High, Low, Open and Close for up to 13 bars into the future. We created this Indicator as we felt the TradingView community could benefit from a bar forecast as there wasn’t any currently available.
Our YinYang Bar Forecast is something we plan on continuously working on to better improve it, but at its current state it is still very useful and decently accurate. It features many calculations to derive what it thinks the future bars will hold. Let’s discuss some of the logic behind it:
Each bar has its High, Low, Open and Close calculated individually for highest accuracy. Within these calculations we first check which bar it is we are calculating and base our span back length that we are getting our data from based on the bar index we are generating. This helps us get a Moving Average for this bar index.
We take this MA and we apply our Custom Volume Filter calculation on it, which is essentially us dividing the current bars volume over the average volume in the last ‘Filtered Length’ (Setting) length. We take this decimal and multiply it on our MA and smooth it out with a VWMA.
We take the new Volume Filtered MA and apply a RSI Filter calculation on it. RSI Filter is where we take the difference between the high and low of this bar and we multiply it with an RSI calculation using our Volume Filtered MA. We take the result of that multiplication and either add or subtract it from the Volume Filtered MA based on if close > open. This makes our RSI Filtered MA.
Next, we do an EMA Strength Calculation which is where we check if close > ema(close, ‘EMA Averaged Length’) (Setting). Based on this condition we assign a multiplier that is applied to our RSI Filtered MA. We divide by how many bars we are predicting and add a bit to each predictive bar so that the further we go into the future the stronger the strength is.
Next we check RSI and RSI MA levels and apply multiplications based on its RSI levels and if it is greater than or less than the MA. Also it is affected by if the RSI is <= 30 and >= 70.
Finally we check the MFI and MFI MA levels and like RSI we apply multiplications based on its MFI levels and if it is greater than or less than the MA. It is also affected by if the MFI is <= 30 and >= 70.
Please note the way we calculate this may change in the future, this is just currently what we deemed works best for forecasting the future bars. Also note this script uses MA calculations out of scope for efficiency but there is potential for inconsistencies.
Innately it’s main use is the projection it provides. It only draws the bars for realtime bars and not historical ones, so the best way to backtest it is with TradingView’s Replay Tool.
Well, enough of the logic behind it, let's get to understanding how to use it:
Tutorial:
So unfortunately we aren’t able to plot legit bars/candles into the future so we’ve had to do a bit of a work around using lines and fills. As you can see here we have 4 Lines and 3 Zones:
Lines:
Green: Represents the High
Orange: Represents the Open
Teal: Represents the Close
Red: Represents the Low
Zones:
High Zone: This zone is from either Open or Close to the High and is ALWAYS filled with Green.
Open/Close Zone: This zone is from the Open to the Close and is filled with either Green or Red based on if it's greater than the previous bar (real or forecasted).
Low Zone: This zone is from either Open or Close to the Low and is ALWAYS filled with Red.
As you can see generally the Forecasted bars are generally within strong pivot locations and are a good estimation of what will likely go on. Please note, the WHOLE structure of the prediction can change based on the current bars movements and the way it affects the calculations.
Let's look 1 bar back from the current bar just so we can see what it used to Forecast:
As you can see it has changed quite a bit from the previous bar, but if you look close, we drew horizontal lines around where its projecting the next bar to be (our current realtime bar), if we go back to the live chart:
Its projections were pretty close for the high and low. Generally, right now at least, it does a much better job at predicting the high and low than it does the open and close, however we will do our best to fine tune that in future updates.
Remember, this indicator is not meant to base your trades on, but rather give you a Forecast towards the general direction of the next few bars. Somewhat like weather, the farther the bar (or day for weather), the harder it is to predict. For this reason we recommend you focusing on the first few bars as they are more accurate, but review the further ones as they may help show the trend and the way that pair will move.
We will conclude this tutorial here, hopefully this Predictive Indicator can be of some help and use to you. If you have any questions, comments, ideas or concerns please let us know.
Settings:
Forecast Length: How many bars should we predict into the Future? Max 13
Each Bar Length Multiplier: For each new Forecast bar, how many more bars are averaged? Min 2
VWMA Averaged Length: All Forecast bars are put into a VWMA, what length should we use?
EMA Averaged Length: All Forecast bars are put into a EMA, what length should we use?
Filtered Length: What length should we use for Filtered Volume and RSI?
EMA Strength Length: What length should we use for the EMA Strength
HAPPY TRADING!
Hodrick-Prescott Extrapolation of Price [Loxx]Hodrick-Prescott Extrapolation of Price is a Hodrick-Prescott filter used to extrapolate price.
The distinctive feature of the Hodrick-Prescott filter is that it does not delay. It is calculated by minimizing the objective function.
F = Sum((y(i) - x(i))^2,i=0..n-1) + lambda*Sum((y(i+1)+y(i-1)-2*y(i))^2,i=1..n-2)
where x() - prices, y() - filter values.
If the Hodrick-Prescott filter sees the future, then what future values does it suggest? To answer this question, we should find the digital low-frequency filter with the frequency parameter similar to the Hodrick-Prescott filter's one but with the values calculated directly using the past values of the "twin filter" itself, i.e.
y(i) = Sum(a(k)*x(i-k),k=0..nx-1) - FIR filter
or
y(i) = Sum(a(k)*x(i-k),k=0..nx-1) + Sum(b(k)*y(i-k),k=1..ny) - IIR filter
It is better to select the "twin filter" having the frequency-independent delay Тdel (constant group delay). IIR filters are not suitable. For FIR filters, the condition for a frequency-independent delay is as follows:
a(i) = +/-a(nx-1-i), i = 0..nx-1
The simplest FIR filter with constant delay is Simple Moving Average (SMA):
y(i) = Sum(x(i-k),k=0..nx-1)/nx
In case nx is an odd number, Тdel = (nx-1)/2. If we shift the values of SMA filter to the past by the amount of bars equal to Тdel, SMA values coincide with the Hodrick-Prescott filter ones. The exact math cannot be achieved due to the significant differences in the frequency parameters of the two filters.
To achieve the closest match between the filter values, I recommend their channel widths to be similar (for example, -6dB). The Hodrick-Prescott filter's channel width of -6dB is calculated as follows:
wc = 2*arcsin(0.5/lambda^0.25).
The channel width of -6dB for the SMA filter is calculated by numerical computing via the following equation:
|H(w)| = sin(nx*wc/2)/sin(wc/2)/nx = 0.5
Prediction algorithms:
The indicator features the two prediction methods:
Metod 1:
1. Set SMA length to 3 and shift it to the past by 1 bar. With such a length, the shifted SMA does not exist only for the last bar (Bar = 0), since it needs the value of the next future price Close(-1).
2. Calculate SMA filer's channel width. Equal it to the Hodrick-Prescott filter's one. Find lambda.
3. Calculate Hodrick-Prescott filter value at the last bar HP(0) and assume that SMA(0) with unknown Close(-1) gives the same value.
4. Find Close(-1) = 3*HP(0) - Close(0) - Close(1)
5. Increase the length of SMA to 5. Repeat all calculations and find Close(-2) = 5*HP(0) - Close(-1) - Close(0) - Close(1) - Close(2). Continue till the specified amount of future FutBars prices is calculated.
Method 2:
1. Set SMA length equal to 2*FutBars+1 and shift SMA to the past by FutBars
2. Calculate SMA filer's channel width. Equal it to the Hodrick-Prescott filter's one. Find lambda.
3. Calculate Hodrick-Prescott filter values at the last FutBars and assume that SMA behaves similarly when new prices appear.
4. Find Close(-1) = (2*FutBars+1)*HP(FutBars-1) - Sum(Close(i),i=0..2*FutBars-1), Close(-2) = (2*FutBars+1)*HP(FutBars-2) - Sum(Close(i),i=-1..2*FutBars-2), etc.
The indicator features the following inputs:
Method - prediction method
Last Bar - number of the last bar to check predictions on the existing prices (LastBar >= 0)
Past Bars - amount of previous bars the Hodrick-Prescott filter is calculated for (the more, the better, or at least PastBars>2*FutBars)
Future Bars - amount of predicted future values
The second method is more accurate but often has large spikes of the first predicted price. For our purposes here, this price has been filtered from being displayed in the chart. This is why method two starts its prediction 2 bars later than method 1. The described prediction method can be improved by searching for the FIR filter with the frequency parameter closer to the Hodrick-Prescott filter. For example, you may try Hanning, Blackman, Kaiser, and other filters with constant delay instead of SMA.
Related indicators
Itakura-Saito Autoregressive Extrapolation of Price
Helme-Nikias Weighted Burg AR-SE Extra. of Price
Weighted Burg AR Spectral Estimate Extrapolation of Price
Levinson-Durbin Autocorrelation Extrapolation of Price
Fourier Extrapolator of Price w/ Projection Forecast
Magic 8-Ball [QuantNomad]Sometimes get tired and what to create something fun and useless )
Here I developed a magic 8-ball. You can apply it to the chart, and it randomly will show you a prediction unique for your symbol/candle time.
Please don't take this prediction seriously; there is 0 rationale behind it. However, I believe it can outperform some traders here on TradginView =)
So it will show you one of the following messages:
Buy
Strong Buy
HODL
Sell
Strong Sell
Ask again later
Better not tell you now
Neutral
Cannot predict now
Very doubtful
Bitcoin Implied VolatilityThis simple script collects data from FTX:BVOLUSD to plot BTC’s implied volatility as a standalone indicator instead of a chart.
Implied volatility is used to gauge future volatility and often used in options trading.