'**************************************************************
'*   Inverse Fisher Transform
'*     by Jeremy Williams
'*	   February 21,2006
'*
'*	Adapted from Technical Analysis of Stocks and Commodities
'*    May 2004
'*
'*  Summary: 
'*
'*		This indicator modifies the information sent from other indicators
'*  to provide clearer signals. For more information see "The Inverse 
'*  Fisher Transform" in the May 2004 edition of Technical Analysis
'*  of Stocks and Commodities
'*
'*  Parameters:
'*
'*      None
'*
'**************************************************************
#Indicator

Dim InputValue	 	As Single
Dim OutputValue 	As Single
Dim Numerator 		As Single
Dim Denominator		As Single

' Determine which indicator to use as input
InputValue = RSI(14)         

' Any Indicator can be used, but you must first roughly normalize to the range
' -5 to 5. 

'Normalize the RSI to the proper Range. RSI is falls naturally between 0 and 100.
InputValue = InputValue - 50      ' Sets center of Inputs Range to zero, now Input Value
								  ' varies between -50 and 50.
								
InputValue = InputValue / 10      ' Normalizes the Magnitude of the input to fall between -5 and 5

'Calculate the Inverse Fisher Transform using the formula:
'            z = (e^(2*input)-1)/(e^(2*input) + 1)

Numerator = EXP(2*InputValue)-1
Denominator = EXP(2*InputValue)+1
OutputValue = Numerator / Denominator

SetScales(-1,1)						' Plot the Ouptut of the Inverse Fisher
Plot("IFisher", OutputValue)		' Output will fall between -1 and 1

Return OutputValue     ' Return the value calculated by the indicator