I wish to call a custom indicator into this strategy. And I desire that its calculations be based on a 30-minute input series.
I have added the following code in the Initialize() section to introduce the additional input series:
protected override void Initialize()
{
// Add a 30 minute Bars object - BarsInProgress index = 1
Add(PeriodType.Minute, 30);
CalculateOnBarClose = true;
}
To determine whether the distance between Low[0] of the time frame of my chart (say, for example, 5 minutes) and the VAH of my custom Market Profile indicator, which requires the 30-minute time frame, I have written the following:
if(Math.Abs(Low[0] - TTZMPX(30, false, OpenHour, OpenMinute, 68.27, TTZMPX_VAMethods.VWTPO, SessionLength, 300, false, TTZMPX_VAPlotStyle.Both, true).VAH[0]) > 2 * Tock)
Paint an arrow.....
The first argument of TTZMPX is supposed to be the IDataSeries. I realize using 30 in my code is not correct.
My question is, how do I instruct in my coding, so that NinjaTrader will use the 30-minute input series when comparing to TTZMPX? That is, what is proper syntax to accomplish this?
If I do not specify which series to use, it will use the time frame of my chart, which I do not want. I want this calculation to use the 30-minute VAH when comparing to Low[0] of my chart's time frame.
Comment