My goal is create a simple swing indicator, ATR based.
It works fine with colored bars. But now I want to put dots below the swingpoints and that doesn't work because sometimes a trend is so strong that it will multiple times cross above 'upwave'. So you get dots but it isn't actually a cross from down to up trend.
Does anyone know a solution for this? I started playing with dataseries but I don't get the job done. (background yellow was for testing (=dots).
if ( myDataSeries[1] == 0 && myDataSeries[0] == 1
)
{BackColor = Color.Yellow;
}
double upwave = ATR(15)[0]*2.5 + MIN(Low, 14)[0] ;
double downwave = MAX(High, 14)[0] - ATR(15)[0]*2.5;
if ( CrossAbove(Close, upwave, 1)
)
{ trend = 1;
myDataSeries.Set(1);
}
else if ( CrossBelow(Close, downwave, 1)
)
{ trend = 0;
myDataSeries.Set(0);
}
if ( trend ==1)
{BarColor = Color.Green;}
if (trend ==0)
{BarColor = Color.Red;}

, I want to add another dataserie. If there is a cross to an upswing I want to know the low of the last 5 bars. But this doesn't work because everytime onbarupdate it will save to dataserie: datalows.
Comment