What I wanted to do : Bot runs on a 1 minute chart and runs on bar close. I loaded a data series for 60 minute bars for my higher timeframe. The idea was to check the 60 minute timeframe MACD before making decisions for that day. When I use the print function, it appears that whatever timeframe my MACD is running on is neither the 1 minute or the 60 minute timeframes.
I think it's pretty obvious that the problem was me defining MACD1 using what I now know to be the default timeframe, then calling it as MACD1[1] thinking that was how to reference the 60 minute dataset. I just can't find any documentation that tells me what exactly I did by referencing MACD1.Diff[1] in this context so I can actually verify my "seems too good to be true" backtest!
Relevant code :
private MACD MACD1;
AddDataSeries(Data.BarsPeriodType.Minute, 60);
MACD1 = MACD(Close, 6, 24, 7);
if ((Position.MarketPosition == MarketPosition.Flat)
&& (Times[0][0].TimeOfDay == new TimeSpan(17, 2, 0))
&& (MACD1.Diff[1] > 0))
{
BuyState = 0;
}

Comment