ResultLong[] / ResultShort[] - extending beyond 20 trades

Posted By: boatman

ResultLong[] / ResultShort[] - extending beyond 20 trades - 05/13/16 06:53

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
Posted By: jcl

Re: ResultLong[] / ResultShort[] - extending beyond 20 trades - 05/16/16 08:33

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.
© 2024 lite-C Forums