# Testing on the weekends

**URL:** <https://forum.alpaca.markets/t/testing-on-the-weekends/13456>\
**Category:** Alpaca Trading\
**Created:** [January 13, 2024, 11:07am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456 "2024-01-13T11:07:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Nelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/steve_nelson/32/4224_2.png) [@Steve\_Nelson](https://forum.alpaca.markets/u/Steve_Nelson)\
**Post date:** [January 13, 2024, 11:07am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/1 "2024-01-13T11:07:39Z")

</div>

I work during normal trading hours and am struggling to test my code. If i place a paper trading order on a Saturday it won’t execute it until monday so I won’t know if my code is working or not.

Is there a way to test my trading coding in offline hours?

---

<div class="post-metadata">

**Author:** ![Steve\_Nelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/steve_nelson/32/4224_2.png) [@Steve\_Nelson](https://forum.alpaca.markets/u/Steve_Nelson)\
**Post date:** [January 13, 2024, 11:17am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/2 "2024-01-13T11:17:32Z")

</div>

What would be really helpful is to be able to simulate a timestamp in the trade execution. Maybe if that timestamp was left out it would treat it as “now”. But if the timestamp was included, then it would place the order at that datetime so the code could be backtested with the paper trading system.

---

<div class="post-metadata">

**Author:** ![Reto4](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/reto4/32/5099_2.png) [@Reto4](https://forum.alpaca.markets/u/Reto4)\
**Post date:** [January 16, 2024, 8:51am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/3 "2024-01-16T08:51:12Z")

</div>

I struggle with the same. A 24/7 simulated exchange including simulated trade/quote streams would be very helpful (would only have to be one or two stocks).

---

<div class="post-metadata">

**Author:** ![rossjeremyd](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rossjeremyd](https://forum.alpaca.markets/u/rossjeremyd)\
**Post date:** [January 16, 2024, 8:42pm UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/4 "2024-01-16T20:42:14Z")

</div>

This is why I do my testing with crypto

---

<div class="post-metadata">

**Author:** ![Vejas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/vejas/32/5508_2.png) [@Vejas](https://forum.alpaca.markets/u/Vejas)\
**Post date:** [January 18, 2024, 6:54pm UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/5 "2024-01-18T18:54:56Z")

</div>

How do you impelement crypto trading when trading with on trading iteration function, since it sais that market is currently closed.

---

<div class="post-metadata">

**Author:** ![Poligun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/poligun/32/5781_2.png) [@Poligun](https://forum.alpaca.markets/u/Poligun)\
**Post date:** [January 19, 2024, 1:12am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/6 "2024-01-19T01:12:28Z")

</div>

I’m not sure if it’s even possible to implement because there are so many bits / time series which Alpaca probably don’t store for replay (e.g. NBBO, whether a stock is shortable at a given time). Not to mention if your strategy depends on historical data then in a “replay mode” setup you could easily peek into the future if the timestamps are not handled properly.

Or you are just trying to see if your trade bot interacts with the API correctly and handle edge cases?

---

<div class="post-metadata">

**Author:** ![Vejas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/vejas/32/5508_2.png) [@Vejas](https://forum.alpaca.markets/u/Vejas)\
**Post date:** [January 21, 2024, 10:58am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/7 "2024-01-21T10:58:46Z")

</div>

No, I’m using lumibot and it’s Strategy method. The problem with it is, that I cannot trade on the weekends since it’s on\_trading\_iteration function only works when market is opened, no matter what you want to trade. Any alternatives, so that I can trade crypto on the weekends using alpaca API?

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [May 8, 2024, 12:45am UTC](https://forum.alpaca.markets/t/testing-on-the-weekends/13456/8 "2024-05-08T00:45:34Z")

</div>

replay the tape, use the price, other data from each sec that you save i use finviz then replay it into your scripts
