Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 7th_zorro), 923 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

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