Gamestudio Links
Zorro Links
Newest Posts
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
folder management functions
by 7th_zorro. 04/15/24 10:10
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
SGT_FW
by Aku_Aku. 04/10/24 16:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, Quad), 373 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
adviseLong/Short, WFO and multiple assets #461859
08/26/16 06:03
08/26/16 06:03
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
Dear JCL,

thanks for your lovely trading system.
Recently I have read your last article on Deep Learning and tried to experiment some things.
Very intersting article, my compliments.
I have tried to apply this strategy to multiple assets, modifing the code in this way:

Code:
while(asset(loop("EUR/USD","USD/JPY","AUD/USD","EUR/JPY"))) {	   
		if(adviseLong(NEURAL+BALANCED,0,
			change(1),change(2),change(3),change(4),
			range(1),range(2),range(3),range(4)) > 0.5) 
			enterLong();
		if(adviseShort() > 0.5) 
			enterShort();
}




The problem is that if I Train/Test this strategy individually on each pair, I get positive results.
But if put all together in one multiple asset strategy, I do not get the sum of the results I am getting individually and sometime I am getting a completely failing strategy.
So my question is, with the respect to the manual:

[text]
NEURAL_SAVE Data Save all trained models in the file with the name given by the string Data. The function is called at the end of every WFO cycle in [Train] mode.
NEURAL_LOAD Data Load all trained models from the file with the name given by the string Data. The function is called at the begin of every WFO cycle in [Test] mode, and at the begin of a [Trade] session. It is also called every time when the model file is updated by re-training.
[/text]

I have noticed that even with multiple assets, only one file containing the trained model is created.
Could you please tell me:


  • Does this file contain the information for each currency pair?
  • Is there any way to make Zorro writing a different file for eacy currency pair at the end of each WFO cycle?



I hope I have been clear enough. If not, please tell me.
Thanks.
Regards.

Re: adviseLong/Short, WFO and multiple assets [Re: gtell] #461860
08/26/16 08:09
08/26/16 08:09
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, the model file is supposed to contain all models of each asset. Storing several separate models had to be scripted explicitely. Still, the portfolio results must be different to single assets because the random initial weight states are different. They should however not be systematically worse, only different. Do you get always worse results?

Re: adviseLong/Short, WFO and multiple assets [Re: jcl] #461861
08/26/16 09:58
08/26/16 09:58
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
I do not have any evidence now, but I can provide you later.
Results are good most of the times, but sometime are really completely wrong. For instance, from 3 pairs performing 200$ per year alone, I get one multiple asset strategy that looses 700$ with long period drawdown, which does not make sense, right?
Sorry if I ask you again, you wrote the model file contains all the models, do these models contain the information regarding the pair the model is related? How does Zorro handle these models.
The signal0.csv file, does not contain anything about what pair the data are related.
I am not sure if I am clear enough, but from what I understood, training and testing several times, it looks Zorro is not applying the correct model to the right pair.
Bu I am completely sure of what I am writing, neither I know how to check it better.
What do you think about?

PS.: I will attach some evidence at earliest.

Re: adviseLong/Short, WFO and multiple assets [Re: gtell] #461865
08/26/16 11:10
08/26/16 11:10
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The model file only contains the models, but no information about assets or algos. The model inside the file is identified by its number. So if the number is wrong, a wrong model is assigned to an asset. This can happen for instance when you change the order of assets after training.

But I also see a potential bug, not in your snippet but outside it: If you set Spread etc. = 0 in your script, as in my article, make sure to do that for all assets. Otherwise you'll indeed get much worse results with multiple assets.

Re: adviseLong/Short, WFO and multiple assets [Re: jcl] #461950
08/30/16 16:42
08/30/16 16:42
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
Ok, so it make sense not switching the order of the assets.
I have several more questions.
I want to start from the following one.
Consider the following Objective function:

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
ZigZag(PriceMed, 0.0037, 16, 1);
adviseLong(SIGNALS+BALANCED, rSign, ADX(16));



If I run it in Train mode I get:

Code:
17.05083,1.00000
15.92449,1.00000
15.35854,1.00000
14.35458,1.00000
13.80413,1.00000
14.31322,1.00000
16.44507,-1.00000
16.44507,-1.00000
16.44507,-1.00000
16.44507,-1.00000
18.18639,-1.00000
19.83614,-1.00000
21.73008,-1.00000
23.44226,-1.00000
24.77156,-1.00000
25.96473,-1.00000
27.43466,-1.00000
29.02421,-1.00000
30.23936,-1.00000
32.22313,-1.00000



which make sense...but If I change the function to:

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
ZigZag(PriceMed, 0.0037, 16, 1);
adviseLong(SIGNALS+BALANCED, ifelse(rSign==1, 0, 1), ADX(16));



I get the following:

Code:
17.05083,-0.58358
15.92449,0.03484
15.35854,-0.78387
16.44507,1.00000
14.35458,-1.91621
18.18639,1.00000
13.80413,-2.16878
19.83614,1.00000
14.31322,-1.98588
21.73008,1.00000
23.44226,1.00000
24.77156,1.00000
25.96473,1.00000
27.43466,1.00000
29.02421,1.00000
30.23936,1.00000
32.22313,1.00000



which does not make so much sense!
The records are first records of the file. After the first records everything seems fine.
Is there any reason for that?

Thanks.
Cheers.

Re: adviseLong/Short, WFO and multiple assets [Re: gtell] #461961
08/31/16 08:49
08/31/16 08:49
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes. You can use 0 or 1 for the Objective, but according to the manual not both at the same time:

"All advise calls for a given asset/algo combination must use the same Method, the same signals, and the same training target type (either Objective or trade result)."

Re: adviseLong/Short, WFO and multiple assets [Re: jcl] #461975
08/31/16 17:03
08/31/16 17:03
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
Ok, this now I get it.
But what is the last column in this case.
Suppose that I use this:

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
  ZigZag(PriceMed, 0.0037, 16, 1);
  adviseLong(SIGNALS+BALANCED, 0, ADX(16));	
   	enterLong();



and I get the following:

Code:
27.98701,-0.62714
26.37550,-0.31357
23.96109,0.00000
22.05319,0.31357
22.05319,0.31357
20.36910,0.23518
19.20755,0.52269
18.48154,0.31357
17.66632,0.54003
16.73169,-0.06967
16.73169,-0.06967
15.97246,-0.03478
17.35032,-0.37452
16.89325,0.13934
16.35416,0.41802
15.26053,0.62714
15.27519,0.60970
15.90981,-1.30651
15.90981,-1.30651
16.12806,-1.93365
17.01053,-2.79597
16.64948,-1.04517
17.42188,-1.60264
18.66212,-0.04351
19.78223,-0.47908
21.14320,0.76648
21.14320,0.76648
21.14320,0.76648



so first column is ADX, but the second column is what? From where it takes those values?
Thanks.
Cheers.

Re: adviseLong/Short, WFO and multiple assets [Re: gtell] #461989
09/01/16 08:12
09/01/16 08:12
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The trade result.

Re: adviseLong/Short, WFO and multiple assets [Re: jcl] #462002
09/02/16 08:32
09/02/16 08:32
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
Originally Posted By: jcl
Yes. You can use 0 or 1 for the Objective, but according to the manual not both at the same time:

"All advise calls for a given asset/algo combination must use the same Method, the same signals, and the same training target type (either Objective or trade result)."



Sorry I am still confused about what you wrote, because in another part of the manual you wrote:

Quote:

When using a future value for prediction, such as the price change of the next bars (f.i. Objective = priceClose(-5) - priceClose(0)), make sure to set the PEEK flag in train mode. Alternatively, use the price change of a past bar to the current bar, and pass past signals - f.i. from a series - to the advise function in train mode, f.i.:
Objective = priceClose(0) - priceClose(5);
int Offset = ifelse(Train,5,0);
var Prediction = adviseLong(Method,Objective,Signal0[Offset],Signal1[Offset],...);


In this case, the Object variable has range of values.
So, my aim is to train a model against the ZigZag target and predict values of this target.
What about this snippet, what is wrong?

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
ZigZag(PriceMed, 0.0037, 16, 1);
adviseLong(SIGNALS+BALANCED, rSign, ADX(16));


Re: adviseLong/Short, WFO and multiple assets [Re: gtell] #462007
09/02/16 15:49
09/02/16 15:49
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Nothing, why don't you use it? You can have any Objective that you want, only 0 and != 0 at the same time cannot work.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1