twingall

High/Low of week: Stats & Day of Week tendencies

// Purpose:
-To show High of Week (HoW) day and Low of week (LoW) day frequencies/percentages for an asset.
-To further analyze Day of Week (DoW) tendencies based on averaged data from all various custom weeks. Giving a more reliable measure of DoW tendencies ('Meta Averages').
-To backtest day-of-week tendencies: across all asset history or across custom user input periods (i.e. consolidation vs trending periods).
-Education: to see how how data from a 'hard-defined-week' may be misleading when seeking statistical evidence of DoW tendencies.

// Notes & Tips:
-Only designed for use on DAILY timeframe.
-Verification table is to make sure HoW / LoW DAY (referencing previous finished week) is printing correctly and therefore the stats table is populating correctly.
-Generally, leaving Timezone input set to "America/New_York" is best, regardless of your asset or your chart timezone. But if misaligned by 1 day =>> tweak this timezone input to correct
-If you want to use manual backtesting period (e.g. for testing consolidation periods vs trending periods): toggle these settings on, then click the indicator display line three dots >> 'Reset Points' to quickly set start & end dates.

// On custom week start days:
-For assets like BTC which trade 7 days a week, this is quite simple. Pick custom start day, use verification table to check all is well. See the start week day & time in said verification table.
-For traditional assets like S&P which trade only 5 days a week and suffer from occasional Holidays, this is a bit more complicated. If the custom start day input is a bank holiday, its custom 'week' will be discounted from the data set. E.g.1: if you choose 'use custom start day' and set it to Monday, then bank holiday Monday weeks will be discounted from the data set. E.g.2: If you choose 'use custom start day' and set it to Thursday, then the Holiday Thursday custom week (e.g Thanksgiving Thursday >> following Weds) would be discounted from the data set.

// On 'Meta Averages':
-The idea is to try and mitigate out the 'continuation bias' that comes from having a fixed week start/end time: i.e. sometimes a market is trending through the week start/end time, so the start/end day stats are over-weighted if one is trying to tease out typical weekly profile tendencies or typical DoW tendencies. You'll notice this if you compare the stats with various custom start days ('bookend' start/end days are always more heavily weighted). I wanted to try to mitigate out this 'bias' by cycling through all the possible new week start/end days and taking an average of the results. i.e. on BTC/USD the 'meta average' for Tuesday would be the average of the Tuesday HoW frequencies from the set of all 7 possible custom weeks(Mon-Sun, Tues-Mon, Weds-Tues, etc etc).

// User Inputs:
~Week Start:
-use custom week start day (default toggled OFF); Choose custom week start day
-show Meta Averages (default toggled ON)
~Verification Table:
-show table, show new week lines, number of new week lines to show
-table formatting options (position, color, size)
-timezone (only for tweaking if printed DoW is misaligned by 1 day)
~Statistics Table:
-show table, table formatting options (position, color, size)
~Manual Backtesting:
-Use start date (default toggled OFF), choose start date, choose vline color
-Use end date (defautl toggled OFF), choose end date, choose vline color

// Demo charts:
NQ1! (Nasdaq), Full History, Traditional week (Mon>>Friday) stats. And Meta Averages. Annotations in purple:
NQ1! (Nasdaq), Full History, Custom week (custom start day = Wednesday). And Meta Averages. Annotations in purple:

You can buy me a coffee here...

PayPal.Me/twingall
BTC: 3JrhUwNRnKyqhaa1n1AXKeAubNeEFoch6S
ETH erc20: 0x4b0400B1c18503529ab69611e82a934DDe4Ab038
ETH bep20: 0x1F0f03F184079bb1085F8C9dF3a8191C9f5869B3
오픈 소스 스크립트

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

면책사항

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

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