koryu

True Trend Average Bands

koryu 업데이트됨   
This is the indicator I am most proud of. After reading Glenn Neely's book "Mastering Eliott Waves" / "Neowave" and chatting with @timwest who got acknowledged by Neely, we came up with the idea of an moving average which does calculate the real average price since a trend started. Addionally I adapted a method from Neely Neowave and Tim Wests TimeAtMode to not force a timeframe on a chart but instead let the charts data decide which timeframe to use, to then calculate the real average price since the trend started.

It took me a while to get this right and coded, so take a moment and dive deeper and you might learn something new.

We assume that the price is in multiple trends on multiple timeframes, this is caused by short term traders, long term traders and investors who trade on different timeframes. To find out in which timeframe the important trends are, we have to look out for significant lows and highs. Then we change the timeframe in the chart to a value so that we have 10 to 20 bars since the significant low/high. While new bars are printed, and we reach more than 20 bars, we have to switch to a higher timeframe so we have 10 to 20 bars again. In the chart you see two significant trends: a downtrend on the 3 week timeframe and an uptrend from the 2 month timeframe. Based on the logic I have described, these are the two important timeframes to watch right now for the spx (there is another uptrend in the yearly chart, which is not shown here).

Now that we understand how to find the important timeframes, let's look what the magic in this script is that tells us the real average price since a trend started.
I developed a new type of moving average, which includes only the prices since a trend started. The difference to the regular sma is that it will not include prices which happened before the significant low or high happened. For example, if a top happened in a market 10 days ago, the regular sma20 would be calculated by 10 bars which happened before the top and 10 bars which happened after the top. If we want to know the average price of the last 10 bars we manually have to change the ma20 to the ma10 which is annoying manual work, additionally even if we use the ma10 in this case, and we look at yesterday's bar the ma10 will include 9 bars from after the top and one bar before the top, so the ma10 would only show the real average price for the current bar which is not what we want.
To come up with a solution to this problem, the True Trend Average searches for the lowest/highest bar in a given period (20 bars). Then starts to calculate the average value since the low/high. For example: if the price reaches a new 20 day high and then trades below it, the day of the high will be the sma1, the day after it's the sma2, ... up to the maximum look back length.
This way, we always know what the average price would have been if someone sold/bought a little bit every bar of his investment since the high/low.
Why is this even important? Let's assume we missed selling the top or buying the low, and think it would have been at least better to buy/sell a little bit since the new trend started. Once the price reaches the true trend average again, we can buy/sell, and it would be as good as selling/buying a little bit every day. We find prices to buy the dip and sell the bounce, which are as good as scaling in/out.
There is a lot more we can learn from these price levels but I think it is better to let you figure out yourself what you can learn from the information given by this indicator. Think about how market participants who accumulate or distribute feel when prices are above or below certain levels.

Now that we understand this new type of moving average, let's look into the lines we see in the chart:

  • The upper red band line shows the true trend average high price since the last significant top within 20 bars.
  • The lower red band line shows the true trend average hl2 price since the last significant top within 20 bars.
  • The lower green band line shows the true trend average low price since the last significant low within 20 bars.
  • The upper green band line shows the true trend average hl2 price since the last significant low within 20 bars.
  • The centerline is the average between the upper red band and the lower green band.
  • The teal lines show 1 standard deviation from the outer bands.

Before today only a few people had access to this indicator, now that it is public and open source, I am curious if you will find it useful and what you will do with it. Please share your findings.



/edit: The chart only shows the 3week timeframe so here are the other two trends from the 2month and 1year timeframe


릴리즈 노트:
- Updated for pine script v5
- Removed experimental features
- Added titles to plots
릴리즈 노트:
Removed obsolete parameter
릴리즈 노트:
cosmetic changes
릴리즈 노트:
Added offset for breakout bands

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?