TRAX Detrended Price StrategyIn this script, the "TRAX" (TRIX) indicator is calculated using the Volume Weighted Moving Average (VWMA) instead of Exponential Moving Average (EMA) like the standard TRIX. The Detrended Price is used to identify short term cycles with a rate of change verses the rate of change from a triple smoothed TRAX VWMA . The strategy is intended for counter-trend trading, meaning it tries to capture potential reversals.
1. Indicators Used:
TRAX is calculated using the Volume Weighted Moving Average (VWMA) of the logarithm of the closing price.
DPO (Detrended Price Oscillator) is calculated by taking the closing price and subtracting a simple moving average (SMA) of the closing price shifted back.
2. Crossover Conditions:
Longs occur when DPO crosses above the TRAX, with the TRAX trending below 0, and the stock is trading above an adjustable simple moving average. Shorts occur due to the inverse conditions.
3. Visualization:
This script plots the SMA and the TRAX-DPO Combined Oscillator.
It highlights the periods of zero-line crossover using a green background for potential long positions and a red background for potential short positions. However, it will trigger verified entries/exits in accordance with the SMA.
In conclusion, this fun prototype underwent a unique alteration using the Volume Weighted Moving Average and focuses on capturing shorter counter-trend cycles. You have the freedom to fine-tune the strategy by adjusting parameters and incorporating other analysis methods that resonate with your trading style and risk tolerance.
Detrended_price_oscillator
+ Detrended Price OscillatorAccording to TradingView the Detrended Price Oscillator is an oscillator that removes trend from price in order to more clearly show an instrument's cyclical
highs and lows so that an investor or trader may more easily time when to buy or sell the underlying instrument. Accordingly, it is not meant to be used as a way of gauging momentum, however, I find it perfectly suitable for the task (at least when used "un-centered" which is how it comes by default here). If you wish to read up more on the DPO just search for it under indicators. It's built in, so you'll find all the information you need on it there. Or check investopedia.
On to the good stuff. What have I done and how does this work?
As un-centered you can use it just like any other momentum oscillator. Price above the zero line is bullish and below is bearish, generally speaking.
I've added two moving averages that you can turn on or off, and choose amongst various types and lengths. Both of these are colored based on trend.
The DPO is also colored based on trend, with a neutral color based on where the DPO is relative to the primary MA and the zero line.
Candles are colored in the same way that the DPO is.
I've added Bollinger Bands because they could be useful on an indicator like this.
All the alert conditions you could dream of.
With this set to centered you will notice that the DPO is not inline with current price. That is intentional, as it's only designed to look at historical price
data to time highs and lows of price movement. As such, I don't recommend using this when set to centered, at least if you're trading crypto. The price volatility
perhaps makes for inconsistent timing of cyclical highs and lows, or perhaps it's the rather brief amount of time cryptocurrencies have been in existence.
I do not know. Just stick to using it un-centered.
The above image shows the indicator with Bollinger Bands turned on and the MA's turned off. Also, you should note that the candle color and DPO color is based on the primary moving average you are using. If you want consistency, and want to use the Bollinger Bands, then keep your primary moving average set as a 20 SMA, as that is the basis for Bollinger Bands.
Hope this is helpful to you. Definitely pair it with an additional indicator like an RSI, or my +ADP. I like to use something rangebound to compare its signals to.