Price on a given time frame is in an uptrend if it is making higher highs (HH) and higher lows (HL) and in a downtrend, if it is making lower highs (LH) and lower lows (LL). If the price is doing anything else, it is in a consolidation pattern – range, triangle, pennant, rectangle etc.
The trend is considered in place until price is no longer making higher highs...