logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
manatrader  
#1 Posted : Friday, April 17, 2009 12:48:52 AM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

Hey now, trying to make a custom indicator for fisher transform, to be able to make strategies like

FT(5)>FT(15)>REF(FT(10),-1)

This would be preferable to writing

FML(FT(5))>FML(FT(15)) etc

But I am at a loss as to how to make either happen, I can insert the FT formula below in a new indicator, but I'm unsure how to indicate a period, the manual seems to say only a default value will be used in a strategy, and doesn't say what to put where, d'oh!

{len} input("insert period",1,1000,10);
pr:=(H+L)/2;
maxh:=HHV(high,len);
minl:=LLV(low,len);
val1:=.33*2*((pr-minl)/(maxh-minl)-.5)+.67*prev;
val2:=If(val1>.99,.999,If(val1<-.99,-.999,val1));
FT:=.5*Log((1+val2)/(1-val2))+.5*prev;


wabbit  
#2 Posted : Friday, April 17, 2009 1:56:37 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Before using the fisher transform, I'd do some more research into what it actually does. It is not intended to be used in the manner in which seems commonly employed, including the code you intend to use.

See: http://forum.equis.com/forums/thread/29316.aspx
manatrader  
#3 Posted : Friday, April 17, 2009 7:21:12 AM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

Yes, thanks. I plan to play around with it and see if I can get anything out of it, to use with other functions. The log function can be helpful to remove noise, I think more so than longer term lagging indicators. Whaddya think about the rest, the manual isn't very specific //
wabbit  
#4 Posted : Saturday, April 18, 2009 1:46:56 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Mathematical functions have a variety of uses; it just depends on the user employing them honestly!

To answer the first problem in the thread: You can either write a new indicator function for each variable value and then call these values using the Fml() function, but this is slower than the solution I propose below:

Code:

prd1:=input("period1",1,1000,5);

prd2:=input("period2",1,1000,10);

prd3:=input("period3",1,1000,15);


pr:=(H+L)/2;

{first pass with prd1}
maxh:=HHV(high,prd1); 
minl:=LLV(low,prd1); 
{val1:=.33*2*((pr-minl)/(maxh-minl)-.5)+.67*prev; }
val1:=Mov(2*((pr-minl)/(maxh-minl)-.5),5,E);
val2:=If(val1>.99,.999,If(val1<-.99,-.999,val1)); 
{FT:=.5*Log((1+val2)/(1-val2))+.5*prev; }


FT1:=mov(Log((1+val2)/(1-val2)),3,e);



{2nd pass with prd2}

maxh:=HHV(high,prd2); 

minl:=LLV(low,prd2); 

val1:=Mov(2*((pr-minl)/(maxh-minl)-.5),5,E);
val2:=If(val1>.99,.999,If(val1<-.99,-.999,val1)); 

FT2:=mov(Log((1+val2)/(1-val2)),3,e);




{final pass with prd3}

maxh:=HHV(high,prd3); 

minl:=LLV(low,prd3); 

val1:=Mov(2*((pr-minl)/(maxh-minl)-.5),5,E);
val2:=If(val1>.99,.999,If(val1<-.99,-.999,val1)); 

FT3:=mov(Log((1+val2)/(1-val2)),3,e);




{binary signal}
FT1>FT3 AND FT3>Ref(FT2,-1);


Notes:
* This still isn't what the fisher transofm is designed to do, so this is better named in some way associated with its originator, John Ehlers.
* The code has improved performance by removing one PREV and replacing it with its equivalent computation i.e. the 3 period EMA. The val1 variables could be substitued with an EMA if you desired, but it would slightly change the outcome of the indicator (test for yourself).
* Reusing the variables saves us from exceeding the 20 variable limit.
* Containing the code inside one indicator is faster than making three Fml() calls.


Hope this helps.

wabbit [:D]

P.S. I am rewriting some codes I did some time ago when gruv asked some questions on Ehler's Fisher Transform. I will write another post at some time (maybe, certainly no promises on my time) to demonstrate what the Ehler was talking about when he wrote about the Fisher Transform and pre-conditioning data to display Gaussian (normal) PDF.

manatrader  
#5 Posted : Saturday, April 18, 2009 4:57:27 AM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

Wow, nice, thanks, it has been extremely slow to use. :)
wabbit  
#6 Posted : Wednesday, April 22, 2009 8:08:00 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Missed one: replace all the val1 lines with their PREV-less EMA version :-

Code:
val1:=Mov(2*((pr-minl)/(maxh-minl)-.5),5,E);





wabbit [:D]



Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.