Combo Backtest 123 Reversal & Recursive Moving Trend Average This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Taken from an article "The Yen Recused" in the December 1998 issue of TASC,
written by Dennis Meyers. He describes the Recursive MA in mathematical terms
as "recursive polynomial fit, a technique that uses a small number of past values
of the estimated price and today's price to predict tomorrows price."
Red bars color - short position. Green is long.
WARNING:
- For purpose educate only
- This script to change bars colors.
Recursion
Hybrid Convolution FilterIntroduction
Today i propose an hybrid filter that use a classical FIR architecture while using recursion. The proposed method aim to reduce the lag generated by fir filters. This particular filter is a sine weighted moving average, but you can change it since the indicator is built with the custom filter template (1). Even if it use recursion it still is a FIR filter since the impulse response is finite.
The Indicator
In red the hybrid swma and in blue the classic swma of both the same period. The difference can be seen.
The switch between the input price and the past values of the previous convolution values is made by using exponential averaging, the window function is the same as f(x) in the code.
Any filter can use this architecture, the indicator is built around the custom fir template, see (1)
Conclusion
I presented a FIR filter using recursion in its calculation, the integration is made with respect to the proposed template, therefore any user can simply modify f(x) to have different filter without the need to make any change. However curious users might want to change the window function of the exponential averager, in order to do so change sgn = f(i/length) in line 11 for sgn = fun(i/length) where fun is your custom function, make sure to add it at the start of the script where all the other functions declarations are.
Thanks for reading !
(1)
Simple CycleIntroduction
A simple and really clean cycle oscillator, in fact its quite precise even if the script use recursion which can sometime produce totally uncorrelated results.
On The Code
The calculations start with a who is a smoothing/averaging constant. Then comes src who is the input and is defined as the sum of the closing price with the output, then the output is high-pass filtered in b , after that the output is just the weighted average of the input change with b .
All those recursions and detrending steps make the indicator able to highlights cycles.
Recursive DifferenciatorIntroduction
Cycles can be spotted by using a wide range of methods, most of them will involve bandpass filtering, here i will show a method using recursion with the change() function.
The Indicator
As i explained in other indicators using recursion i posted rescaling the input is important, i will use the rsi of an exponential moving average as input. alpha control the amount of output the indicator will use as input, values closer to 0.5 will use more input resulting in more periodic results.
Lowering alpha when length is higher can help get more periodic results.
Conclusion
I have showed a new cycle indicator using recursion. Recursion with oscillators can highlights cycles in price thus being easier to predict.
Thanks for reading !
Recursive RsiIntroduction
I have already posted a classic indicator using recursion, it was the stochastic oscillator and recursion helped to get a more predictive and smooth result. Here i will do the same thing with the rsi oscillator but with a different approach. As reminder when using recursion you just use a fraction of the output of a function as input of the same function, i say a fraction because if you feedback the entire output you will just have a periodic function, this is why you average the output with the input.
The Indicator
The indicator will use 50% of the output and 50% of the input, remember that when using feedback always rescale your input, else the effect might be different depending on the market you are in. You can interpret the indicator like a normal rsi except if you plan to use the 80/20 level, depending on length the scale might change, if you need a fixed scale you can always rescale b by using an rsi or stochastic oscillator.
Conclusion
I have presented an rsi oscillator using a different type of recursion structure than the recursive stochastic i posted in the past, the result might be more predictive than the original rsi. Hope you like it and thanks for reading !
Ratio OCHL Averager - An Alternative to VWAPIntroduction
I had the idea to make this indicator thanks to @dpanday with the support of @Coppermine and @Reika. Vwap is a non parametric indicator based on volume used by lot of traders and institutions, its non parametric particularity makes it great because it don't need to go through parameter optimization. Today i present a similar indicator called Ratio OCHL Averager based on exponential averaging by using the ratio of open-close to high-low range by using monthly high/low.
The Indicator
The indicator can more recursive by checking the "recursive" option, this allow to use the indicator output instead of the open price for the calculation of the ratio of open-close to high-low range. The result is a more reactive estimation,
The indicator reactivity change based on the time frame you are in, using higher time frame result in a more reactive indicator, however it is way less reactive than the vwap, this is a personal choice since i wanted this indicator to be smooth even with high time frames, if you want to change that you use another resolution for H and L in line 5,6.
Conclusion
I presented an alternative to vwap based on the Ratio OCHL indicator. I hope you like it and thanks for reading !
Thanks to Coppermine and Reika for the support during the creation of the indicator