I have built a custom Indicator, and then used that within a custom Strategy.
Within the strategy I have used
Add(PeriodType.Minute, 15) with BarsArray[1]
to feed a 15min dataseries through the indicator, against which certain mkt orders are then fired from the strategy (even when the strategy is run on, say, a 5min basis).
Is there a way to hard code within an indicator itself that it should always run against, say, 15min bars?
What I would like to do is then chart the (15min) Indicator on my backtesting results chart, even if I am executing the strategy on a 3min or 5min basis.
If I cannot hardcode the indicator to always be a 15min indicator (I believe the above periodtype "Add" only works within strategies, not indicators? - is there another way to do that?) can you tell me a line of code that will automatically plot the 15min (ie BarsArray[1] index indicator values) on the 5min BT strategy results chart? Is that possible?
The problem I have currently is that when I run my strategy on a 5min basis, and then plot the Indicator on the BT chart (which is perforce on the same 5min basis), there is a visual mismatch between the buys and sells that the strategy generated (which ran off 15min bars per my barsarray index=1) and the indicator lines plotted on the chart which are based off 5min bars. This makes it hard to visually verify that the buys/sells are correct as the indicator is not showing the actual levels on the chart that were used to generate the orders.
many thanks
Comment