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
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 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
Plot nothing #419104
03/06/13 11:47
03/06/13 11:47
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
While debugging, this simple code plots nothing and I don't know why.
Why this happens. It is complied.

Code:
int trendPeriod = 1;


function run(){
	
  set(TICKS);

 
 
 vars ma = series(EMA(priceClose(),trendPeriod));
 

 
plot("Signal", ma[0], 0, RED);


}


Last edited by SFF; 03/06/13 11:48.
Re: Plot nothing [Re: SFF] #419107
03/06/13 11:56
03/06/13 11:56
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
I think that does not even compile, due to the missing series in the EMA call.

Re: Plot nothing [Re: jcl] #419108
03/06/13 12:00
03/06/13 12:00
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
That is a newbie mistake.
Thank you.

Re: Plot nothing [Re: SFF] #419109
03/06/13 12:10
03/06/13 12:10
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
When I set trendPeriod = 1, It says below.

Error 011: Function EMA called with invalid data.

Why this considered invalid?

Re: Plot nothing [Re: SFF] #419116
03/06/13 14:07
03/06/13 14:07
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Because Zorro uses the ta-lib indicators that are very complaining when fed with bad data. trendPeriod = 1 is not really invalid, but makes no sense either, therefore the error message.

Re: Plot nothing [Re: jcl] #419338
03/09/13 05:18
03/09/13 05:18
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
This simple script only plots SMA, but don't enter although there is a clear signal on the chart.

Anything wrong?

Code:
int period=55;


function run(){

set(PLOTPRICE+PLOTNOW);
BarPeriod = 15;
LookBack = 500;
StartDate = 20121024;
NumDays = 55;

  set(TICKS);

TimeFrame = 1;
vars Close15 = series(priceClose());
vars tmp115 = series(SMA(Close15,period));


if(crossUnder(priceClose, tmp115))
enterShort();

plot("sma", tmp115[0], 0, RED);

}



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