You've successfully subscribed to Alpaca Learn | Developer-First API for Crypto and Stocks
Great! Next, complete checkout for full access to Alpaca Learn | Developer-First API for Crypto and Stocks
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.
  • Home
  • We're hiring
  • Support
  • Forum
  • Docs
  • Log in
  • Sign up

Crypto Trading API is here!

Trading API

How to Enable Stock Market Trading from 4 am to 8 pm ET

George A J Sanders

Standard trading in US equity markets occurs between 9:30 am to 4:00 pm ET Monday to Friday. Extended hours trading occurs before the market opens and after the market closes, allowing market participants to buy and sell securities outside of the traditional session.

With the launch of extended hour trading, you can trade commission-free* US exchange securities according to your schedule and react quickly to after-hours news. By embedding this feature in your app, international end-users can trade during hours convenient to their local time.

What’s going to change?

Effective Thursday February 24, we will roll out the new extended hours offering to users. Previously, Alpaca customers could only trade from 9 am to 6 pm ET - 30 minutes before the opening bell and two hours after the closing bell. With full extended hours, you will be able to trade stocks from 4 am to 8 pm ET Monday to Friday.  During a half day trading session, the extended session is from 4 am to 5pm ET.

Please Note: This extended session is for trading US exchange-listed securities. Crypto trading continues to be available 24/7.

How do I enable extended hours?

There is no change to the API call released for our prior limited extended hours offering. To indicate an order is eligible for extended hours trading, you need to supply a boolean parameter named extended_hours to your order request. When you enable extended hours=true, your order will be eligible for the new full extended hours session.

How to submit a extended hours order via Alpaca web dashboard

To submit an extended order via our web dashboard select Order Type “Limit” and under time in force select “DAY - Extended Hours”.If your limit price is reached during the extended session, it will be filled.

Example of extended hour order request in web dashboard

How to submit an extended hours order via the API?

To participate in extended hours, you must submit a limit order with a time_in_force of day.

Any other order types, including market orders, will be rejected. Also, be aware that as soon as your extended hour order is submitted it will be processed and filled immediately. For instance, if you submit your order at 7 am ET it will be filled shortly and not when the regular market session begins.  

Note that fractional shares** and orders with notional sizes are not available during extended hours trading; orders must be for an integer amount of shares.

Here’s an example of submitting an order which is eligible for extended hours trading, in Python. For more information on our Order API, please see our API documentation here

from alpaca_trade_api.rest import REST

API_KEY = "Your API Key"
SECRET_KEY = "Your Secret Key"

alpaca_client = REST(API_KEY, SECRET_KEY)

alpaca_client.submit_order(symbol="SPY", 
         qty=1, 
         side="buy", 
         type="limit", 
         time_in_force='day'
         extended_hours=True)

What are the risks of extended hours trading?

Compared to a regular market session, there is a risk of limited liquidity in an extended hour trade. This is due to the possibility of less trading volume for some stocks, making it difficult  for buyers and sellers to execute trades. On the other hand, traders may benefit from appealing stock prices during such hours.

There are additional risks associated with extended hours trading, for more information please click here.  

What’s next?

For additional details on how to interact with the API endpoint, please refer to our updated documentation. To test or embed Full Extended Hours into your app, please reach out to sales@alpaca.markets.


*Commission-Free trading means that there are no commission charges for Alpaca self-directed individual cash brokerage accounts that trade U.S. listed securities through an API. Relevant regulatory fees may apply.

**A security being available for fractional share trading is not a recommendation; whether to use fractional shares at all or to invest in any specific security. A security’s eligibility on the list of fractional shares available for trading is not an endorsement of any of the securities, nor is it intended to convey that such securities have low risk. Fractional share transactions are executed either on a principal or riskless principal basis, and can only be bought or sold with market orders during normal market hours.

This article is solely for informational purposes only. Alpaca does not recommend any specific investments or investment strategies. Investments in securities involve the risk of losses and past performance does not guarantee future results. Before investing you should carefully consider your investment objectives, time horizon, and overall risk tolerance as well as the information stated in the product offering prospectuses.

Securities brokerage services are provided by Alpaca Securities LLC (“Alpaca”), member FINRA/SIPC, a wholly-owned subsidiary of AlpacaDB, Inc. Technology and services are offered by AlpacaDB, Inc.

This is not an offer, solicitation of an offer, or advice to buy or sell securities, or open a brokerage account in any jurisdiction where Alpaca is not registered (Alpaca is registered only in the United States).


Trading APIBroker API

George A J Sanders

Principal Product Manager at Alpaca.