Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 755 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error 042 with simple 2 algo strategy #443868
07/26/14 21:55
07/26/14 21:55
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
The following simple (and pointless) script results in this error message:
Error 042: EUR/AUD:B parameters not found!
or
Error 042: EUR/AUD:A parameters not found!
Code:
function run() {
  set(TESTNOW+PLOTNOW);
  set(PARAMETERS);
  NumYears = 1;
  LookBack = 334;
  asset("EUR/AUD");

  algo("A");
  var p1 = optimize(150, 1, 333, -33);
  algo("B");
  var p2 = optimize(150, 1, 333, -33);
}


Why? What am I missing?

Re: Error 042 with simple 2 algo strategy [Re: GPEngine] #443869
07/26/14 22:00
07/26/14 22:00
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
You might think it is because there are no trades in A and B. But the error also happens when I inject (random) trades.
Code:
function junk(var p1) {
  vars P = series(random());
  vars Osc = series(WMA(P, p1));
  if (valley(Osc)) {
    exitShort();
    enterLong();
  }
  if (peak(Osc)) {
    exitLong();
    enterShort();
  }
}

function run() {
  set(TESTNOW+PLOTNOW);
  set(PARAMETERS);
  NumYears = 1;
  LookBack = 334;
  asset("EUR/AUD");

  if (random() > 0) {
    algo("A");
    var p1 = optimize(150, 1, 333, -33);
    junk(p1);
  } else {
    algo("B");
    var p2 = optimize(150, 1, 333, -33);
    junk(p2);
  }
}


Re: Error 042 with simple 2 algo strategy [Re: GPEngine] #443930
07/28/14 07:20
07/28/14 07:20
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
In a portfolio system, all optimize calls must be inside a loop(). This would be the correct code:

Code:
while(algo=loop("A","B"))
  var p1 = optimize(150, 1, 333, -33);



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