Steversteves

Z-Score Forecaster[SS]

Hello everyone,

I just released a neat library for Forecasting stock and equities. In it, it has a couple of novel approaches to forecasting (namely, a Moving Average forecaster and a Z-Score Forecaster). These were accomplished applying basic theories on Autoregression, ARIMA modelling and Z-Score to make new approaches to forecasting.

This is one of the novel approaches, the Z-Score forecaster.
How this function works is it identifies the current trend over the duration of the Z-Score assessment period. So, if the Z-Score is being assessed over the previous 75 candles, it will identify the trend over the previous 75 candles. It will then plot out the forecasted levels according to the trend, up to a maximum of the max Z-Score the ticker has reached within its period. At that point, it will show a likely trend reversal.

Here is an example:


This shows that SPY may go to 475.42 before reversing, as 475.42 is the highest z-score that has been achieved in the current trend.

When it is in an uptrend, the forecast line will be green, when in a downtrend, it will be red.
The forecasting line is accomplished through pinescript's new polyline feature.

In addition to the line, you can also have the indicator plot out a forecast table. The Z-Score Forecast table was formatted in a similar way to ARIMA, where it makes no bias about trend, it simply plots out both ends of the spectrum. So, if an uptrend were to continue, it will list the various uptrend targets along the way, vice versa for downtrends.
It will also display what Z-Score these targets would amount to. Here is an example:


Looking at SPY on the daily, we can see that a likely upside target would be around 484 at just over 2 Standard Deviations (Z-Score).
Its not liklely to go higher than that because then we are getting into 3 and 4 standard deviations.

Remember, everything generally should be within 1 and -1 standard deviations of the mean. So if we look at the table, we can see that would be between 466 and 430.

Customization

You can customize the Z-Score length and source. You can also toggle off and on alerts. The alerts will pop up when a ticker is trading at a previous maximum or previous minimum.

I have also added a manual feature to plot the Z-Score SMA, which is simply the SMA over the desired Z-Score lookback time.

And that's the indicator!
If you are interested in the library, you can access it here.

Thanks for checking this out and leave your questions below!

Premium indicators and content have launched! Get access at: www.patreon.com/steversteves
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?