Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 1,012 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Make a Williams %R series #458545
03/19/16 06:24
03/19/16 06:24
Joined: Dec 2014
Posts: 202
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 202
Germany
Im confused about the handling of the WillR indicator. I successfully used the rising/falling function with Bollinger Bands, but I don't find my syntax error in here:


vars WillR = series(); //I'm trying to make WillR a series. Didn't work with "rising WillR(240)" either.
var UpperZone = optimize (8,0,20,1);
var LowerZone = optimize (8,0,20,1);

if(NumOpenLong+NumOpenShort < 2){
if rising(WillR(240)) and if (WillR(240)>(0-UpperZone)) // <-first syntax error
enterShort();
else if falling (WillR(240)) and if (WillR(240)<(-100+LowerZone))
enterLong();

What am I doing wrong here???

Re: Make a Williams %R series [Re: Smon] #458548
03/19/16 14:33
03/19/16 14:33
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Quote:
if rising(WillR(240)) and if (WillR(240)>(0-UpperZone))

if(rising(series(WillR(240))) and WillR(240)>(0-UpperZone))

at least it's the right syntax. Take care of 'if conditions' -> manual and the nature of series.

Re: Make a Williams %R series [Re: Sphin] #458549
03/19/16 16:48
03/19/16 16:48
Joined: Dec 2014
Posts: 202
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 202
Germany
Thanks, even if it wasn't the solution (I got Error 041: Inconsistent series), I was able to solve the problem. The series must be defined outside the if function:

vars WPR = series(WillR(240));
...
if(rising(WPR) and WillR(240)>(0-UpperZone))


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1