Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, TraderTom, Akow), 1,388 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Gaussian MACD [Re: jcl] #417490
02/13/13 11:22
02/13/13 11:22
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
mas is series so I just typed[0].

Re: Gaussian MACD [Re: SFF] #417499
02/13/13 11:58
02/13/13 11:58
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
But your function, as you defined it, expects a series and not a var.

Re: Gaussian MACD [Re: jcl] #417508
02/13/13 12:59
02/13/13 12:59
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
I modified the code like this.

vars ma = series(GSMOOTH(Close[0],ma[0],Slowalfa));
vars maf=series(GSMOOTH(Close[0],maf[0],Fastalfa));

But it says this.
'ma' undeclared identifier

Why this occur? I defined a type of vars before ma.


Last edited by SFF; 02/13/13 12:59.
Re: Gaussian MACD [Re: SFF] #417517
02/13/13 14:09
02/13/13 14:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Look at that line: you define ma using the return of a function that already needs ma. This can obviously not work. You must fill a series with some content before you can use it.

Aside from that, may I ask how your code is supposed to work? Even if you fix all the typing mistakes - there are a lot more - the script still makes not much sense to me. How and when do you want to enter a trade?

Re: Gaussian MACD [Re: jcl] #417563
02/13/13 22:18
02/13/13 22:18
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
To fill series before using it, is this code right?

vars ma = series(0)

I trade just buy when the line is bule or the reverse.

Re: Gaussian MACD [Re: SFF] #417583
02/14/13 08:20
02/14/13 08:20
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The code is right, but then the series is just filled with 0, which is probably not what you need.

Re: Gaussian MACD [Re: jcl] #417584
02/14/13 08:32
02/14/13 08:32
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
So I think I wrote the right code in the first post but you said it is wrong?

vars mas = series();
vars maf = series();

By writing this, everytime the bar is updated, mas and maf stored the latest value?

I want the latest value stores the last series.

Update:

This looks fine.

vars ma = series();
ma = series(GSMOOTH(Close[0],ma[0],Slowalfa[0]));
vars maf = series();
maf=series(GSMOOTH(Close[0],maf[0],Fastalfa[0]));

But again same one.
Where missing pointer?

'GSMOOTH' : Pointer expected
< ma = series(GSMOOTH(Close[0],ma[0],Slowalfa[0]));

Last edited by SFF; 02/14/13 08:47.
Re: Gaussian MACD [Re: SFF] #417593
02/14/13 10:46
02/14/13 10:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The mas/maf definition is correct syntax-wise, it just makes no sense logic-wise, as the series contain nothing.

I have explained the missing pointer error already above. Your function expects a series for the second parameters, not a var.

Re: Gaussian MACD [Re: jcl] #417601
02/14/13 11:50
02/14/13 11:50
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
var GSMOOTH(var price_,vars arr,var alfa)

The second parameter is series. right?

So The caller passes series ma[0].

I tried this new code but it is still wrong.

ma = series(GSMOOTH(Close[0],series(ma),Slowalfa[0]));

Last edited by SFF; 02/14/13 11:53.
Re: Gaussian MACD [Re: SFF] #417607
02/14/13 13:10
02/14/13 13:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You now managed to pass not a series, but a series of series, if such an object existed.

How do you pass a series to a function?

Have you done the workshops? Series are used in workshop 4.

Page 2 of 3 1 2 3

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