Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Pointer expected #462411
09/28/16 12:30
09/28/16 12:30
Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
E
edilsonfsantos Offline OP
Guest
edilsonfsantos  Offline OP
Guest
E

Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
Hi all,
I am trying the following code:

//---------------------------------------------
#include <profile.c>

function run()
{
BarPeriod = 40; // 6 hour bars
//settings parameters and indicators

var* Price = series(price());
int emaper = optimize(9, 14, 21);
int xatr = 1;
int numatr = 3;
int numback = optimize(5, 2, 6);
//weigth indicator by volatility
vars TrendLine = ((EMA(Price[0],emaper) / EMA(Price[numback],emaper)) - 1) / xatr * ATR(numatr);

//-----------------------------------------------------

But when I go "test" in Zorro appear this error.


Zorro 1.50.6 Trading Automaton
Made with Gamestudio by oP group 2015


TFscript compiling.........
Error in 'line 17:

EMA(): Pointer expected
< vars TrendLine = ((EMA(Price[0],emaper) / EMA(Price[numback],emaper)) - 1) / xatr * ATR(numatr);
>.

Someone can help me?

Best
Edilson

Re: Pointer expected [Re: edilsonfsantos] #462412
09/28/16 12:39
09/28/16 12:39
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Moved this to zorro.
greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Pointer expected [Re: rayp] #462414
09/28/16 13:11
09/28/16 13:11
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Not sure, but try to change price[0] in price. Ema need a serie to be calculated.

Ciao

Re: Pointer expected [Re: rayp] #462422
09/28/16 23:08
09/28/16 23:08
Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
E
edilsonfsantos Offline OP
Guest
edilsonfsantos  Offline OP
Guest
E

Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
Originally Posted By: rayp
Moved this to zorro.
greets


I do not understand...
Here is "Starting with Zorro"?

Best
Edilson

Re: Pointer expected [Re: MatPed] #462423
09/28/16 23:15
09/28/16 23:15
Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
E
edilsonfsantos Offline OP
Guest
edilsonfsantos  Offline OP
Guest
E

Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
Originally Posted By: MatPed
Not sure, but try to change price[0] in price. Ema need a serie to be calculated.

Ciao


Ok. I re-code.
----------------------
function run()
{
BarPeriod = 40; // 6 hour bars
//settings parameters and indicators

var* Price = series(price());
int emaper = optimize(9, 14, 21);
int xatr = 1;
int numatr = 3;
int numback = optimize(5, 2, 6);
//weigth indicator by volatility
var EMA1 = EMA(Price, emaper);//EMA calculated with series()
vars TrendLine = ((EMA1[0] / EMA1[numback]) - 1) / (xatr * ATR(numatr));
---------------------------------------------------
Zorro 1.50.6 Trading Automaton
Made with Gamestudio by oP group 2015


TFscript compiling.........
Error in 'line 18:
subscript requires array or pointer type
< vars TrendLine = ((EMA1[0] / EMA1[numback]) - 1) / (xatr * ATR(numatr));
>.

Best
Edilson

Re: Pointer expected [Re: edilsonfsantos] #462426
09/29/16 07:30
09/29/16 07:30
Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
E
edilsonfsantos Offline OP
Guest
edilsonfsantos  Offline OP
Guest
E

Joined: Sep 2016
Posts: 4
Brazil, Rio de Janeiro
Hi.
I have the solution.
"Ema needs a serie() to be calculated".
Thanks
Edilson

Re: Pointer expected [Re: edilsonfsantos] #462427
09/29/16 08:40
09/29/16 08:40
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,

try change this:

var* Price = series(price());

to

vars Price = series(price());

Re: Pointer expected [Re: Grat] #462429
09/29/16 08:54
09/29/16 08:54
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
var* and vars is the same, but var and vars is not. Thus, "vars Trendline" is wrong.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1