else if (State == State.Configure)
{
AddDataSeries("^SP500", Data.BarsPeriodType.Tick, 4, Data.MarketDataType.Last);
}
else if (State == State.DataLoaded)
{
LinRegSlope1 = LinRegSlope(BarsArray[1], 14);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
// Set 1
if (LinRegSlope1[0] > 0)
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
// Set 2
if (LinRegSlope1[0] < 0)
{
ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
}
}
Comment