# Impact of wash sale tax rule on Algo Day trading

**URL:** <https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913>\
**Category:** Alpaca Trading\
**Created:** [March 11, 2021, 11:52pm UTC](https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913 "2021-03-11T23:52:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Abh](https://forum.alpaca.markets/u/Abh)\
**Post date:** [March 11, 2021, 11:52pm UTC](https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913/1 "2021-03-11T23:52:15Z")

</div>

I recently learned about wash sale tax rule.

> **[Wash-Sale Rule: Stopping Taxpayers From Claiming Artificial Losses](https://www.investopedia.com/terms/w/washsalerule.asp)**
>
> The wash-sale rule is a regulation that prohibits a taxpayer from claiming a loss on the sale and repurchase of identical stock.

And I am bit confuse, so can someone clarify if I have to pay tax on all profit trades or net profit?  
To simplify my question, let say I buy and sell 100 stocks 10 times in a day.  
All LONG, 10 entry 10 exit alternately.  
Start of the day I have 0 stock, and end of the day I have 0 stock.  
Out of these 10 trades, 5 trades are profitable and 5 are not. Let say I made 10$ in each profitable trade and lost 5$ in each non-profitable trade.  
Profit only trade profit = 5\*10 = 50$  
Non-profit trade loss = 5\*5 = 25$

Net profit= 50 - 25 = 25$  
Will I pay tax on net profit 25$ or on 50$?

---

<div class="post-metadata">

**Author:** ![Angelo\_Mendonca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/angelo_mendonca/32/6995_2.png) [@Angelo\_Mendonca](https://forum.alpaca.markets/u/Angelo_Mendonca)\
**Post date:** [June 27, 2026, 4:21pm UTC](https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913/2 "2026-06-27T16:21:23Z")

</div>

@Dan_Whitnable_Alpaca is there someone who can answer this question?

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [June 29, 2026, 4:52pm UTC](https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913/3 "2026-06-29T16:52:40Z")

</div>

@Angelo_Mendonca taxes are paid on net profit. More specifically, the capital gain/loss is calculated as below:

```auto
Capital_Gain/Loss = Gross_Proceeds (Sale_Price) - Selling_Cost - Cost_Basis

```

Selling costs would be commissions (if you pay them) and any regulatory fees. Cost basis can be a bit involved, but it is essentially anything you paid minus any buying costs. Alpaca uses two calculations for cost basis. Weighted Average is used for intraday positions (positions from intraday trades). Compressed FIFO is used for the end-of-day positions (positions from previous trading days). There is an in-depth article on how Alpaca calculates cost basis[here in the docs](https://docs.alpaca.markets/us/docs/position-average-entry-price-calculation#which-method-is-alpaca-using).

Since the original title of this post asked about the “impact of wash sale tax rule”, I’ll explain a bit about that.

A wash sale is an IRS rule that disallows a tax deduction for a loss on the sale of a stock if you buy a “substantially identical” asset within 30 days. This only applies to losses. If you always have a profit you don’t need to worry about wash sales. However, if your capital gain is negative (ie a loss) and within 30 days you open another position in the same or “substantially” the same stock, then that loss will be disallowed for now, but you effectively get it back later. Maybe do a web search for “wash sale” to find out more. Note that this is separate and different from a “wash trade”.

---

<div class="post-metadata">

**Author:** ![Angelo\_Mendonca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/angelo_mendonca/32/6995_2.png) [@Angelo\_Mendonca](https://forum.alpaca.markets/u/Angelo_Mendonca)\
**Post date:** [June 30, 2026, 12:36am UTC](https://forum.alpaca.markets/t/impact-of-wash-sale-tax-rule-on-algo-day-trading/4913/4 "2026-06-30T00:36:11Z")

</div>

@Dan_Whitnable_Alpaca thank you for that link. I got it…
