Wash sale rule question
Yes. On December 10, you have a wash sale. As long as you don't buy the stock back for 30 days after that, the wash is of no consequence. In other words, you don't have a wash issue if you don't own the stock for 30 days.
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. "Generally if you are using FIFO (first in, first out) accounting, you will need to match the transactions based on the number of shares. In your example, at the beginning of day 6, you had two lots of shares, 100 @ 50 and 10 @ 52.  On that day you sold 50 shares, and using FIFO, you sold 50 shares of the first lot.  This leaves you with 50 @ 50 and 10 @ 52, and a taxable capital gain on the 50 shares you sold. Note that commissions incurred buying the shares increase your basis, and commissions incurred selling the shares decrease your proceeds.  So if you spent $10 per trade, your basis on the 100 @ 50 lot was $5010, and the proceeds on your 50 @ 60 sale were $2990.  In this example you sold half of the lot, so your basis for the sale was half of $5010 or $2505, so your capital gain is $2990 - 2505 = $485. The sales you describe are also ""wash sales"", in that you sold stock and bought back an equivalent stock within 30 days.  Generally this is only relevant if one of the sales was at a loss but you will need to account for this in your code.  You can look up the definition of wash sale, it starts to get complex. If you are writing code to handle this in any generic situation you will also have to handle stock splits, spin-offs, mergers, etc. which change the number of shares you own and their cost basis.  I have implemented this myself and I have written about 25-30 custom routines, one for each kind of transaction that I've encountered.  The structure of these deals is limited only by the imagination of investment bankers so I think it is impossible to write a single generic algorithm that handles them all, instead I have a framework that I update each quarter as new transactions occur." Brokerage->Brokerage 13-16 The loss from the previous purchase will be added to the cost basis of the security for the second purchase. Since you sold it at a loss again it would increase your losses. Your loss from the first sale will be disallowed. Your loss will be added to the cost basis of the next purchase. Your gains will be taxed on the total of the cost basis which will reduce your gains. Which you will taxed 'less'. Your gains will be taxed. Your loss is allowed. You will be taxed on both.  Wash Sales really only applies to losses. If you sell for gain, the tax man will be happy to take his share. From my understanding, it does not matter if it is IRA or Brokerage, the wash sale rule affects them all. Check this link: http://www.marketwatch.com/story/understanding-the-wash-sale-rules-2015-03-02 "From Pub 550: More or less stock bought than sold.   If the number of shares of   substantially identical stock or securities you buy within 30 days   before or after the sale is either more or less than the number of   shares you sold, you must determine the particular shares to which the   wash sale rules apply. You do this by matching the shares bought with   an equal number of the shares sold. Match the shares bought in the   same order that you bought them, beginning with the first shares   bought. The shares or securities so matched are subject to the wash   sale rules. You must match ""beginning with the first shares bought."" If only activity 1 & 4 happened, you'd have bought and sold stock with no wash sale. If you remove activity 1 & 4 from consideration because they are a ""normal"" or non-wash sale transaction, then the Activity 2 or Activity 3 trigger a wash sale. The shares in lot 1 are sold for disallowed loss, so the disallowed basis would be added to shares in lot 2 because lot 2 was purchased before lot 3. (hat tip to user662852 who had much better wording) Second example: Activity 5, 7, and 8 all together would not be a wash sale.   The addition of activity 6 creates a wash sale. The shares in Activity 5 are sold for a disallowed loss in Activity 7 & 8 because of the wash sale triggering purchase in Activity 6.   Activity 6 is where you add the disallowed basis because they are the ""first shares bought"" that cause the wash sale rule to be triggered." Great question! It can be a confusing for sure -- but here's a great example I've adapted to your scenario: As a Day Trader, you buy 100 shares of LMNO at $100, then after a large drop the same day, you sell all 10 shares at $90 for a loss of $1,000. Later in the afternoon, you bought another 100 shares at $92 and resold them an hour later at $97 (a $500 profit), closing out your position for the day. The second trade had a profit of $500, so you had a net loss of $500 (the $1,000 loss plus the $500 profit).  Here’s how this works out tax-wise: The IRS first disallows the $1,000 loss and lets you show only a profit of $500 for the first trade (since it was a wash). But it lets you add the $1,000 loss to the basis of your replacement shares. So instead of spending $9,200 (100 shares times $92), for tax purposes, you spent $10,200 ($9,200 plus $1,000), which means that the second trade is what caused you to lose the $500 that you added back (100 x $97 = $9,700 minus the 100 x $102 = $10,200, netting $500 loss). On a net basis, you get to record your loss, it just gets recorded on the second trade. The basis addition lets you work off your wash-sale losses eventually, and in your case, on Day 3 you would recognize a $500 final net loss for tax purposes since you EXITED your position. Caveat: UNLESS you re-enter LMNO within 30 days later (at which point it would be another wash and the basis would shift again). Source: http://www.dummies.com/personal-finance/investing/day-trading/understand-the-irs-wash-sale-rule-when-day-trading/ "Edited: Pub 550 says 30 days before or after so the example is ok - but still a gain by average share basis.  On sale your basis is likely defaulted to ""average price"" (in the example 9.67 so there was a gain selling at 10), but can be named shares at your election to your brokerage,  and supported by record keeping. A Pub 550 wash might be buy 2000 @ 10 with basis 20000, sell 1000 @9 (nominally a loss of 1000 for now and remaining basis 10000), buy 1000 @ 8 within 30 days.   Because of the wash sale rule the basis is 10000+8000 paid + 1000 disallowed loss from wash sale with a final position of 2000 shares at 19000 basis.  I think I have the link at the example:  http://www.irs.gov/publications/p550/ch04.html#en_US_2014_publink100010601" How about a third approach: Figure the buyout as above. Figure what percentage of the value of the house the buyout constitutes. When the house sells the other party gets that percentage of the sales price. A stop-loss does not guarantee a sale at the given price; it just automatically triggers an unlimited sale as soon as the market reaches the limit. Depending on the development, your sale could be right at, slightly under, or deeply under the stop-loss limit you gave - it could even be it is never executed, if there are no further deals. The point is that each sell needs a partner that buys for that price, and if nobody is buying, no sale happens, no matter what you do (automated or manually) - your stop loss cannot 'force' a sale. Stop-loss works well for minor corrections in liquid shares; it becomes less useful the less liquid a share is, and it will not be helpfull for seldomly traded shares. Firstly 795 is not even. Secondly - generally you would pay tax on the sale of the 122 shares, whether you buy them back or not, even one minute later, has nothing to do with it. The only reason this would not create a capital gains event is if your country (which you haven't specified) has some odd rules or laws about this that I, and most others, have never heard of before. You add the wash sale loss to your cost basis for the other transaction so you would have two entries in your schedule d reporting 1.) Listing the $2000 loss as a wash 2.) The cost basis for your second transaction is thus $1000+$2000 = $3000 so when it was sold for $2000 you now have a reportable loss of $1000. For more information see here.... http://www.ehow.com/how_5313540_calculate-wash-sale.html How come when I sell stocks, the brokerage won't let me cash out for three days, telling me the SEC requires this clearance period for the transaction to clear, but they can swap shit around in under a second?   Be interesting to see what would happen if *every* transaction wasn't cleared until the closing bell. Is wash rule applicable for this? No - because you made a gain on the sale.  You paid $13,500 for the stock and sold it for $14,250.   The wash rule prevents you from claiming a loss if you buy the same stock again within 30 days.  You have no loss to claim, so the rule does not apply. In addition to the adjustment type in NL7's answer, there are a host of others.  If there are any adjustments, form 8949 is required, if not, the gains can be separated into short and long-term and added together to be entered on Schedule D.  Anything requiring an adjustment code in column F of the 8949 requires an entry in column G.   Some other example entries for column F include: (see the 8949 instructions for a complete list) **A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you: Buy substantially identical stock or securities, Acquire substantially identical stock or securities in a fully taxable trade, Acquire a contract or option to buy substantially identical stock or securities, or Acquire substantially identical stock for your individual retirement account (IRA) or Roth IRA. (from Pub17) "The wash sale rule only applies when the sale in question is at a loss.  So the rule does not apply at all to your cases 3, 4, 7, 8, 11, 12, 15, and 16, which all start with a gain.  You get a capital gain at the first sale and then a separately computed gain / loss at the second sale, depending on the case, BUT any gain or loss in the IRA is not a taxable event due to the usual tax-advantaged rules for the IRA. The wash sale does not apply to ""first"" sales in your IRA because there is no taxable gain or loss in that case.  That means that you wouldn't be seeking a deduction anyway, and there is nothing to get rolled into the repurchase. This means that the rule does not apply to 1-8.  For 5-8, where the second sale is in your brokerage account, you have a ""usual"" capital gain / loss as if the sale in the IRA didn't happen. (For 1-4, again, the second sale is in the IRA, so that sale is not taxable.) What's left are 9-10 (Brokerage -> IRA) and 13-14 (Brokerage -> Brokerage).   The easier two are 13-14.  In this case, you cannot take a capital loss deduction for the first sale at a loss.  The loss gets added to the basis of the repurchase instead.  When you ultimately close the position with the second sale, then you compute your gain or loss based on the modified basis.  Note that this means you need to be careful about what you mean by ""gain"" or ""loss"" at the second sale, because you need to be careful about when you account for the basis adjustment due to the wash sale. Example 1: All buys and sells are in your brokerage account.  You buy initially at $10 and sell at $8, creating a $2 loss.  But you buy again within the wash sale window at $9 and sell that at $12.  You get no deduction after the first sale because it's wash.  You have a $1 capital gain at the second sale because your basis is $11 = $9 + $2 due to the $2 basis adjustment from wash sale. Example 2: Same as Example 1, except that final sale is at $8 instead of at $12.  In this case you appear to have taken a $2 loss on the first buy-sell and another $1 loss on the second buy-sell.  For taxes however, you cannot claim the loss at the first sale due to the wash.  At the second sale, your basis is still $11 (as in Example 1), so your overall capital loss is the $3 dollars that you might expect, computed as the $8 final sale price minus the $11 (wash-adjusted) basis. Now for 9-10 (Brokerage->IRA), things are a little more complicated.  In the IRA, you don't worry about the basis of individual stocks that you hold because of the way that tax advantages of those accounts work.  You do need to worry about the basis of the IRA account as a whole, however, in some cases.  The most common case would be if you have non-deductable contributions to your traditional IRA.  When you eventually withdraw, you don't pay tax on any distributions that are attributable to those nondeductible contributions (because you already paid tax on that part).  There are other cases where basis of your account matters, but that's a whole question in itself - It's enough for now to understand 1. Basis in your IRA as a whole is a well-defined concept with tax implications, and 2. Basis in individual holdings within your account don't matter. So with the brokerage-IRA wash sale, there are two questions:  1. Can you take the capital loss on the brokerage side?  2. If no because of the wash sale, does this increase the basis of your IRA account (as a whole)?  The answer to both is ""no,"" although the reason is not obvious. The IRS actually put out a Special Bulletin to answer the question specifically because it was unclear in the law. Bottom line for 9-10 is that you apparently are losing your tax deduction completely in that case. In addition, if you were counting on an increase in the basis of your IRA to avoid early distribution penalties, you don't get that either, which will result in yet more tax if you actually take the early distribution. In addition to the Special Bulletin noted above, Publication 550, which talks about wash sale rules for individuals, may also help some." "It sounds like this is an entirely unsettled question, unfortunately.  In the examples you provide, I think it is safe to say that none of those are 'substantially identical'; a small overlap or no overlap certainly should not be considered such by a reasonable interpretation of the rule. This article on Kitces goes into some detail on the topic.  A few specifics. First, Former publication 564 explains: Ordinarily, shares issued by one mutual fund are not considered to be substantially identical to shares issued by another mutual fund. Of course, what ""ordinarily"" means is unspecified (and this is no longer a current publication, so, who knows). The Kitces article goes on to explain that the IRS hasn't really gone after wash sales for mutual funds: Over the years, the IRS has not pursued wash sale abuses against mutual funds, perhaps because it just wasn’t very feasible to crack down on them, or perhaps because it just wasn’t perceived as that big of an abuse. After all, while the rules might allow you to loss-harvest a particular stock you couldn’t have otherwise, it also limits you from harvesting ANY losses if the overall fund is up in the aggregate, since losses on individual stocks can’t pass through to the mutual fund shareholders. But then goes to explain about ETFs being very different: sell SPY, buy IVV or VTI, and you're basically buying/selling the identical thing (99% or so correlation in stocks owned).   The recommendation by the article is to look at the correlation in owned stocks, and stay away from things over 95%; that seems reasonable in my book as well. Ultimately, there will no doubt be a large number of “grey” and murky situations, but I suspect that until the IRS provides better guidance (or Congress rewrites/updates the wash sale rules altogether!), in the near term the easiest “red flag” warning is simply to look at the correlation between the original investment being loss-harvested, and the replacement security; at correlations above 0.95, and especially at 0.99+, it’s difficult to argue that the securities are not ”substantially identical” to each other in performance. Basically - use common sense, and don't do anything you think would be hard to defend in an audit, but otherwise you should be okay."