Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (rki, Ayumi), 475 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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