Portfolio performance results start after 52 weeks
Author: Jim0000076
Creation Date: 10/24/2012 11:50 PM
profile picture

Jim0000076

#1
I am working on a WL6 code that buys 52 week highs + uses other indicators. This means that I must set the strategy so that the trading loop does not start for 53 bars (i.e. to allow for indicators + lookback period for buying a 52 week high). I do this by using the following:

CODE:
Please log in to see this code.


The end result, however, is that the first year of data from the code is $0 as there are no trades but when I look at the portfolio simulation results the portfolio starts a year earlier, the performance results are averaged down by the year of missing data and the same for the profit distribution results.

To only work around this that I have found is that I have to manually average results to exclude the year of no data. Does anybody know a better way of addressing this issue? There is data in the files before the 52 week period but if I start the loop any earlier than a 53 week lookback period the code for buying the highs does not work for any subsequent years at all for that component.

Thanks in advance.

Jim
profile picture

Eugene

#2
profile picture

Jim0000076

#3
Thanks Eugene, I thought that might be the answer but still work asking the question.

profile picture

Eugene

#4
Just an update to the old thread. Now there is an easy workaround (referred to in the same FAQ): GetAllDataForSymbol
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).