Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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