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
3 registered members (7th_zorro, AndrewAMD, TedMar), 837 guests, and 2 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
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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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