This script is used to indicate when price action of a crypto coin is diverging significantly from that of BTC.
Explanation of the Script: Inputs:
roc_length: The period used for calculating the Rate of Change. ma_length: The period used for the moving average of the ROC. threshold: The percentage difference that indicates a divergence.
Price Data:
The script retrieves the current asset's price and Bitcoin's price. ROC Calculation:
The ROC for both the current asset and BTC is calculated based on the defined roc_length. Moving Averages:
Simple moving averages (SMA) of the ROC values are calculated to smooth out the data. Divergence Detection:
The indicator checks if the current asset's ROC MA is significantly higher or lower than Bitcoin's ROC MA based on the specified threshold. Plotting:
The script plots the ROC values and their moving averages. It also highlights the background in green when a bullish divergence is detected (when the asset is moving up while BTC is lagging) and in red for a bearish divergence.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
차트에서 빠르게 액세스하려면 이 스크립트를 즐겨찾기에 추가하세요 — 여기에서 자세히 알아보기.