에디터즈 픽
OPEN-SOURCE SCRIPT

Fair value bands / quantifytools

업데이트됨
— Overview

Fair value bands, like other band tools, depict dynamic points in price where price behaviour is normal or abnormal, i.e. trading at/around mean (price at fair value) or deviating from mean (price outside fair value). Unlike constantly readjusting standard deviation based bands, fair value bands are designed to be smooth and constant, based on typical historical deviations. The script calculates pivots that take place above/below fair value basis and forms median deviation bands based on this information. These points are then multiplied up to 3, representing more extreme deviations.

스냅샷

By default, the script uses OHLC4 and SMA 20 as basis for the bands. Users can form their preferred fair value basis using following options:

Price source
- Standard OHLC values
- HL2 (High + low / 2)
- OHLC4 (Open + high + low + close / 4)
- HLC3 (High + low + close / 3)
- HLCC4 (High + low + close + close / 4)

Smoothing
- SMA
- EMA
- HMA
- RMA
- WMA
- VWMA
- Median

Once fair value basis is established, some additional customization options can be employed:

Trend mode
Direction based
Cross based

Trend modes affect fair value basis color that indicates trend direction. Direction based trend considers only the direction of the defined fair value basis, i.e. pointing up is considered an uptrend, vice versa for downtrend. Cross based trends activate when selected source (same options as price source) crosses fair value basis. These sources can be set individually for uptrend/downtrend cross conditions. By default, the script uses cross based trend mode with low and high as sources.

Cross based (downtrend not triggered) vs. direction based (downtrend triggered):

스냅샷

Threshold band
Threshold band is calculated using typical deviations when price is trading at fair value basis. In other words, a little bit of "wiggle room" is added around the mean based on expected deviation. This feature is useful for cross based trends, as it allows filtering insignificant crosses that are more likely just noise. By default, threshold band is calculated based on 1x median deviation from mean. Users can increase/decrease threshold band width via input menu for more/less noise filtering, e.g. 2x threshold band width would require price to cross wiggle room that is 2x wider than typical, 0x erases threshold band altogether.

Deviation bands
Width of deviation bands by default is based on 1x median deviations and can be increased/decreased in a similar manner to threshold bands.

스냅샷
스냅샷

Each combination of customization options produces varying behaviour in the bands. To measure the behaviour and finding fairest representation of fair and unfair value, some data is gathered.

— Fair value metrics

Space between each band is considered a lot, named +3, +2, +1, -1, -2, -3. For each lot, time spent and volume relative to volume moving average (SMA 20) is recorded each time price is trading in a given lot:

스냅샷

Depending on the asset, timeframe and chosen fair value basis, shape of the distributions vary. However, practically always time is distributed in a normal bell curve shape, being highest at lots +1 to -1, gradually decreasing the further price is from the mean. This is hardly surprising, but it allows accurately determining dynamic areas of normal and abnormal price behaviour (i.e. low risk area between +1 and -1, high risk area between +-2 to +-3). Volume on the other hand is typically distributed the other way around, being lowest at lots +1 to -1 and highest at +-2 to +-3. When time and volume are distributed like so, we can conclude that 1) price being outside fair value is a rare event and 2) the more price is outside fair value, the more anomaly behaviour in volume we tend to find.

Viewing metric calculations
Metric calculation highlights can be enabled from the input menu, resulting in a lot based coloring and visibility of each lot counter (time, cumulative relative volume and average relative volume) in data window:

스냅샷

— Alerts

Available alerts are the following:

Individual
- High crossing deviation band (bands +1 to +3 )
- Low crossing deviation band (bands -1 to -3 )
- Low at threshold band in an uptrend
- High at threshold band in a downtrend
- New uptrend
- New downtrend

Grouped
- New uptrend or downtrend
- Deviation band cross (+1 or -1)
- Deviation band cross (+2 or -2)
- Deviation band cross (+3 or -3)

— Practical guide

Example #1: Risk on/risk off trend following

Ideal trend stays inside fair value and provides sufficient cool offs between the moves. When this is the case, fair value bands can be used for sensible entry/exit levels within the trend.

스냅샷

Example #2: Mean reversions

When price shows exuberance into an extreme deviation, followed by a stall and signs of exhaustion (wicks), an opportunity for mean reversion emerges. The higher the deviation, the more volatility in the move, the more signalling of exhaustion, the better.

스냅샷

Example #3: Tweaking bands for desired behaviour

The faster the length of fair value basis, the more momentum price needs to hit extreme deviation levels, as bands too are moving faster alongside price. Decreasing fair value basis length typically leads to more quick and aggressive deviations and less steady trends outside fair value.

스냅샷
스냅샷
릴리즈 노트
Update

Fixed a bug causing settings table to occasionally show incorrect price sources.
릴리즈 노트
Update

1. Fixed a bug causing chart to scale out on enabling metric highlights. If you experienced chart "disappearing", this should fix it.
2. Added inputs for adjusting table position and size.
릴리즈 노트
Update

Added anchored VWAP to fair value basis options. Can be anchored to any standard timeframe supported by Tradingview.

스냅샷
릴리즈 노트
Updated license
릴리즈 노트
Added user defined band crosses

스냅샷
Bands and ChannelsdynamiclevelsfairvaluefairvalueareafairvaluebandsoverboughtoversoldquantifytoolsrelativevolumeStandard Deviationtimedistributionvolumedistribution

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

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


✨ Get instant access to Premium Toolstack for Free: Liquidity prints, Price based concepts and Liquidity composition

✨ Start 7-Day Free Trial: quantify.tools

Watch video tutorials covering our tools on Youtube ↓
또한 다음에서도:

면책사항