I have a strategy that requires optimization based on the performance of the most recent set of trades only. I'm trying to write an optimization type that accommodates this, but before I do could someone please answer:
a) is it possible to pass in a variable to the optimization type code that allows you to specify the number of most recent trades to account for in the fitness test? Or must this number be hard-coded? (I'm fine with either way)
b) What's the best approach to getting the performance of the last N trades? Is there a pre-defined method that can be used, or would I need to loop through each trade and add up the P/L for each one and do my own calculations?
Thanks!
-Dave
Comment