Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (monk12, Quad), 830 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Beginners Workshop #477602
07/13/19 22:39
07/13/19 22:39
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
I thinking of some simple workshop to extend the workshops included in Zorro.

Well, I really want to learn it myself.

Therefore, I ask for your support.

I create a function for calculating WCL (I know it is included, but to learn it helps I guess, cause it's simple calculation).

function wcl()
{
vars c = series(priceClose());
vars l = series(priceLow());
vars h = series(priceHigh());
vars x = 1;
}


Now, however I want to make the calculation of WCL
https://www.tradesignalonline.com/lexicon/view.aspx?id=Weighted+Close+(WCL)

I get some syntax error: wrong type: e.g. DIV:POINTER:POINTER:POINTER.

So maybe someone could show me the way.

Re: Beginners Workshop [Re: danatrader] #477604
07/14/19 15:33
07/14/19 15:33
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
...from head

Code

var wcl(const int g=1){

   var w=(priceHigh()+priceLow()+g*priceClose())/(2*g);
   return w;
}

//use:

vars wclS=series(wcl(1));



Last edited by Grat; 07/14/19 15:35.
Re: Beginners Workshop [Re: danatrader] #477607
07/15/19 06:29
07/15/19 06:29
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
An indicator workshop is a good idea.

Re: Beginners Workshop [Re: danatrader] #477664
07/20/19 07:11
07/20/19 07:11
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
To rephrase, I am a beginner, but I am willing to work hard, so if anyone helps, I will document my learning and compile the process, making Zorro accessible to medium skilled people that just won't give up.

Last edited by danatrader; 07/20/19 07:27.
Re: Beginners Workshop [Re: danatrader] #477665
07/20/19 07:54
07/20/19 07:54
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
So I got something, and I will anyway never use the answers given, otherwise learning effect would be zero, I got soemthing that compiles.
I have no idea if it is correecxt, but it compiles.

function wcl()
{

var weight = 1;
var high = priceHigh();
var low = priceLow();
var close = priceClose();

var calc = high+low+weight*close/(2+weight);
return calc;

vars wclS=series(wcl());

}

Now I want to call the function to visualise what it may or may not calculate.
The function is embedded in Workshop7.

Within the main run() I have

wcl();
plot("WCL",wcl(),0,BLUE);

How would I correctly plot the bars showing the WCL like shown here?
https://zorro-project.com/manual/en/plot.htm

Re: Beginners Workshop [Re: danatrader] #477678
07/21/19 15:10
07/21/19 15:10
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Hi,

in your code is bug:

function wcl()
{

var weight = 1;
var high = priceHigh();
var low = priceLow();
var close = priceClose();

var calc = high+low+weight*close/(2+weight);
return calc; <--- return var calc

vars wclS=series(wcl()); <- this never going - is after return, this must by in FCE run()

}

your question:
in the FCE run:

set(PLOTNOW);
vars wclS=series(wcl());
..
plot("WCL indi ", wclS, NEW+LINE, BLUE);

or in main window
plot("WCL indi ", wclS, MAIN+LINE, BLUE);


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1