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
3 registered members (AndrewAMD, Quad, 7th_zorro), 923 guests, and 2 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
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