How does the wash sale rule work in this situation?
The way the wash sale works is your loss is added to your cost basis of the buy.  So suppose your original cost basis is $10,000.  You then sell the stock for $9,000 which accounts for your $1,000 loss.  You then buy the stock again, say for $8,500,  and sell it for $9,000.  Since your loss of $1,000 is added to your cost basis, you actually still have a net loss of $500. You then buy the stock again for say $10,500,  then sell it for $9,500.  Your $500 loss is added to your cost basis,  and you have a net loss of $1,500. Since you never had a net gain, you will not owe any tax for these transactions.
Yes, the newly bought shares will have a long-term holding period, regardless of when you sell them.  In addition, it's only a wash sale if you sold the first shares for a loss; it's not a wash sale if you sold them for a gain. Wikipedia mentions this: When a wash sale occurs, the holding period for the replacement stock includes the period you held the stock you sold. Example: You've held shares of XYZ for 10 years. You sell it at a loss but then buy it back within the wash sale period. When you sell the replacement stock, your gain or loss will be long-term — no matter how soon you sell it. Charles Schwab also mentions this: Here's a quick example of a wash sale. On 9/30/XX, you buy 500 shares of ABC at $10 per share. One year later the stock price starts to drop, and you sell all your shares at $9 per share on 10/4/XY. Two days later, on 10/6, ABC bottoms out at $8 and you buy 500 shares again. This series of trades triggers a wash sale. The holding period of the original shares will be added to the holding period of the replacement shares, effectively leaving you with a long-term position. Mutual funds are collections of investments that other people pay to join.  It would be simpler to calculate the value of all these investments at one time each day, and then to deem that any purchases or sales happen at that price.  The fund diversifies rather than magnifies risk, looking to hold rather than enjoy a quick turnaround.  Nobody really needs hourly updated price information for an investment they intend to hold for decades. They quote their prices on a daily basis and you take the daily price.  This makes sense for a vehicle that is a balanced collection of many different assets, most of which will have varying prices over the course a day.  That makes pricing complicated.  This primer explains mutual fund pricing and the requirements of the Investment Company Act of 1940, which mandates daily price reporting.  It also illustrates the complexity: How does the fund pricing process work? Mutual fund pricing is an intensive process that takes place in a short time frame at the end of the day. Generally, a fund’s pricing process begins at the close of the New York Stock Exchange, normally 4 p.m. Eastern time. The fund’s accounting agent, which may be an affiliated entity such as the fund’s adviser, or a third-party servicer such as the fund’s administrator or custodian bank, is usually responsible for calculating the share price. The accounting agent obtains prices for the fund’s securities from pricing services and directly from brokers. Pricing services collect securities prices from exchanges, brokers, and other sources and then transmit them to the fund’s accounting agent. Fund accounting agents internally validate the prices received by subjecting them to various control procedures. For example, depending on the nature and extent of its holdings, a fund may use one or more pricing services to ensure accuracy. Note that under Rule 22c-1 forward pricing, fund shareholders receive the next daily price, not the last daily price.  Forward pricing makes sense if you want shareholders to get the most accurate sale or purchase price, but not if you want purchasers and sellers to be able to make precise calculations about gains and losses (how can you be precise if the price won't be known until after you buy or sell?). "No.  And furthermore, canceling based on insider information is not considered insider trading. SEC Interpretation from October of 2000: (a) Does the act of terminating a plan while aware of material nonpublic information result in liability under Section 10(b) and Rule 10b-5? No. Section 10(b) and Rule 10b-5 apply ""in connection with the purchase or sale of any security."" Thus, a purchase or sale of a security must be present for liability to attach. See Blue Chip Stamps v. Manor Drug Stores, 421 U.S. 723 (1975). [link mine] A 10b5-2 is a rule in the SEC's section in federal law that governs trading on ""material nonpublic information."" Fried (2002) even concluded that: The SEC's safe harbour permitting insiders to buy or sell shares pursuant to prearranged trading plans while in possession of material nonpublic information and to cancel the plans while aware of material nonpublic information enables insiders to profit from their access to such information.  The SEC could easily eliminate insider's advantages over public shareholders by not allowing insiders to cancel their plans after becoming aware of material nonpublic information." "If you sell a stock, with no distributions, then your gain is taxable under §1001.  But not all realized gains will be recognized as taxable.  And some gains which are arguably not realized, will be recognized as taxable. The stock is usually a capital asset for investors, who will generate capital gains under §1(h), but dealers, traders, and hedgers will get different treatment.  If you are an investor, and you held the stock for a year or more, then you can get the beneficial capital gain rates (e.g. 20% instead of 39.6%).  If the asset was held short-term, less than a year, then your tax will generally be calculated at the higher ordinary income rates.  There is also the problem of the net investment tax under §1411.  I am eliding many exceptions, qualifications, and permutations of these rules. If you receive a §316 dividend from a stock, then that is §61 income.  Qualified dividends are ordinary income but will generally be taxed at capital gains rates under §1(h)(11).  Distributions in redemption of your stock are usually treated as sales of stock.  Non-dividend distributions (that are not redemptions) will reduce your basis in the stock to zero (no tax due) and past zero will be treated as gain from a sale. If you exchange stock in a tax-free reorganization (i.e. contribute your company stock in exchange for an acquirer's stock), you have what would normally be considered a realized gain on the exchange, but the differential will not be recognized, if done correctly. If you hold your shares and never sell them, but you engage in other dealings (short sales, options, collars, wash sales, etc.) that impact those shares, then you can sometimes be deemed to have recognized gain on shares that were never sold or exchanged. A more fundamental principle of income tax design is that not all realized gains will be recognized.  IRC §1001(c) says that all realized gains are recognized, except as otherwise provided; that ""otherwise"" is substantial and far-ranging." I was not able to find any authority for the opinion you suggest. Wash sale rules should, IMHO, apply. According to the regulations, you attribute the newly purchased shares to the oldest sold shares for the purposes of the calculation of the disallowed loss and cost basis. (c) Where the amount of stock or securities acquired within the 61-day period is less than the amount of stock or securities sold or   otherwise disposed of, then the particular shares of stock or   securities the loss from the sale or other disposition of which is not   deductible shall be those with which the stock or securities acquired   are matched in accordance with the following rule: The stock or   securities acquired will be matched in accordance with the order of   their acquisition (beginning with the earliest acquisition) with an   equal number of the shares of stock or securities sold or otherwise   disposed of. You can resort to the claim that you have not, in fact, entered into the contract within 30 days, but when you gave the instructions to reinvest dividends. I don't know if such a claim will hold, but to me it sounds reasonable. This is similar to the rules re short sales (in (g) there). In this case, wash sale rules will not apply (unless you instructed to reinvest dividends within the 30 days prior to the sale). But I'd ask a tax professional if such a claim would hold, talk to a EA/CPA licensed in your state. "Price is decided by what shares are offered at what prices and who blinks first.  The buyer and seller are both trying to find the best offer, for their definition of best, within the constraints then have set on their bid or ask. The seller will sell to the highest bid they can get that they consider acceptable. The buyer will buy from the lowest offer they can get that they consider acceptable. The price -- and whether a sale/purchase happens at all -- depends on what other trades are still available and how long you're willing to wait for one you're happy with, and may be different on one share than another ""at the same time"" if the purchase couldn't be completed with the single best offer and had to buy from multiple offers. This may have been easier to understand in the days of open outcry pit trading, when you could see just how chaotic the process is... but it all boils down to a high-speed version of seeking the best deal in an old-fashioned marketplace where no prices are fixed and every sale requires (or at least offers the opportunity for) negotiation. ""Fred sells it five cents cheaper!"" ""Then why aren't you buying from him?"" ""He's out of stock."" ""Well, when I don't have any, my price is ten cents cheaper."" ""Maybe I won't buy today, or I'll buy elsewhere. ""Maybe I won't sell today. Or maybe someone else will pay my price. Sam looks interested..."" ""Ok, ok. I can offer two cents more."" ""Three. Sam looks really interested."" ""Two and a half, and throw in an apple for Susie."" ""Done."" And the next buyer or seller starts the whole process over again. Open outcry really is just a way of trying to shop around very, very, very fast, and electronic reconciliation speeds it up even more, but it's conceptually the same process -- either seller gets what they're asking, or they adjust and/or the buyer adjusts until they meet, or everyone agrees that there's no agreement and goes home." "As Dilip said, if you want actual concrete, based in tax law, answers, please add the country (and if applicable, state) where you pay income tax. Also, knowing what tax bracket you're in would help as well, although I certainly understand if you're not comfortable sharing that. So, assuming the US... If you're in the 10% or 15% tax bracket, then you're already not paying any federal tax on the $3k long term gain, so purposely taking losses is pointless, and given that there's probably a cost to taking the loss (commission, SEC fee), you'd be losing money by doing so. Also, you won't be able to buy back the loser for 31 days without having the loss postponed due to the wash sale that would result. State tax is another matter, but (going by the table in this article), even using the highest low end tax rate (Tennessee at 6%), the $50 loss would only save you $3, which is probably less than the commission to sell the loser, so again you'd be losing money. And if you're in a state with no state income tax, then the loss wouldn't save you anything on taxes at the state level, but of course you'll still be paying to be able to take the loss. On the high end, you'd be saving 20% federal tax and 13.3% state tax (using the highest high end tax state, California, and ignoring (because I don't know :-) ) whether they tax long-term capital gains at the same rate as regular income or not), you'd be saving $50 * (20% + 13.3%) = $50 * 33.3% = $16.65. So for taxes, you're looking at saving between nothing and $16.65. And then you have to subtract from that the cost to achieve the loss, so even on the high end (which means (assuming a single filer)) you're making >$1 million), you're only saving about $10, and you're probably actually losing money. So I personally don't think taking a $50 loss to try to decrease taxes makes sense. However, if you really meant $500 or $5000, then it might (although if you're in the 10-15% brackets in a no income tax state, even then it wouldn't). So the answer to your final question is, ""It depends."" The only way to say for sure is, based on the country and state you're in, calculate what it will save you (if anything). As a general rule, you want to avoid letting the tax tail wag the dog. That is, your financial goal should be to end up with the most money, not to pay the least taxes. So while looking at the tax consequences of a transaction is a good idea, don't look at just the tax consequences, look at the consequences for your overall net worth." If you are calculating: keep in mind that company A probably also sells washers, dryers, stoves, dish washers.... Each of which has their own market size. Also remember that people pay X times the value of earnings per share, so the value depends not on sales but on earnings, and expected growth.