loxx

Variety Trend Continuation Factor (advanced) [Loxx]

loxx Atualizado   
The Trend Continuation Factor (TCF) identifies the trend and its direction. TCF was introduced by M. H. Pee. Positive values of either the Positive Trend Continuation Factor (TCF+) and the Negative Trend Continuation Factor (TCF-) indicate the presence of a strong trend.

This strategy includes 5 different types of volatility filters and a moving average filter. Each filter has its own settings.

This indicator makes use of the Moving Averages found in the Baseline Backtest indicator:

Volatility Types Included
v1.0 Included Volatility


Close-to-Close
Close-to-Close volatility is a classic and most commonly used volatility measure, sometimes referred to as historical volatility .

Volatility is an indicator of the speed of a stock price change. A stock with high volatility is one where the price changes rapidly and with a bigger amplitude. The more volatile a stock is, the riskier it is.

Close-to-close historical volatility calculated using only stock's closing prices. It is the simplest volatility estimator. But in many cases, it is not precise enough. Stock prices could jump considerably during a trading session, and return to the open value at the end. That means that a big amount of price information is not taken into account by close-to-close volatility .

Despite its drawbacks, Close-to-Close volatility is still useful in cases where the instrument doesn't have intraday prices. For example, mutual funds calculate their net asset values daily or weekly, and thus their prices are not suitable for more sophisticated volatility estimators.

Parkinson
Parkinson volatility is a volatility measure that uses the stock’s high and low price of the day.

The main difference between regular volatility and Parkinson volatility is that the latter uses high and low prices for a day, rather than only the closing price. That is useful as close to close prices could show little difference while large price movements could have happened during the day. Thus Parkinson's volatility is considered to be more precise and requires less data for calculation than the close-close volatility .

One drawback of this estimator is that it doesn't take into account price movements after market close. Hence it systematically undervalues volatility . That drawback is taken into account in the Garman-Klass's volatility estimator.

Garman-Klass
Garman Klass is a volatility estimator that incorporates open, low, high, and close prices of a security.

Garman-Klass volatility extends Parkinson's volatility by taking into account the opening and closing price. As markets are most active during the opening and closing of a trading session, it makes volatility estimation more accurate.

Garman and Klass also assumed that the process of price change is a process of continuous diffusion (gTCFetric Brownian motion). However, this assumption has several drawbacks. The method is not robust for opening jumps in price and trend movements.

Despite its drawbacks, the Garman-Klass estimator is still more effective than the basic formula since it takes into account not only the price at the beginning and end of the time interval but also intraday price extremums.

Researchers Rogers and Satchel have proposed a more efficient method for assessing historical volatility that takes into account price trends. See Rogers-Satchell Volatility for more detail.

Rogers-Satchell
Rogers-Satchell is an estimator for measuring the volatility of securities with an average return not equal to zero.

Unlike Parkinson and Garman-Klass estimators, Rogers-Satchell incorporates drift term (mean return not equal to zero). As a result, it provides a better volatility estimation when the underlying is trending.

The main disadvantage of this method is that it does not take into account price movements between trading sessions. It means an underestimation of volatility since price jumps periodically occur in the market precisely at the moments between sessions.

A more comprehensive estimator that also considers the gaps between sessions was developed based on the Rogers-Satchel formula in the 2000s by Yang-Zhang. See Yang Zhang Volatility for more detail.

Yang-Zhang
Yang Zhang is a historical volatility estimator that handles both opening jumps and the drift and has a minimum estimation error.

We can think of the Yang-Zhang volatility as the combination of the overnight (close-to-open volatility ) and a weighted average of the Rogers-Satchell volatility and the day’s open-to-close volatility . It considered being 14 times more efficient than the close-to-close estimator.

Garman-Klass-Yang-Zhang
Garman Klass is a volatility estimator that incorporates open, low, high, and close prices of a security.

Garman-Klass volatility extends Parkinson's volatility by taking into account the opening and closing price. As markets are most active during the opening and closing of a trading session, it makes volatility estimation more accurate.

Garman and Klass also assumed that the process of price change is a process of continuous diffusion (gTCFetric Brownian motion). However, this assumption has several drawbacks. The method is not robust for opening jumps in price and trend movements.

Despite its drawbacks, the Garman-Klass estimator is still more effective than the basic formula since it takes into account not only the price at the beginning and end of the time interval but also intraday price extremums.

Researchers Rogers and Satchel have proposed a more efficient method for assessing historical volatility that takes into account price trends. See Rogers-Satchell Volatility for more detail.

Exponential Weighted Moving Average
The Exponentially Weighted Moving Average (EWMA) is a quantitative or statistical measure used to model or describe a time series. The EWMA is widely used in finance, the main applications being technical analysis and volatility modeling.

The moving average is designed as such that older observations are given lower weights. The weights fall exponentially as the data point gets older – hence the name exponentially weighted.

The only decision a user of the EWMA must make is the parameter lambda. The parameter decides how important the current observation is in the calculation of the EWMA. The higher the value of lambda, the more closely the EWMA tracks the original time series.

Standard Deviation of Log Returns
This is the simplest calculation of volatility . It's the standard deviation of ln(close/close(1))

Pseudo GARCH(2,2)
This is calculated using a short- and long-run mean of variance multiplied by θ.

θavg(var ;M) + (1 − θ) avg (var ;N) = 2θvar/(M+1-(M-1)L) + 2(1-θ)var/(M+1-(M-1)L)

Solving for θ can be done by minimizing the mean squared error of estimation; that is, regressing L^-1var - avg (var; N) against avg (var; M) - avg (var; N) and using the resulting beta estimate as θ.

Average True Range
The average true range (ATR) is a technical analysis indicator, introduced by market technician J. Welles Wilder Jr. in his book New Concepts in Technical Trading Systems, that measures market volatility by decomposing the entire range of an asset price for that period.

The true range indicator is taken as the greatest of the following: current high less the current low; the absolute value of the current high less the previous close; and the absolute value of the current low less the previous close. The ATR is then a moving average, generally using 14 days, of the true ranges.

True Range Double
A special case of ATR that attempts to correct for volatility skew.

Signals

Crosses

Initial Long (L): Hard flip downtrend to uptrend; TCF upper crosses up TCF lower
Initial Short (S): Hard flip uptrend to downtrend flip; TCF lower crosses up TCF upper
Continuation Long ( CL ): TCF upper already above TCF upper, TCF upper crosses up TCF signal
Continuation Short (CS): TCF lower already above TCF lower, TCF lower crosses up TCF signal
Post Baseline Cross Long ( BL ): TCF upper crossed up TCF lower XX bars ago but Baseline didn't agree (that is, is still showing downtrend), if Baseline then catches up and agrees with direction within XX bars since the TCF crossup, then this signal is triggered
Post Baseline Cross Short (BS): TCF lower crossed up TCF upper XX bars ago but Baseline didn't agree (that is, is still showing downtrend), if Baseline then catches up and agrees with direction within XX bars since the TCF crossup, then this signal is triggered
BL Recross Continuation Long ( RL ): TCF upper above lower Baseline crossed down into downtrend, then baseline crosses back up to uptrend while TCF is still in uptrend then this signal is triggered
BL Recross Continuation Short ( RS ): TCF lower above upper. Baseline crossed up into uptrend, then baseline crosses back down to downtrend while TCF is still in downtrend then this signal is triggered

Take profit philosophy
The Take Profits and Stop Loss are based on multiples of volatility. So, if you set Take Profit 1 to a multiple of 1, which is the default, then the the Take Profit 1 for a Long is:

source + 1.0 x volatility in price

If you set the Stoploss to a multiplier of 1.5, then the Stoploss for a Long is set to:

source - 1.5 x volatility in price

Filters
Volatility Goldie Locks Zone
If price crosses the baseline, we check to see how far it has moved in terms of multiples of volatility denoted in price ( volatility in price x multiple). If price has moved by at least "Qualifier multiplier" and less than "Range Multiplier", then the strategy enters a trade.

Adaptive Jurik Volatility (advanced)
This is an advanced version of Juirk Volatility that lies outside of JFCBeaux and Jurik Volty. When volatility is above a specific adaptive threshold then the strategy will allow for longs/shorts assuming a long/short signal pings from the TCF . This filter also includes the ability to restrict to bars rising meaning that volatility has to be on an upward swing to allow for TCF longs/shorts

Adaptive Volatility Ratio (advanced)
When volatility is above a specific adaptive threshold then the strategy will allow for longs/shorts assuming a long/short signal pings from the TCF . This filter also includes the ability to restrict to bars rising meaning that volatility has to be on an upward swing to allow for TCF longs/shorts

Semi-Variance (advanced)
When the difference between upward and downward volatility meats a certain threshold, the strategy will allow for longs/shorts assuming a long/short signal pings from the TCF . This filter also includes the ability to restrict to bars rising meaning that volatility has to be on an upward swing to allow for TCF longs/shorts

Baseline Filter
This adds another layer of filtering (See Post Baseline Cross signals above). This is a simple over/under qualification filter. If price is above the baseline, then that means it qualifies for a long, if price is below the baseline, then this qualifies for a short. This filter must be active for Post Baseline Cross signals to trigger.

Take Profit/Stoploss Quantity Removed
1 Take Profit: 100% of the trade is closed when the profit target or stoploss is reached.
2 Take Profits: Quantity is split 50/50 between Take Profit 1 and Take Profit 2
3 Take Profits: Quantify is split 50/25/25.

Example: If you select 3 Take Profits and you long 1 BTC , then when Take Profit 1 hits, the strategy will remove 50% of the trade, meaning you'll have 0.5 BTC left in the trade. When Take Profit 2 hits, the strategy will remove 50% of 0.5 BTC leaving 0.25 BTC in the trade. When Take Profit 3 hits, then whatever is left in the trade is removed from the trade.

Moving Stoploss
1 Take Profit: The Stoploss doesn't move
2 Take Profits: After Take Profit 1 is hit, then the Stoploss moves to the trade Entry
3 Take Profits: After Take Profit 1 is hit, then the Stoploss for Take Profit 2 and Take Profit 3 is move to trade Entry. When Take Profit 2 is hit, then Take Profit 3 Stoploss is moved to Take Profit 1

Trailing Take Profit
Applies to Take Profit levels 2 and 3. When this is active, if price pulls back by XX volatility in price, then the trade exits.

Date Range
Select starting (from) date for the backtest and ending (through) date for the backtest.

Other things to know
The strategy does't exit on the entry candle. This is a safety measure to keep the backtest results clean and accurate. After the strategy enters a trade, it will wait until the entry candle close to set take profits and stoploss. This should have minimal effects on the backtest results compared to live trading. This may or may not be updated in the future

Tips and tricks
-Try toggle the volatility qualifiers on/off when trading different types of assets. See how the backtest results change.
-Change the Baseline type used in the Baseline filter, see how the results change. The Baseline filter used here doesn't need to match the core Baseline you choose to use for your trading system

Additional moving averages, volatility types, qualifiers, and other advanced features will be added in future releases.

This indicator is only available to ALGX Trading VIP group members . You can see the Author's Instructions below to get more information on how to get access.
Notas de Lançamento:
Small update to continuation signals
Notas de Lançamento:
Updated AMA

Public Telegram Group, t.me/algxtrading_public

VIP Membership Info: www.patreon.com/algxtrading/membership
Script apenas com convite

O acesso a este script é restrito aos usuários autorizados pelo autor e pode requerir pagamento. Você pode adicioná-lo a seus favoritos, mas só poderá utilizá-lo após solicitar permissão e obtê-la do autor. Contate loxx para mais informações, ou siga as instruções do autor abaixo.

TradingView não sugere pagar por um script e usá-lo até que você confie 100% em seu autor e entenda como o script funciona. Em muitos casos você pode encontrar uma boa alternativa de código aberto gratuitamente nos Scripts da Comunidade.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Instruções do autor

For instructions on how to access, send me a private message here on TradingView or message me using the contact information listed in my TradingView profile.

Quer usar esse script no gráfico?

Aviso: por favor leia antes de solicitar acesso