A doji represents an equilibrium between supply and demand, a tug of war that neither the bulls  nor bears are winning. In the case of an uptrend, the bulls have by definition won previous battles  because prices have moved higher. Now, the outcome of the latest skirmish is in doubt. After a long  downtrend, the opposite is true. The bears have been victorious in previous battles, forcing prices  down. Now the bulls have found courage to buy, and the tide may be ready to turn.

For example