Gamestudio Links
Zorro Links
Newest Posts
Alpaca - anyone tried using them?
by DdlV. 10/28/20 19:38
Work in Indian markets
by AndrewAMD. 10/28/20 11:14
Force chart into a y-axis range?
by ozgur. 10/27/20 18:57
Special Bars Script
by atr. 10/27/20 09:06
Optimize in a ranked asset portfolio
by dBc. 10/27/20 06:33
MT4 - use more Zorro script
by danatrader. 10/27/20 06:23
TIP: Multiply Your Trade VPS
by danatrader. 10/27/20 05:48
AUM Magazine
Latest Screens
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
Who's Online Now
3 registered members (danatrader, AndrewAMD, Iglarion), 472 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
xilex, exshifta, mr_T0ma5, AVL, ruins
18530 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: 507
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 507
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: 323
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 323
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: 507
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 507
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