Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Exporting balance curves: incorrect asset name? #467727
08/24/17 22:23
08/24/17 22:23
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I exported a bunch of balance curves for different assets in a loop during training. When I read them back in, they don't have the correct asset identifier. Instead they all get the same asset identifier as the first asset in the loop. Here's a small script to demonstrate (uncomment the first #define statement and Train to export balance curves, then comment the first #define statement and Test to read them back in):

Code:
#define WRITECURVES
#define FILENAME "Log\TestCurves.bin"

typedef struct curve
{
	string Name;
	int Length;
	var *Values;
} curve;

curve Curve[6];


function run()
{
#ifdef WRITECURVES

	set(PARAMETERS|LOGFILE);
	StartDate = 2016;
	EndDate = 2016;
	BarPeriod = 1440;
	Curves = FILENAME;
		
	while(asset(loop("EUR/USD", "AUD/USD")))
	{
		int trades = optimize(1, 1, 3, 1);
		reverseLong(trades);
	}
	
#endif

#ifndef WRITECURVES

	byte *Content = file_content(FILENAME); // read in balance curves
	if(!Content) return; //nothing to read
	
	int i,j,N = 0;
		while(N<6 && *Content) 
	{ 
// extract next curve
		string Name = Content;
		Content += strlen(Name)+1;
		int Size = *((int*)Content);
		int Length = Size/sizeof(var); // number of values
		Content += 4;
		var *Values = Content;
		Content += Size;

// store curve and print its name and length
		Curve[N].Name = Name;
		Curve[N].Length = Length;
		Curve[N].Values = Values;
		
		printf("n%s: %d",Curve[N].Name,Length);
		N++;
	}
	quit();

#endif	
	
}



Printed to the Zorro GUI, I have the name associated with each curve. Here's the output after running this code:

Code:
TestCurves compiling...........
TestCurves_EURUSD_1_1: 180
TestCurves_EURUSD_1_2: 180
TestCurves_EURUSD_1_3: 180
TestCurves_EURUSD_1_1: 180
TestCurves_EURUSD_1_2: 180
TestCurves_EURUSD_1_3: 180
Quit



Expected:
Code:
TestCurves compiling...........
TestCurves_EURUSD_1_1: 180
TestCurves_EURUSD_1_2: 180
TestCurves_EURUSD_1_3: 180
TestCurves_AUDUSD_1_1: 180
TestCurves_AUDUSD_1_2: 180
TestCurves_AUDUSD_1_3: 180
Quit



Is there anything obvious that is incorrect in my script?

Thanks for any help.

Re: Exporting balance curves: incorrect asset name? [Re: boatman] #467848
09/04/17 13:55
09/04/17 13:55
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
This looks like a wrong asset in the curve name. I'll forward this to the developers for checking.

Re: Exporting balance curves: incorrect asset name? [Re: jcl] #468176
09/22/17 11:47
09/22/17 11:47
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Was this fixed? Ran into the same issue

Re: Exporting balance curves: incorrect asset name? [Re: Dalla] #468177
09/22/17 11:48
09/22/17 11:48
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Thanks for looking into this, jcl.

Re: Exporting balance curves: incorrect asset name? [Re: boatman] #468188
09/23/17 05:11
09/23/17 05:11
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
After testing myself with the latest release (1.66) I can confirm this has been fixed


Moderated by  Petra 

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

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

Powered by UBB.threads™ PHP Forum Software 7.7.1