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
1 registered members (degenerate_762), 1,098 guests, and 2 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
Accessing component equity curve #481533
09/25/20 16:02
09/25/20 16:02
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
To 'evaluate' the equity curve of each component (Asset/Algo combination) in a portfolio, I am trying this snippet of code:
Code
#define EqLong (g->statLong->pCurve)  //   var* pCurve is part of the  STATUS struct ;   variables.h  has this def commented out   //#define DailyLong (g->statLong->pCurve)
#define EqShort (g->statShort->pCurve)

function evaluate()
{
	int nDays = NumBars/(1440/BarPeriod);
        for(used_assets) {
		//asset(Asset);
		algo(Algo);   //there is just one algo in a portfolio
		
		if (WinLong>0) 		
		for (Day=0;Day<nDays;Day++) {
			print(TO_LOG, "\n EqL[%i]=%.3f", Day, (EqLong+Day) );
			
		}
	}
} 
This however outputs 0.

1) Is pCurve calculated by Zorro in [Test] mode at all?
2) If yes, is it Daily or Bar-ly?

3) If no, is there another way to access each component's curve (without having to do this manually)?

4) IF this calculation was abolished and component eq.curves are not saved in [Test] - can a flag pls be added to enable maintenance of these by the engine?

Re: Accessing component equity curve [Re: Zheka] #481541
09/27/20 13:30
09/27/20 13:30
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
I never heard of "g->statLong->pCurve" containing equity curves of components. If you need them, you must write code for them - in programming there's no free lunch wink.

Re: Accessing component equity curve [Re: Zheka] #481559
09/29/20 15:34
09/29/20 15:34
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Well, this is a snippet from variables.h:
Code
#define ResultLong		(g->statLong->Result)
#define ResultShort		(g->statShort->Result)
#define ThisPerformance	(g->w)
//#define DailyLong		(g->statLong->pCurve)
//#define DailyShort		(g->statShort->pCurve)
//#define DailyTotal		(g->pCurve)
So, obviously somebody at a time had the intention of using/exposing it; I doubt it is just taking up space for nothing.

Zorro calculates several stats for the Performance report/ in training that are based off bar-ly returns per component. Total portfolio Results are also calculated from asset/algo results.

Why not expose those to a user?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1