Herding behavior and market psychology are difficult to detach from as human beings. A good way to stay clear of trend chasing is to create an objective and unbiased strategy and then stick with it no matter what. Set your exit criteria ahead of time and do not deviate. Passive indexing or contrarian strategies can also be used to avoid this bias.