accidentje

4 year seasonality - % (Daily TF)

1411 뷰
154
Inspired by the work done by crasher (can be found here: https://www.tradingview.com/v/thMIhiZ7/).
Improvement of my earlier adaptation (can be found here: https://www.tradingview.com/v/fXwHPijr/).

This script projects the average % change of the selected security in the past 4 years.
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기
study("Cycle Seasonality - % (Daily TF)")

Period = input(title="Period Cycle", type=integer , defval=264)
Seasonlength = input(title="Season length", type=integer, defval=66)
Smoothing = input(title="SMA (smoothing)", type=integer, defval=5)

LBP = Period / Seasonlength

lastyear = (close - close[1*Period/LBP]) / close[1*Period/LBP]
twoyearsago = (close[1*Period] - close[1*Period + Period/LBP]) / close[1*Period + Period/LBP]
threeyearsago = (close[2*Period] - close[2*Period + Period/LBP]) / close[2*Period + Period/LBP]
fouryearsago = (close[3*Period] - close[3*Period + Period/LBP]) / close[3*Period + Period/LBP]

cum = (lastyear+twoyearsago+threeyearsago+fouryearsago)/4

smacum = sma(cum, Smoothing)

scolor = smacum >= 0 ? green : red

hline(0)
plot(smacum*10, color=scolor, offset = 264, style=columns)

코멘트

Yeah I like the idea but there is something that is confusing me.
Now the columns represent how much the instrument won or lost in % over the past four years. But what if I want to think of it as a small seasonal chart or price cycle. In other words, over those last four years on average when did the instrument see a bottom and when did it see a top. How do I do that?
+2 응답
nice work on the seasonal indicators. im having a little trouble setting up the inputs. can you explain what period length and sma smoothing represent in a little more detail? thx!
응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터
프로화일 프로화일설정 계정 및 빌링 프렌드 리퍼하기 나의 서포트 티켓 헬프 센터 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃