Mel![]() Veteran ![]() ![]() ![]() Posts: 235 Joined: 3/18/2006 ![]() | Here is what I think is a better way of using the RSI. The attached code is an RSI built on Ehlers filters, and it is predictive. The threshold lines on an RSI say .3, determine when in a cycle a signal is generated. the old way generated a laging signal when the RSI came up through the lower threshold. Ehlers predictive way is to generate a signal when the RSI first goes below the lower threshold, a few bars ahead of the turn. The RSIx is that predictive crossing on a traditional RSI, not an Ehlers RSI. An RSI period needs to be 1/2 the wavelength of the cycle you are trading (all oscillators are trading cycles and you need to know what they are, normally it is the dominant cycle.) My convention is to use domcyc as the period, and divide it by two in the code for RSI. Since some oscillators like MACD and CCI use the full domcyc as their parameter, it saves me confusion. This code allows you to set the floor and ceiling wavelength in bars of the cycles you want to trade in the chart, eliminating the jagged noise generated by short wavelengths, and the trend drag of longer wavelengths. Better signals that way. If you select turns, you get signals on turns in the OBOS range. If you select predict, it generates signals from threshold crossings ThresholdPredict=0 generates signals the old lagging late cross, =1 generates predictive signals. This form of RSI is the most accurate I know of. You need some way of knowing what the dominant cycle is. I use the Spectrum indicator, and using that indicator, you can write code that adapts to the cycle length. What happens if you use an oscillator and it is not tuned to the dominant cycle? It produces unreliable leading or lagging signals. It is the case that there is no one period that is best in an oscillator - it needs to be set to whatever the current cycle is on the current symbol. Set the floor and ceiling to bound the cycle lengths you are interested 1n. It is not really practical to cycle trade wavelengths less than 10 bars. so set you floor to 10, set the ceiling to 40 or 50 for most trading. A monthly cycle is 20-22 bars. For longer term trades, you can up those numbers. Mel [Edited by Mel on 1/13/2019 12:28 PM] ![]() ![]() |