Gamestudio Links
Zorro Links
Newest Posts
Windows permission issues
by HellThunder
Today at 21:51
CSVToHistory.c
by Dalla
Today at 20:42
Position Close not possible
by MatPed
Today at 18:49
Options trading questions
by Zheka
Today at 17:36
Published Gamestudio Games?
by jumpman
Today at 08:05
New Zorro version 1.88
by DdlV
Yesterday at 20:32
Possible to extend assetHistory with own source?
by jcl
Yesterday at 16:32
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
17 registered (Jason_Rogers, alibaba, dmac, AndrewAMD, HellThunder, Dalla, jumpman, 3run, 3 invisible), 505 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
cepturion, Mon3y, vincitytaymo, just, XJohnny_Hoffmann
18057 Registered Users
Topic Options
Rate This Topic
#473401 - 07/03/18 08:50 Incorrect file name when using advise with SIGNALS
Dalla Online
Member

Registered: 02/24/17
Posts: 284
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.

Top
#473441 - 07/06/18 16:15 Re: Incorrect file name when using advise with SIGNALS [Re: Dalla]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26488
Loc: 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.

Top
#473453 - 07/09/18 13:22 Re: Incorrect file name when using advise with SIGNALS [Re: jcl]
Dalla Online
Member

Registered: 02/24/17
Posts: 284
Can I somehow train one model per asset, without running separate strategies?

Top
#473464 - 07/10/18 15:12 Re: Incorrect file name when using advise with SIGNALS [Re: Dalla]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26488
Loc: Frankfurt
That's what your code above already does.

Top
#473471 - 07/11/18 08:06 Re: Incorrect file name when using advise with SIGNALS [Re: jcl]
Dalla Online
Member

Registered: 02/24/17
Posts: 284
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

Top
#473484 - 07/13/18 11:38 Re: Incorrect file name when using advise with SIGNALS [Re: Dalla]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26488
Loc: 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.

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de