You have to have trader status first:
Special rules apply if you're a trader in securities, in the business of buying and selling securities for your own account. The law considers this to be a trade or business, even though a trader doesn't maintain an inventory and doesn't have customers. To be engaged in business as a trader in securities, you must meet all of the following conditions:
- You must seek to profit from daily market movements in the prices of securities and not from dividends, interest, or capital appreciation;
- Your activity must be substantial; and
- You must carry on the activity with continuity and regularity.
The following facts and circumstances should be considered in determining if your activity is a securities trading business:
- Typical holding periods for securities bought and sold;
- The frequency and dollar amount of your trades during the year;
- The extent to which you pursue the activity to produce income for a livelihood; and
- The amount of time you devote to the activity.