The Trade Desk beat on earnings and revenue, but the stock was headed for its worst day on record as investors worried about rising competition from Amazon.