Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 972 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
HighPass #480909
07/23/20 08:11
07/23/20 08:11
Joined: May 2018
Posts: 21
Y
YG8 Offline OP
Newbie
YG8  Offline OP
Newbie
Y

Joined: May 2018
Posts: 21
Tried to copy paste the script from the indicators file

{
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];
if(!CutoffPeriod) CutoffPeriod = 48;
var a = (0.707*2*PI)/CutoffPeriod;
var alpha1 = 1.+(sin(a)-1.)/cos(a);
var b = 1.-alpha1/2.;
var c = 1.-alpha1;

var* HP = series(0,3);
SETSERIES(Data,0);
return HP[0] = b*b*(Data[0]-2*Data[1]+Data[2])
+2*c*HP[1]
-c*c*HP[2];
}

But i get following message

Zorro HighPass -stay


HighPass compiling......
Error in 'line 3:
'alpha1' undeclared identifier
< alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
>.

HighPass compiling.......
Error in 'line 5:
'alpha1' undeclared identifier
< alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
>.


How do i make the alpha1 declared?

Re: HighPass [Re: YG8] #480910
07/23/20 18:57
07/23/20 18:57
Joined: Aug 2013
Posts: 8
California
R
ron17 Offline
Newbie
ron17  Offline
Newbie
R

Joined: Aug 2013
Posts: 8
California
Your code has other syntax issues too, like Close, etc.
Can you share the entire script ?.

Re: HighPass [Re: YG8] #480916
07/24/20 08:03
07/24/20 08:03
Joined: Jun 2019
Posts: 24
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 24
You can't just copy code out of context and run it especially indicator code.

You need to use the functions in Zorro which relate to the indicator code. What you are using seems to be a filter:
https://manual.zorro-project.com/filter.htm
https://manual.zorro-project.com/tutorial_lowpass.htm


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1