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

Re: [amibroker] Coding Problem, can someone find my mistake?



PureBytes Links

Trading Reference Links

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I shouldn't follow up to my own post, but a tidy up and generalisation gives

- --8<-- put this in your library.afl

function FisherTransform(price, period) 
{
	// The Fisher Transform changes the PDF of any waveform so that 
	// the transformed output has an approximately Gaussian PDF.  

	// See 'Using The Fisher Transform' by John Ehlers in the Nov 2002 
	// issue of Stocks and Commodities Magazine. 

	local Maxh, Minl;
	local tmp;

	Maxh = HHV(price, period);
	Minl = LLV(price, period);

	tmp = AMA2(2*((price-minl)/(maxh-minl)-0.5), 0.33, 0.67);
	tmp = IIf(tmp >  0.99,  0.999, tmp);
	tmp = IIf(tmp < -0.99, -0.999, tmp);

	return AMA2(log((1+tmp2)/(1-tmp2)), 0.5, 0.5);
}
- --8<--



- --8<--
/* ib
Fisher Transform with Signal.afl
*/

#include <lib/Libnr.afl>

fish = FisherTransform((H+L)/2, 10);

Plot(fish, "Fisher", colorRed);
Plot(Ref(fish,-1), "Signal", colorBlue);

//--Indicator-End-- 

//http://www.linnsoft.com/tour/techind/fish.htm
"Fisher Transform (FISH) is based on the article 'Using The Fisher Transform'"
+" by John Ehlers in the November 2002 issue of Stocks and Commodities 
Magazine. "
+" FISH has sharp and distinct turning points that occur in a timely fashion. 
"
+" It is based on the assumption that prices do not have a Gaussian 
probability"
+" density function (PDF), but you can create a nearly Gaussian PDF for prices 
by"
+" normalizing price, or an indicator such as RSI, and applying the Fisher 
Transform. "
+" The resulting peak swings clearly identify price reversals.";
- --8<--


- --8<--
/* ib
Fisher Transform with ROC.afl
*/

#include <lib/Libnr.afl>

fish = FisherTransform((H+L)/2, 10);

Plot(fish, "Fisher", colorRed);
Plot(10*(fish-Ref(fish,-1)), "ROC (x10)", colorBlue);
- --8<--


	Cheers,
		Nigel

On Tue, 10 Feb 2004 21:05, Nigel Rowe wrote:
> Are these sufficient?  Straight translation from
> http://trader.online.pl/MSZ/e-w-Fisher_Transform.html
>
> It really doesn't take much effort to translate MS code.
>
. . . . snip . . . .
>
>
> 	Cheers,
> 		Nigel
>
> On Tue, 10 Feb 2004 20:37, Johan wrote:
> > Someone who has and donīt mind sharing John Ehlers Fisher transform
> > formula?
> >
> > Itīs both Fisher transform + Roc of the transform.
> >
> > Thank you
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAKLngBbmcM2pfckkRAic1AKDKY2EVwqUL2Wy4AxZxrpIZzhgSjwCdE0o9
pjpE02+MLvo5E7uvg1DfUrw=
=c2OC
-----END PGP SIGNATURE-----



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/