Removing random triggers for stop losses

I have a trailing price stop order. I only want the order to sell when there’s profit and then the trailing stop order should be triggered. it seems like my orders just get sold when the price drops too low. so, when the program sells low and then buys higher that a small chunk of my available cash I lost. I only have a trailing price order so not sure why this is happening. any advice would be great fully appreciated.