protected override void Initialize()
{
Add(PeriodType.Minute, 5);
HA2_C = new DataSeries(this);
}
protected override void OnStartUp()
{
hma1 = HMA(HA2_C, Period);
hma2 = HMA(hma1, Period);
hma3 = HMA(hma2, Period);
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] <= 2 || CurrentBars[1] <= 2) return;
if (BarsInProgress == 1) // process min chart
{
HA2_C.Set((((Opens[1][0] + Highs[1][0] + Lows[1][0] + Closes[1][0]) / 4));
MyVal = (3 * hma1[0] - 3 * hma2[0] + hma3[0]);
}
if (MyVal >= 800) BackColorSeries[0] = risingColor;
else BackColorSeries[0] = fallingColor;
}
Comment