Kaschko

Kaschko's Seasonal Trend

Kaschko 已更新   
This script calculates the average price moves (using each bar's close minus the previous bar's close) for the trading days, weeks or months (depending on the timeframe it is applied to) of a number of past calendar years (up to 30) to construct a seasonal trend which is then drawn as a seasonal chart (overlay) onto the price chart. Supported are the 1D,1W,1M timeframes.

The seasonal chart is adjusted to the price chart (so that both occupy the same height on the overall chart) and it is also de-trended, which means that the seasonal chart's starting value is the same in each year and the progression during the year is adjusted so that no abrupt gap occurs between years and the highs and lows of consecutive years of the seasonal chart (if projected over more than one year) are also at the same level. Of course, this also means that the absolute value of the seasonal chart has no meaning at all.

You can configure the number of bars the seasonal chart is drawn into the future. This projection shows how price could move in the future if the market shows the same seasonal tendencies like in the past. On the daily chart, the trading week of year (TWOY), trading day of month (TDOM) and trading day of year (TDOY) are shown in the status line.

Caution is advised as seasonality is based on the past. It is not a reliable prediction of the future. But it can still be used as an additional confirmation or contradiction of an otherwise recognized possible impending trend.

I have used a virtually identical indicator for a long time in a commercial software package popular among futures traders, but have not found anything comparable here. Therefore I implemented it myself. I hope you find it useful.

版本注释:
1. minor bug fixed in the scaling algorithm
2. instead of always using fixed 252 trading days on the daily timeframe, the script now offers the option to use a variable number of trading days. The default is still fixed 252 trading days. When using a variable number of trading days, the actual number used results from the number of trading days within the years of the lookback period. You can choose to use the minimum, the maximum or the average number of trading days for all years. For crude oil futures (CL1!), the script will still use between 251 and 253 trading days. However, for Bitcoin (BTCUSD) it will actually use between 362 and 365 (or even 366) trading days. The actual number used is written to Pine Log.
版本注释:
New features:

1) Simple Moving Average / Smoothing

Instead of drawing the seasonal trend directly, optionally a moving average over a configurable number of bars can now be drawn. This smoothes out the seasonal trend line. The default is 1, i.e., do not apply a moving average.

2) Offset

You can now apply an offset to the seasonal trend line. A positive value shifts the line into the past, a negative value into the future. This is particularly useful when a moving average is used, as it causes the highs and lows of the seasonal trend to shift to the right (into the future). The best value for the offset depends on the value used for the moving average. It may take a few tries to find the most suitable combination of values. The default for the offset is 0, i.e., no offset.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?