Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Accessing strategy returns #484874
12/22/21 11:04
12/22/21 11:04
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Hello,

I'd like to know how to access strategy returns. I'm interested in using the volatility of the past strategy returns to scale positions accordingly, but am currently at a loss of how to get these returns as a series. I would think doing that via diff(Equity,1) might work but although the documentation says diff() is expecting 2 parameters I get an error telling me only to give one.

Kind regards

Re: Accessing strategy returns [Re: VizTra] #484875
12/22/21 12:20
12/22/21 12:20
Joined: Feb 2017
Posts: 1,806
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,806
Chicago
Post your script.

Re: Accessing strategy returns [Re: VizTra] #484877
12/22/21 13:21
12/22/21 13:21
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Hey,

I realized that I misunderstood how the variable Equity and series() interact, now I know how to access past strategy return values:

Quote

vars eq = series(Equity, 30);
vars ret = series(ROC(eq,1), 30);


Using this code snippet one can access the past 30 days of equity values (eq[0], eq[1]...) and via that the past 30 days of returns (ret[0]..) for the whole strategy.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1