[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: re:Ehlers Modified Optimal Elliptal filter (Fisher Transform)



PureBytes Links

Trading Reference Links

Here is something I coded a while ago. This can be done with loops in AFL now. If it works let me know, how you use it.
Goodluck
Mohan
/*
---------- Ehlers Elliptical filter -----------------
---- Original Easy Language code ---------------
Inputs: Price((H+L)/2);
Vars: Detrend(0);
Value1 = Price + .088*Value1[6];
Value2 = Value1 - Value1[6] + 1.2*Value2[6] - .7*Value2[12];
Detrend = Value2[12] - 2*Value2[6] + Value2;
Plot1(Detrend, "Detrend");
The EasyLanguage code to compute the optimum elliptic filter is:
Smooth = 0.13785*Price + 0.0007*Price[1] + 0.13785*Price[2] +
1.2103*Smooth[1] - 0.4867*Smooth[2];
These values are taken as examples from Merrill Skolnik's Radar Handbook.
I know I can reduce the effects of lag by computing the prediction of a
one-bar momentum for each trading position I hold. In this case, I simply
added the one-day momentum of the price to the price value for that bar.
Doing this, the modified optimum elliptic filter becomes:
Smooth = 0.13785*(2*Price - Price[1]) + 0.0007*(2*Price[1] - Price[2]) +
0.13785*(2*Price[2] -Price[3]) + 1.2103*Smooth[1] - 0.4867*Smooth[2];
*/
EnableScript("VBScript");

Price = (H+L)/2;
Smooth = ( 4 * Price + 3 * Ref( Price,-1) + 2 * Ref(Price,-2) + Ref(Price,-3))/10;
<%
Price = AFL("Price")
Smooth = AFL("Smooth")
nSize = UBound( Smooth )
' every Other Variable is an array Of the same size as smooth
' so just make A copy (quick init) 
Detrend = Smooth
value1 = Smooth
value2 = Smooth
ellip1= Smooth
ellip2 = Smooth
Detellip1 = Smooth
Detellip2 = Smooth
for i = 12 To nSize 
value1(i) = Smooth(i) + 0.088 * value1(i-6)
value2(i) = Value1(i) - value1(i-6) + 1.2*value2(i-6) - 0.7*value2(i-12)
Detrend(i) = value2(i-12) - 2*value2(i-6) + value2(i)
ellip1(i) = 0.13785*Smooth(i) + 0.0007*Smooth(i-1) + 0.13785*Smooth(i-2) _
+ 1.2103*ellip1(i-1) - 0.4867*ellip1(i-2)
ellip2(i) = 0.13785*(2*Smooth(i) - Smooth(i-1) ) + 0.0007*(2*Smooth(i-1) - Smooth(i-2))_
+ 0.13785*(2*Smooth(i-2) - Smooth(i-3)) + 1.2103*ellip2(i-1) - 0.4867*ellip2(i-2)
Detellip1(i) = 0.13785*Detrend(i) + 0.0007*Detrend(i-1) + 0.13785*Detrend(i-2) _
+ 1.2103*Detellip1(i-1) - 0.4867*Detellip1(i-2)
Detellip2(i) = 0.13785*Detellip1(i) + 0.0007*Detellip1(i-1) + 0.13785*Detellip1(i-2) _
+ 1.2103*Detellip2(i-1) - 0.4867*Detellip2(i-2)
Next
AFL("value1") = value1
AFL("value2") = value2
AFL("Detrend") = Detrend
AFL("ellip1") = ellip1
AFL("ellip2") = ellip2
AFL("Detellip1") = Detellip1
AFL("Detellip2") = Detellip2
%>
Plot(Detrend,"Detrend",4,4);
Plot(Detellip1,"Detellip1",1,4);
Plot(Detellip2,"Detellip2",6,4);
//Plot(ellip1,"ellip1",4,4);
//Plot(C,"c",1,64);
//Plot(ellip2,"ellip2",2,4);

-------------- Original message -------------- 

Hi Natasha,
Are you saying the Fisher Transform is the same as Ehlers MEF? I 
initially was looking at the Jurik MA and the MEF is quite close to 
the Jurik. The Jurik is a little smoother but not by a lot. I 
thought it would be interesting to compare the T3 and the MEF. I'm 
using the T3 for my papertrading and it seems pretty good. I was 
using an LRV but find the T3 better. If you should compare the 2 
indicators I would be interested in hearing your assessment of the 
results. Thank you.

Regards,

Tim





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


Yahoo! Groups Sponsor
ADVERTISEMENT






Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/

To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/