Hi,
John Ehlers (see: Rocket Science for Traders) introduced two indicators last year:
The recursive median filter (RMF) and the recursive median oscillator (RMO).
Is there anyone that can code these specifically as I am unable to progress with the Variables part of the conversion?
Thanks in advance,
Best
Bard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
//Recursive Median Filter (c) 2017 John F. Ehlers //Inputs: LPPeriod(12); //Vars: alpha1(0), RM(0); //Set EMA constant from LPPeriod input alpha1 = (Cos(360 / LPPeriod) + Sin(360 / LPPeriod) - 1) / Cos(360 / LPPeriod); //Recursive Median (EMA of a 5 bar Median filter) RM = alpha1*MedianPrice[5] + (1 - alpha1)*RM[1]; Return RM as "Recursive Median Filter" -------------------------------------------------------- //Recursive Median Oscillator (c) 2017 John F. Ehlers} //Inputs: LPPeriod(12), HPPeriod(30); //Vars: alpha1(0), alpha2(0), RM(0), RMO(0); //Set EMA constant from LPPeriod input alpha1 = (Cos(360 / LPPeriod) + Sin(360 / LPPeriod) - 1) / Cos(360 / LPPeriod); //Recursive Median (EMA of a 5 bar Median filter) RM = alpha1*MedianPrice[5] + (1 - alpha1)*RM[1]; //Highpass filter cyclic components whose periods are shorter than HPPeriod to //make an oscillator Alpha2 = (Cos(.707*360 / HPPeriod) + Sin(.707*360 / HPPeriod) - 1) / Cos(.707*360 / HPPeriod); RMO = (1 – alpha2 / 2)*(1 – alpha2 / 2)*(RM - 2*RM[1] + RM[2]) + 2*(1 – alpha2)*RMO[1] - (1 – alpha2)*(1 – alpha2)*RMO[2]; Return RMO as "Recursive Median Oscillator" Return 0, as "Zero line" |
There are some promising backtests based on these indicators her midway down the page. Pls see screenshot: http://traders.com/Documentation/FEEDbk_docs/2018/03/TradersTips.html