Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
0 registered members (), 1,438 guests, and 5 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
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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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 | chip programmers | 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