UnknownUnicorn468659

Week of the Year indicator

Simple time indicator showing weeks of the year. Acts to help you define the greater perspective of time on your charts. You can overlay it on the entire chart or use it small and consolidated like I prefer it.

Easiest to configure colors in the script itself and then leave transparency values untouched:
q1w1 = the first week of the first quarter of the year (1st week of january, indicating a new year)
q1= 1-13
q2= 14-26
q3= 27-39
q4=40-53

Hope this helps you, like it helps me.
Best regards,

IMPORTANT NOTE:
Because the scripts asks for the week of the year it doesn't exactly indicate the first day of the quarter of the year. Instead it indicates the year like this: 52 / 4 = 13 W p/Q. Or in other words: 13 weeks per quarter of the year (roughly). Every 5.6 years there's a 53rd week, which will not cause any trouble as long as TV allows the use of the 53rd week, which I think it does.
오픈 소스 스크립트

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

면책사항

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

차트에 이 스크립트를 사용하시겠습니까?
study(title="Week of the Year", shorttitle="Week of the Year", overlay=true)
q1w1 = #ffffff
q1 = #0099ff
q2 = #33ccff
q3 = #ff9900
q4 = #fc1687
bgColor =(weekofyear == 1) ? color(q1w1, 0):
    (weekofyear == 2) ? color(q1, 7) :
    (weekofyear == 3) ? color(q1, 14) :
    (weekofyear == 4) ? color(q1, 21) :
    (weekofyear == 5) ? color(q1, 28) :
    (weekofyear == 6) ? color(q1, 35) :
    (weekofyear == 7) ? color(q1, 42) :
    (weekofyear == 8) ? color(q1, 49) :
    (weekofyear == 9) ? color(q1, 56) :
    (weekofyear == 10) ? color(q1, 63) :
    (weekofyear == 11) ? color(q1, 70) :
    (weekofyear == 12) ? color(q1, 77) :
    (weekofyear == 13) ? color(q1, 84) :
    (weekofyear == 14) ? color(q2, 0) :
    (weekofyear == 15) ? color(q2, 7) :
    (weekofyear == 16) ? color(q2, 14) :
    (weekofyear == 17) ? color(q2, 21) :
    (weekofyear == 18) ? color(q2, 28) :
    (weekofyear == 19) ? color(q2, 35) :
    (weekofyear == 20) ? color(q2, 42) :
    (weekofyear == 21) ? color(q2, 49) :
    (weekofyear == 22) ? color(q2, 56) :
    (weekofyear == 23) ? color(q2, 63) :
    (weekofyear == 24) ? color(q2, 70) :
    (weekofyear == 25) ? color(q2, 77) :
    (weekofyear == 26) ? color(q2, 84) :
    (weekofyear == 27) ? color(q3, 0) :
    (weekofyear == 28) ? color(q3, 7) :
    (weekofyear == 29) ? color(q3, 14) :
    (weekofyear == 30) ? color(q3, 21) :
    (weekofyear == 31) ? color(q3, 28) :
    (weekofyear == 32) ? color(q3, 35) :
    (weekofyear == 33) ? color(q3, 42) :
    (weekofyear == 34) ? color(q3, 49) :
    (weekofyear == 35) ? color(q3, 56) :
    (weekofyear == 36) ? color(q3, 63) :
    (weekofyear == 37) ? color(q3, 70) :
    (weekofyear == 38) ? color(q3, 77) :
    (weekofyear == 39) ? color(q3, 84) :
    (weekofyear == 40) ? color(q4, 0) :
    (weekofyear == 41) ? color(q4, 7) :
    (weekofyear == 42) ? color(q4, 14) :
    (weekofyear == 43) ? color(q4, 21) :
    (weekofyear == 44) ? color(q4, 28) :
    (weekofyear == 45) ? color(q4, 35) :
    (weekofyear == 46) ? color(q4, 42) :
    (weekofyear == 47) ? color(q4, 49) :
    (weekofyear == 48) ? color(q4, 56) :
    (weekofyear == 49) ? color(q4, 63) :
    (weekofyear == 50) ? color(q4, 70) :
    (weekofyear == 51) ? color(q4, 77) :
    (weekofyear == 52) ? color(q4, 84) :
    (weekofyear == 53) ? color(q4, 91) :
    color(black, 0)
bgcolor(color=bgColor)