asset loop + set(PARAMETERS+RULES) --> Error 042

Posted By: GPEngine

asset loop + set(PARAMETERS+RULES) --> Error 042 - 05/13/14 02:15

The manual says
Quote:
If the parameters affect the rules, set the RULES and PARAMETERS modes at the same time. Every optimization cycle then will first generate the rules, then in a second run determine the performance and use it for finding the best parameter value. After the optimal parameters are found, another cycle is run for generating the final rules with the optimal parameter set.

but Zorro doesn't seem to do that. Train on the following script leads to
Code:
Error 042: CHF/JPY: parameters not found!,

Can you please explain why?
Code:
string selected_asset;

function run() {
  if (is(INITRUN)) {
    BarPeriod = 348;
    LookBack = 501;
    StartDate = 20131020;
    EndDate = 20140420;
    set(RULES);
    set(PARAMETERS);
    if (Train) {
      Hedge = 2;
      Detrend = 1;
    } else {
      set(NFA);
      Hedge = 4;
      Detrend = 0;
    }
    TradesPerBar = 2;
    Weekend = 1;
    EntryTime = 1;
    ExitTime = 24 * 60 / BarPeriod;
    NumOptCycles = 2;
    NumSampleCycles = 2;
    NumWFOCycles = 22;
    Confidence = 75;
  }

  while(selected_asset = loop("CAD/JPY", "CHF/JPY")) {
    asset(selected_asset);

    var atrx = ATR(238);
    TakeProfit = 3 * atrx;
    Stop = 2 * atrx;
    vars Price = series(price());
    var p00 = optimize(174, 87, 348, -100);
    var v00 = StdDev(Price, p00);

    if (adviseLong(PERCEPTRON, 0, v00) > 0) {
      enterLong();
    }

    if (adviseShort(PERCEPTRON, 0, v00) > 0) {
      enterShort();
    }
  }
}

Posted By: jcl

Re: asset loop + set(PARAMETERS+RULES) --> Error 042 - 05/13/14 13:24

I believe training RULES and PARAMETERS at the same time works only with a single asset, not with a portfolio. But I can't see this in the manual, so I'll inquire to be sure.
Posted By: GPEngine

Re: asset loop + set(PARAMETERS+RULES) --> Error 042 - 05/14/14 02:07

Thanks. I can't believe I'm the first to try this....
Posted By: jcl

Re: asset loop + set(PARAMETERS+RULES) --> Error 042 - 05/14/14 07:56

I got confirmation that this indeed works with single components only. And you're maybe indeed the first one, at least I have never tried this with multiple assets. But a future Zorro version will support this with portfolio systems also.
Posted By: GPEngine

Re: asset loop + set(PARAMETERS+RULES) --> Error 042 - 05/14/14 14:57

Thanks
© 2024 lite-C Forums