Anyone using information or codes on these pages does so at their own risk - no guarantees of stability or profitability are claimed. These codes are all for testing purposes only.
//// Ehlers Fisher Cyber Cycle - coded by dn
//// From Cybernetic Analysis for Stocks and Futures
Inputs: Price((H+L)/2),
alpha(.07),
Len(8);
Vars: Smooth(0),
Cycle(0),
MaxCycle(0),
MinCycle(0),
Lead(0);
Smooth = (Price + 2*Price[1] + 2*Price[2] + Price[3])/6;
Cycle=(1-.5*alpha)*(1-.5*alpha)*(Smooth-2*Smooth[1]+Smooth[2])+2*(1-alpha)*Cycle[1]-(1-alpha)*(1-alpha)*Cycle[2];
If currentBar <7 then Cycle=(Price-2*Price[1]+Price[2])/4;
MaxCycle = Highest(Cycle,Len);
MinCycle = Lowest(Cycle,Len);
If MaxCycle <> MinCycle then Value1=(Cycle-MinCycle)/(MaxCycle-MinCycle);
Value2 = (4*Value1+3*Value1[1]+2*Value1[2]+Value1[3])/10;
Value3 = .5*Log((1+1.98*(Value2-.5))/(1-1.98*(Value2-.5)));
Plot1 (Value3,"Cycle");
Plot2 (Value3[1],"Trigger");
Plot3 (0,"Ref");
{Fisher Cyber Cycle coded by mmillar, July 2004
From the book 'Cybernetic Analysis for Stocks and Futures' by John Ehlers
Price - price input such as (H+L)/2 or Close
CCLength - used by the Fisher Cyber Cycle calculation,
John Ehlers uses alpha but I have replaced it with the more intuitive Length, where alpha=2/(Length+1)
FisherLength - used by the Fisher transform calculation
//This uses the function _Oscillators coded by mmillar
}{
Inputs: Price((H+L)/2), CCLength(14), FisherLength(8);
Vars: oResult1(0), oResult2(0);
value1=_Oscillators(8, Price, CCLength, FisherLength, 1, 0, 1, oResult1, oResult2);
Plot1(oResult1, "FisherCyber");
Plot2(oResult2, "Trigger");
}