How do I solve the error?
protected ISeries<double> argument1;
protected ISeries<double> argument2;
private int lookBackPeriod;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "aRectsDemo";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = false;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
Ticktimeframe = 1000;
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, Ticktimeframe);
}
}
protected override void OnBarUpdate()
{
WasAbove(Close, SMA(20), 20);
}
protected bool WasAbove (ISeries<double> argument1, ISeries<double> argument2, int lookBackPeriod)
{
for (int i = 0; i < lookBackPeriod; i++)
{
if (argument1[i] > argument2[i])
{
return true;
}
else
return false;
}
}
Comment