Performance: Starting bar
Author: thodder
Creation Date: 4/25/2012 3:24 PM
profile picture

thodder

#1
I few of us were discussing the performance of a recent strategy, and we realized the performance report and equity curve were starting on the first bar on the chart when we'd like it to start on the first bar we were able to trade on. For example, our strategy had a SMA(Close,200) indicator so we had to start the for loop on the 200th bar whereas performance measurements were based on the first bar. The buy and hold versus trades on the performance report would be a lot more meaningful if they started on the same bar.

Is there a way to specify the starting bar for performance measurement (in the strategy code preferred)? Or, is there a way to specify a pre-range (ex: 200 for our strategy) so the indicators are stabilized for the first bar in the test range? The latter would be the best solution in my opinion.
profile picture

Eugene

#2
profile picture

thodder

#3
Thanks. I poked around looking for a similar post, but I missed that one.
profile picture

Eugene

#4
Just an update to this old thread. The GetAllDataForSymbol method in Community Components is the solution. Using this technique, you can create indicators that are valid from bar 0, and therefore can start the trading loop from bar 1.
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).