The rule defines a wash sale as one that occurs when an individual sells or trades a security at a loss and, within 30 days before or after this sale, buys a “substantially identical” stock or security, or acquires a contract or option to do so. A wash sale also results if an individual sells a security, and the individual's spouse or a company controlled by the individual buys a substantially equivalent security.
another way is having a security with a retirement a/c you control. for example sell x for a loss personally and then within 30 days buy x in your IRA or 401K.
All of the wash sale example I read relate to a sale of stock at a loss, and then a buy of the same stock less than 30 days later. I have a different scenario. I recently sold many shares of stock at a gain (most long, some short) due to a stop loss trigger when the market declined (Feb 24th, 2020). Several days later, when I thought the market was at the bottom, I repurchased the same stock (March 2nd, 2020). Currently (March 12th, 2020), the stock is trading below the March 2nd price. If I sell some or all of these shares (all short) at a loss, do I trigger a wash sale? Is there some advantage to waiting until 30 days after either Feb 24th or March 2nd? Since the 30 day rule is 30 days before or after, how do I think about my situation?