Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
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 (dBc), 17,971 guests, and 5 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
ResultLong[] / ResultShort[] - extending beyond 20 trades #459382
05/13/16 06:53
05/13/16 06:53
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I would like to access the previous N trades of an asset/algo combination to calculate a rolling performance metric for use in a modification to the equity curve trading approach. ResultLong[] and ResultShort[] are just what I need, except that I would like to use more than just the most recent 20 trades.

I altered the defined variable NUM_RESULTS in trading.h to achieve this, and all works as expected.

Is this the best approach to access trade results for individual portfolio components and can I expect any problems from altering the trading.h header file?

Thanks

Re: ResultLong[] / ResultShort[] - extending beyond 20 trades [Re: boatman] #459407
05/16/16 08:33
05/16/16 08:33
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
This would probably work, but is not recommended since it might not work in a future version. There are two "official" ways:

a) use non-shifting series with a fixed length and shift the series every time when you add a new trade result at the begin.

b) don't store the results at all, but use a for(all_trades) loop for evaluating past results.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1