Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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,729
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,729
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