I would like to count the number of bars since Trend[1] != Trend[2]. So essentially it's at the point where the trend direction changes. Is below how I would be able to do this or am I completely off?
int TrendCounter = 0;
OnBarUpdate()
if (Trend[1] != Trend[2])
{
TrendCounter = 0;
}
else
TrendCounter += _________;
}

Comment