Accessing component equity curve

Posted By: Zheka

Accessing component equity curve - 09/25/20 16:02

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?
Posted By: Petra

Re: Accessing component equity curve - 09/27/20 13:30

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.
Posted By: Zheka

Re: Accessing component equity curve - 09/29/20 15:34

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?
© 2024 lite-C Forums