DojiEmoji

Trend Finder with Coefficient of Variation

DojiEmoji 已更新   
Coefficient of variation (“COV”) is a statistical measure used to describe the variability of values within a data set, it’s calculated by taking the standard deviation divided by the mean.

Traditionally, COV is applied to the expected returns of competing investment portfolios. A risk adverse investor prefers to accept a portfolio with a relatively lower COV value.

On the other hand, when applying COV to price charts, the difference is that instead of looking at expected returns, we now treat price as the source of data. We look at price from a moving average perspective. This script purely focuses on price.

What this indicator does:

Firstly, to go over the parameters:
Let ‘n’ be the lookback period for computing COV, and ‘m’ be the period for comparing the ranking of COVs.

Logics in a nutshell:
This program will (A) calculate the COV by dividing the moving standard deviation by moving average over ‘n’ bars, and then (B) illustrate the relationship of how COV at each bar ranks compared to COVs over past ‘m’ bars. We use a color scale (default black and yellow) for visualizing ranking in terms of percentiles. If COV is below its median value, then we assume that price is consolidating.

Hypothesis:
Using COV on top of regular SMA signals should reduce a lot of unwanted noise such as consecutive crossovers during ranging-periods. Traders want volatility, but not too much of it when sniping for entry opportunities (speaking of initial position; need to add to winning positions after, but this is for another topic). For this reason, the median value of COV is suitable as a metric for signals.

Applications:
We use the median value of COV to form a decision rule. A signal is generated when COV > median(COV,m), and the direction of trend is determined based on relative position of price with respect to sma(price,n). When the value of COV is increasing, it can also be thought of seeing Bollinger Bands beginning to bulge. When trends begin, this program will plot triangles to signify entry opportunities.



發布通知:
Added option to turn background colors on/off
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?