string flagBearLabel = "BearFlag"+CurrentBar;
string flagBullLabel = "BullFlag"+CurrentBar;
RemoveDrawObject(flagBearLabel);
RemoveDrawObject(flagBullLabel);
if(BullBearFlag)
{
isLowSequence = true;
for (int i = 0; i < lookbackPeriod-1; i++)
{
if (Low[i] <= Low[i + 1])
{
isLowSequence = false;
break;
}
}
if (isLowSequence && trendDirection == -1 && Low[0] < Close[0])
double slope = (Low[0] - Low[lookbackPeriod -1] ) / lookbackPeriod;
trendlineValueUp = Low[0] - (slope * 0);
Draw.Line(this, flagBearLabel, true, lookbackPeriod, Low[lookbackPeriod -1], 0, Low[0], Brushes.Aqua, DashStyleHelper.Solid, 2);
Alert("Alert", Priority.High, "Up trend line broken", NinjaTrader.Core.Globals.InstallDir+@"\sounds\Reve rsing.wav", 10, Brushes.Transparent, Brushes.Transparent);
bearFlag = true;
}
Comment