OPEN-SOURCE SCRIPT

Price Distance Ratio

This study plots the ratio between current price and the price N days ago.

With N input that is configurable, users can find optimal long/short entries when price is in an established trend and price has diverge far from a given local peak or all time high.

With many years of stock trading the analysis indicates a connection between the distance of price and subsequent returns.
Portfolios of stocks with lower price to local highes ratios generally underperformed portfolios of stocks with higher prices to peaks reached similar N days ago.

The highest returns to previous peak are recorded when buying at the biggest dip.
For example, the purchase at 20% drawdown could generate 25% when price returns to the peak. The purchase at 50% drawdown could generate bigger, i.e. 100% return, when price returns to the peak. And the purchase at 90% drawdown could generate much bigger, i.e. 900% return, in a case the price returns to the peak.

However, buying very far below local peaks on almost all holding periods produces lower CAGR returns because of "timing adjustment". In simple words, typically the drawdown takes less time vs. further recovery.

For example:
👉 The largest BTC drawdown in 2013-2015 took 410 days (Peak-to-Valley). And the recovery of BTC to new highs took 771 days (Valley-to-Peak) after that.
👉 The 3rd longest drawdown in BTC took 363 days (observed from December 17, 2017 to December 15, 2018). And further recovery in BTC to its new high took almost two years - 716 days.
👉The 4th longest drawdown in BTC took 162 days (observed from June 08, 2011 to November 17, 2011). And further recovery in BTC to its new high took more than a year - 469 days.

The concept of this study could recognizes at least 4 different modes of action.
👉 In a clearly established upward trend traders should be buying (following the trend) when Ratio is above 100% and reducing the size when Ratio turns below 100%.
👉 Conversely, in a clearly established downward trend traders should be shorted when Ratio is below 100% and covering when the Ratio turns back to 100%.
👉 In a sideways movement traders are advised to wait carefully if the Ratio near 100% for a long time, and take a position the trend is clear.
👉 Chartists can analyze the dynamic of the indicator - both in terms of trends and overall level. For example as it shown at the chart.

The understading of the study and rules of "timing adjustments" could genarate the awesome opportunities for stock options traders also, with strategies of selling uncovered call options and vertical call spreads.

// Many thanks to HPotter and Wheeelman wizards for their continious support and assistance.

스냅샷
BTCUSDETHUSDNASDAQ 100 CFDPortfolio managementpriceactionanalysisSPX (S&P 500 Index)stockmarketanalysisTrend Analysis

오픈 소스 스크립트

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

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

면책사항