Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 735 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
FisherN #487412
04/11/23 08:36
04/11/23 08:36
Joined: Apr 2023
Posts: 15
R
rki Offline OP
Newbie
rki  Offline OP
Newbie
R

Joined: Apr 2023
Posts: 15
Here is my Python implementaton of FisherN

def FisherN (Data, Len):
out=np.ones (len(Data))*Data
Value1=0
Fish=0
for i in range (len(out)):
Period = i+Len
Period = Period if Period < len(out) else len(out)
MaxH=max (Data[i:i+Len])
MinL=min (Data[i:i+Len])
if MaxH>MinL:
fish=2.0*(Data[i]-MinL)/(MaxH-MinL)-1
else:
fish=0
Value1=0.33*2*(fish-0.5)+0.67*Value1
if Value1 > 0.999:
Value1=0.999
if Value1 <-0.999:
Value1=-0.999
Fish=0.5*Fish+0.5*np.log((1+Value1)/(1-Value1))
out[i]=Fish
return out


This was the corresponding implementation in Zorro

// normalize a value to the -1..+1 range
var Normalize(var* Data,int Period)
{
Period = Max(2,Period);
var vMin = MinVal(Data,Period);
var vMax = MaxVal(Data,Period);
if(vMax>vMin)
return 2.*(*Data-vMin)/(vMax-vMin) - 1.;
else return 0.;
}

// Fisher Transform
var Fisher(var* Data)
{
var v = Clamp(Data[0],-0.998,0.998);
return 0.5*log((1.+v)/(1.-v));
}

// Normalized Fisher transform
var FisherN(var* Data,int Period)
{
var *Value = series(*Data,2), *FN = series(*Data,2);
Value[0] = 0.33*Normalize(Data,Period) + 0.67*Value[1];
return FN[0] = Fisher(Value) + 0.5*FN[1];
}

Re: FisherN [Re: rki] #487413
04/11/23 08:38
04/11/23 08:38
Joined: Apr 2023
Posts: 15
R
rki Offline OP
Newbie
rki  Offline OP
Newbie
R

Joined: Apr 2023
Posts: 15
My questions are:
1. Do you agree that the implementation is right as Zorro/meaning same as Zorro
2.
Why do we normalize as 2*(x-xmin)/(xmax-xmin)-1 instead of just (x-xmean)/sigma . I see that the results vary due to this.

Last edited by rki; 04/11/23 08:41.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1