I am trying to code an indicator that work on say a 1 minute timeframe but looks at the value of a specific indicator on the 5 minute chart.
I have coded the following so far
protectedoverridevoid Initialize()
{
Add(PeriodType.Minute, 5);
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
protectedoverridevoid OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CrossAbove(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] < Stochastics(3,8,5).K[0] && DM(BarsArray[1], 5)[0].DiPlus > DM(BarsArray[1], 5)[0].DiMinus )
DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - 0.0005, Color.Green);
if (CrossBelow(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] > Stochastics(3,8,5).K[0] )
DrawArrowDown(CurrentBar.ToString(), true, 0, High[0] + 0.0005, Color.Red);
}
My problem is that when I call the Add() line uder Inialize, I get an error telling me that "No overload for method "Add" take 2 arguements. I'm not sure what it wants since the line is taken directly from sample code in the help file.
What am I doing wrong if I would like to look at the adx on the 5 minute chart before drawing my indicator?
Thanks in advance for any help.
Comment