Training strategy - errors

Posted By: Neb

Training strategy - errors - 01/09/21 12:11

Hi,

I have a problem training a strategy.
Have 2 variables to optimize. Code looks like this:


DataSplit = 80; // 80% training, 20% test
NumWFOCycles = 10; // 10 cycles

var openLoss = optimize(30,10,50,10); // Used in entry condition
var StopLoss = optimize(2,2,10,2)*ATR(25);
Trail = 2*StopLoss;

At the end of first walk loop (cycle) getting:

Walk[1] Bar 368..6156
......

Loop[1] 23: 30.00 10.00 => 0.02 45/17
Loop[1] 24: 40.00 10.00 => 0.01 22/11
Loop[1] 25: 50.00 10.00 => 0.01 15/ 7
SPX500: 10 2=> 0.064

Parameters stored in KDFlow1.1_1.par

Error 044: Data\KDFlow1.1_2.par no content

Walk[2] Bar 1907..6156

Loop[1] 1: 10.00 2.00 => 0.06 77/34
Loop[1] 2: 20.00 2.00 => 0.03 39/19
......
Loop[1] 24: 40.00 10.00 => 0.02 23/ 9
Loop[1] 25: 50.00 10.00 => 0.01 9/ 6
SPX500: 10 2=> 0.057

Error 062: Can't open KDFlow1.1_2.par (wt:13)

I am running Zorro as admin.

Why there is no content after first cycle (Error 044) ?
I suppose Error 062 is caused by previous error ?


Training only one asset at the moment.

while(asset(loop("SPX500")))
{}



Thanks,

Neb



Posted By: Neb

Re: Training strategy - errors - 01/12/21 19:02

Any hint, anyone ?
Posted By: Petra

Re: Training strategy - errors - 01/16/21 12:53

I dont know if thats the reason but never ever use a file name with a "1.1" in it because the dot in Windows file names is for the file extension.
Posted By: Neb

Re: Training strategy - errors - 01/17/21 01:39

Thanks Petra,

Will try it.
I've just renamed file and rerun training.
Will see soon laugh

Regards,

Neb
Posted By: Neb

Re: Training strategy - errors - 01/17/21 02:42

Hm,

I am getting now this:

Loop[3] 99: 40.00 10.00 0.80 => 0.00 0/ 5
Loop[3] 100: 50.00 10.00 0.80 => 0.00 0/ 5
XAU/USD: 50 10 0.800=> 0.000

Parameters stored in KDFlow1_1.par


Time 01:02:04

KDFlow1_1 compiling................
Error 062: Can't open KDFlow1_1_NAS100_1.par (rt:2)
Error 044: Data\KDFlow1_1_NAS100_1.par not trained


During training, I saw it was doing loop for every of the asset.



Question: Can I train all assets together (3 of them) or I need to do it separately ?

I got 9 files:

KDFlow1_1_1.par to KDFlow1_1_9.par
Neither of them have asset in name.
Why it is asking me name now when I try to run test ?

Thanks,

Neb
Posted By: Neb

Re: Training strategy - errors - 01/17/21 02:47

Ok.

Repeated training only for one asset -> "NAS100".

Got similar message when I try to run test:


Time 00:01:19

KDFlow1_1 compiling...............
Error 062: Can't open KDFlow1_1_NAS100_1.par (rt:2)
Error 044: Data\KDFlow1_1_NAS100_1.par not trained


What I am missing ?

Thanks,

Neb
Posted By: Neb

Re: Training strategy - errors - 01/17/21 02:59

hm,

One more interesting thing.
I found that instead of picking up assets from the script, when I click test, seems it is picking up from drop down menu ?
Why is that when I am doing while loop inside script ?

while(asset(loop("NAS100","SPX500","XAU/USD")))
{

if((condition A) and (Condition B) and (Condition C))
{
.....


Completely the same script, when I comment

set(PARAMETERS);

and replace optimize with values, do test properly with all assets from the loop.


Thanks,

N.
Posted By: Petra

Re: Training strategy - errors - 01/17/21 10:26

You must select an asset before optimizing its parameters, not afterwards. Otherwise it takes the asset from the scrollbox and that is probably not the asset you want to optimize.

All about optimizing is in the tutorial, you can see in workshop 6 how to code a script for multi asset optimization.
Posted By: Neb

Re: Training strategy - errors - 01/17/21 13:02


Thanks @Petra !

I moved all what I could to trade function (Like in W6) and with calling function inside assets loop
all works like it should.
I don't know what I should do without you and @AndrewAMD!

Both of you rocks !

Regards,

Neb
Posted By: Neb

Re: Training strategy - errors - 01/17/21 14:57

Hi again,

After I updated code, moved entry logic into separate function and calling that function now inside "while asset loop",
wanted to check if i am getting same stats for previous code and this new one.
I should be getting similar, I supposed so, cause parameters are the same.
And to be on the safe side, checked both codes:

1) NAS100 only - same result
2) NAS100 & SPX500 - same result
3) NAS100, SPX500 & XAU/USD - different results -> different number of trades and all the following

So, more checking and debugging, but I wonder how is that possible that is not different for 1 and 2 assets, but with 3 is ? frown

Neb
Posted By: Petra

Re: Training strategy - errors - 01/18/21 12:14

This is probably the effect mentioned in the manual, under "asset" remarks "the order of asset calls matters...".
© 2024 lite-C Forums