else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
}
else if (State == State.DataLoaded)
{
CumDelta1 = CumDelta(Close);
EMA1 = EMA(CumDelta1, Convert.ToInt32(TFP));
EMA2 = EMA(Close, Convert.ToInt32(FTP));
EMA3 = EMA(Close, Convert.ToInt32(STP));
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((Close[1] < Open[1])
&& (CumDelta1[0] > VFLT)
&& (EMA1[0] > TFLT)
&& (EMA2[0] > EMA3[0]))
{
Draw.ArrowUp(this, @"MyCustomStrategy Arrow up_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] + 20) , Brushes.DodgerBlue);
BarBrush = Brushes.DeepPink;
}
// Set 2
if ((Close[1] > Open[1])
&& (CumDelta1[0] < VFST)
&& (EMA1[0] < TFST)
&& (EMA2[0] < EMA3[0]))
{
Draw.ArrowDown(this, @"VTES001 Arrow down_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] - 20) , Brushes.Red);
BarBrush = Brushes.DeepPink;
}
Comment