Extended hours (eh=1), by exchange
Stock brokers run sessions before and after the regular market day. eh=1 asks the broker to let your order work in them. Autoview accepts eh=1 on every exchange, but only three brokers read it: Alpaca, Charles Schwab and TradeStation. On every other exchange the order goes out exactly as it would without it.
This page comes from the Autoview integrations code that runs on our servers today. We read the code; we did not send these orders live for this guide.
What each broker gets
| Broker | Without eh=1 | With eh=1 |
|---|---|---|
| Alpaca | Regular hours, good till cancelled by default | Marked for extended hours, and the time in force becomes day |
| Charles Schwab | Session NORMAL | Schwab's extended-hours session |
| TradeStation | Duration GTC, or GTD with dt= | Duration GCP, or GDP with dt= |
| Everyone else | The usual order | Not read, same as without it |
eh=1 only switches on with the value 1. eh=true is read as off.
Broker by broker
- Alpaca. With
eh=1, Autoview sets Alpaca's extended hours flag and makes the order a day order. That happens after it readstif=andt=iocort=fok, so those are replaced. Alpaca's order docs say only limit orders with a time in force of day or gtc can trade in extended hours, and other orders are rejected. So keep the order a limit: at=marketline, or asl=,tp=orts=line on its own (Autoview sends those as a stop or trailing stop), will be turned away witheh=1. Inside a bracket (sl=withtp=, oroco=oroto=) Autoview does not readeh=at all. See Alpaca bracket orders. - Charles Schwab. Autoview changes the order's session from NORMAL, regular hours, to Schwab's extended-hours session value. The duration does not change: good till cancelled by default, or fill or kill and immediate or cancel with
t=fokandt=ioc. Schwab's API also lists a morning-only (AM) and an evening-only (PM) session; Autoview has no way to pick those. - TradeStation. Autoview swaps the default good-till-cancelled duration (GTC) for TradeStation's extended-session one (GCP), and with
dt=it swaps good-till-date (GTD) for GDP.t=fokandt=iocreplace the duration with FOK or IOC, soeh=1has no effect on those. The stop loss and take profit orders Autoview attaches to an entry are always sent as GTC, without the extended-session duration. See order expiry (dt=) by exchange for the date form.
Alpaca lists its extended sessions as pre-market from 4:00am to 9:30am ET and after-hours from 4:00pm to 8:00pm ET, Monday to Friday, plus an overnight session from 8:00pm to 4:00am ET, Sunday to Friday. Schwab and TradeStation set their own hours, so check with your broker before you plan around them.
Closing a position after hours
c=position builds the closing order from your whole command, so eh=1 on the close line reaches the closing order too, on all three brokers. On Alpaca the same rule applies: make the close a limit.
e=alpaca s=AAPL b=buy q=10 p=-0.5% eh=1 d=1That is a limit buy of 10 AAPL shares half a percent under the current price, marked for extended hours, as a d=1 test.
Test it once before you rely on it
Add d=1 and send the line. The log shows the order Autoview would send. On Alpaca, check it is a limit with a day time in force. On TradeStation, check the duration reads GCP or GDP. For the time in force options, see IOC and FOK orders by exchange.