# Avoid Day Trading

**URL:** <https://forum.alpaca.markets/t/avoid-day-trading/292>\
**Category:** Alpaca Integration Applications\
**Created:** [September 20, 2019, 3:24am UTC](https://forum.alpaca.markets/t/avoid-day-trading/292 "2019-09-20T03:24:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnycodekiller](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@johnnycodekiller](https://forum.alpaca.markets/u/johnnycodekiller)\
**Post date:** [September 20, 2019, 3:24am UTC](https://forum.alpaca.markets/t/avoid-day-trading/292/1 "2019-09-20T03:24:17Z")

</div>

Hello everyone!

I am currently writing my buying and selling functions and need some input from everyone else.

So we all know that unless we have a day trading account we cannot buy and then sell a stock in the same day right?  
Because of this, im trying to find the easiest way to check each position i have and make sure a buy order wasnt placed that day.

The only way i see it getting done is taking each position and comparing its order for the filled date and compare that date to today. If its not, then sell away, if it is then hold on.

How is everyone else verifying that a stock is ready for selling?

Thanks,  
John

---

<div class="post-metadata">

**Author:** ![Rathe001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rathe001/32/215_2.png) [@Rathe001](https://forum.alpaca.markets/u/Rathe001)\
**Post date:** [October 28, 2019, 1:38pm UTC](https://forum.alpaca.markets/t/avoid-day-trading/292/2 "2019-10-28T13:38:05Z")

</div>

Yeah, I have a function in my sell conditions to check for this:  
`export const isDayOld = stock => moment().diff(moment(stock.filled_at), 'days') >= 1;`

---

<div class="post-metadata">

**Author:** ![hitoshi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/hitoshi/32/69_2.png) [@hitoshi](https://forum.alpaca.markets/u/hitoshi)\
**Post date:** [October 28, 2019, 4:01pm UTC](https://forum.alpaca.markets/t/avoid-day-trading/292/3 "2019-10-28T16:01:50Z")

</div>

You can now query all the fills of the day using Activities API. Use activity\_type=FILL

> **[Documentation | Alpaca](https://docs.alpaca.markets/api-documentation/api-v2/account-activities/)**
>
> Alpaca API lets you build and trade with real-time market data for free.

Alternative is to use List Order API and check status = “filled” or “partially\_filled”, within the same day and symbol.
