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
5 registered members (AndrewAMD, monk12, TipmyPip, Quad, aliswee), 1,031 guests, and 6 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
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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