add a closeflag to call SetTrend with or without previous close.