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
2 registered members (Quad, aliswee), 835 guests, and 5 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
Incorrect file name when using advise with SIGNALS #473401
07/03/18 06:50
07/03/18 06:50
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
I'm using Zorro 1.84.9
Given the following asset file

Code:
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission,Symbol,Type
ABB.ST,50,0.1,0,0,0.01,0.01,0,2,1,0.02,AV:ABB
ALFA.ST,50,0.1,0,0,0.01,0.01,0,2,1,0.02,AV:ALFA.ST
CAST.ST,50,0.1,0,0,0.01,0.01,0,2,1,0.02,AV:CAST.ST



and the following script named Debug.c
Code:
#include <r.h>

function run()
{
	assetList("AssetsLargeCap.csv");
	set(RULES);
	BarPeriod = 1440;
	LookBack = 200;
	LifeTime = 1;
	Spread = Commission = Slippage = RollLong = RollShort = 0;
	
	int period = 50; //lookback for calculating normalized/standardized values

	while(asset(loop("ABB.ST","ALFA.ST","CAST.ST"))) {
		vars price = series(price());
		vars vol = series(marketVol());
		vars pv = series(vol[0]*price[0]);
	
		//Normalized
		vars priceNorm = series(Normalize(price,period));
		vars volNorm = series(Normalize(vol,period));
		vars pvNorm = series(Normalize(pv,period));
	
		if(Train) {
			adviseLong(SIGNALS+BALANCED, 0, priceNorm[0], volNorm[0],pvNorm[0]);
			enterLong();
		}
	}
}



when training I get the following output in the message window

Code:
Debug compiling..............
Rules: Debug  2013..2018
Assets AssetsLargeCap.csv
Train ABBST_L Debug.csv.
Train ALFAST_L Debug.csv.
Train CASTST_L Debug.csv



When checking in the Data folder, I find a single file, named Debug.csv which only contains output from a single asset.

I guess there should be one file for each asset? Bug?

Also a question: Is it possible to somehow generate a single file containing signals from all specified assets. The use case would be that I ultimately don't want a separate model for each asset, but rather a general model trained on data from many assets.

Re: Incorrect file name when using advise with SIGNALS [Re: Dalla] #473441
07/06/18 14:15
07/06/18 14:15
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
When you use loop(), all assets are separately trained and the signals file is thus rewritten for any asset. For training them all together, don't use a loop() call, but a normal for() or while() loop.

Re: Incorrect file name when using advise with SIGNALS [Re: jcl] #473453
07/09/18 11:22
07/09/18 11:22
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
Can I somehow train one model per asset, without running separate strategies?

Re: Incorrect file name when using advise with SIGNALS [Re: Dalla] #473464
07/10/18 13:12
07/10/18 13:12
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
That's what your code above already does.

Re: Incorrect file name when using advise with SIGNALS [Re: jcl] #473471
07/11/18 06:06
07/11/18 06:06
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
No, that's what I'm saying.
The above script gives me a single output file, Debug.csv.

I was expecting one file per asset, named something like this
ABBST_L_Debug.csv.
ALFAST_L_Debug.csv.
CASTST_L_Debug.csv

Re: Incorrect file name when using advise with SIGNALS [Re: Dalla] #473484
07/13/18 09:38
07/13/18 09:38
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Ok, the probably simplest way is file_copy() in any INITRUN to copy the Debug.csv from the previous training loop to a target file name. Or use an individual neural() function that stores the signals.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1