Wash sale rule also apply to trades 30 days prior to a sale. Don't try to sell a stock lot and claim a loss on it if you have bought the same or identical stock in the previous 30 days at a lower price than the lot you are selling at a loss. Get professional advice.