
Trade Order Entry API
Examples for GUI API:
Stock Orders:
http://www.optionsxpress.com/trade_order_outside.asp?TIF=GTC&Symbol=MSFT&QTY=10&AON=true&Pricetype=stp&StopPrice=20.5&UserName=dev&Password=dev&Action=SELL&strategy_type=stock
Option Orders:
http://www.optionsxpress.com/trade_order_outside.asp?TIF=GTC&Symbol=.CYQGH&QTY=10&AON=true&Pricetype=mkt&UserName=dev&Password=dev&Action=BTO&strategy_type=option
Combo Orders:
http://www.optionsxpress.com/trade_order_outside.asp?TIF=GTC&Symbol=.AOLGH&symbol=.AOLGF&QTY=5&QTY=10&AON=true&Pricetype=Debit&LimitPrice=2.5&UserName=dev&Password=dev&Action=SELL&strategy_type=spread
Username/Password Order:
http://www.optionsxpress.com/trade_order_outside.asp?TIF=GTC&Symbol=.CYQGH&QTY=10&AON=true&Pricetype=mkt&UserName=dev&Password=dev&Action=BTO&strategy_type=option
Session Order:
http://www.optionsxpress.com/trade_order_outside.asp?TIF=GTC&Symbol=.CYQGH&QTY=10&AON=true&Pricetype=mkt&sessionId=1234567891011111&Action=BTO&strategy_type=option
Examples for XML API:
Get OX Session:
https://oxbranch.optionsxpress.com/accountservice/account.asmx/GetOxSession?sUserName=user&sPassword=opxs&sSessionID=
Get OX Session:
https://oxbranch.optionsxpress.com/accountservice/account.asmx/GetOxSession?sUserName=user&sPassword=opxs&sSessionID=
Get OX Balances:
https://oxbranch.optionsxpress.com/accountservice/account.asmx/GetCustBalance?sSessionID=15637BC3331E4458BD02EFF514041B
Get OX Orders:
https://oxbranch.optionsxpress.com/accountservice/account.asmx/GetCustOrders?sSessionID=15637BC3331E4458BD02EFF514041BAD&sStartDate=01%2F01%2F2003&sEndDate=01%2F29%2F2003
Place Stock Trade:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceStockOrder?sSessionID=15637BC3331E4458BD02EFF514041BAD&sSymbol=csco&sAction=buy&dQty=1&sTIF=day&bAON=true&sOrderType=lmt&dLimitPrice=1&dStopPrice=0
Place Spread Trade:
https://oxbranch.optionsxpress.com/accountservice/Order.asmx/PlaceSpreadOrder?sSessionID=2856859C0290468284F030CFD863D739&sSymbol=.QAVBP&sSymbol=.QAVBR&sAction=bto&sAction=sto&dQty=1&dQty=1&sTIF=day&sOrderType=debit&dLimitPrice=1
Place Option Order with Route:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceOptionOrderWithRoute?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=.RCVGC&sAction=BTO&dQty=7&sTIF=day&bAON=False&sOrderType=LIMIT&dLimitPrice=0.05&dStopPrice=0&sRoute=CBOE
Place Extended Hours Order:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceExtendedHoursOrder?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=csco&sAction=buy&dQty=17&dLimitPrice=12.3
Place Contingent Stock Order:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceContingentStockOrder?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=CSCO&sAction=Buy&dQty=100&sTIF=day&bAON=True&sOrderType=LIMIT&dLimitPrice=2&dStopPrice=0&sContingentSymbol=MSFT&sContingentDirection=greater&dContingentPrice=99&sContingentTrigger=bid&sContingentTIF=GTC&bContingentTime=True&sContingentBeginTime=09:30&sContingentEndTime=16:00&dBufferedLimit=0
Place Contingent Option Order:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceContingentOptionOrder?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=.RCVLB&sAction=BTO&dQty=7&sTIF=DAY&bAON=FALSE&sOrderType=LIMIT&dLimitPrice=2&dStopPrice=0&sContingentSymbol=RHAT&sContingentDirection=less&dContingentPrice=1&sContingentTrigger=bid&sContingentTIF=GTC&bContingentTime=True&sContingentBeginTime=10:00&sContingentEndTime=15:30&dBufferedLimit=0
Place Trailing Stop Stock Order:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceTrailingStopStockOrder?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=XMSR&sAction=Buy&dQty=23&sTIF=DAY&bAON=FALSE&sOrderType=MKT&dLimitPrice=0&dStopPrice=0&sTrailSymbol=T&sTrailDirection=up&dTrailAmount=4&sTrailType=POINT&sTrailTrigger=ask&sTrailTIF=GTC&bTrailTime=True&sTrailBeginTime=09:30&sTrailEndTime=16:00&dBufferedLimit=0
Place Trailing Stop Option Order:
https://oxbranch.optionsxpress.com/accountservice/order.asmx/PlaceTrailingStopOptionOrder?sSessionID=6A20C95C2D004536AC28EFC32A3374A6&sSymbol=.rcvsd&sAction=BTO&dQty=7&sTIF=DAY&bAON=FALSE&sOrderType=LIMIT&dLimitPrice=0.2&dStopPrice=0&sTrailSymbol=IBM&sTrailDirection=down&dTrailAmount=6&sTrailType=POINT&sTrailTrigger=ask&sTrailTIF=GTC&bTrailTime=True&sTrailBeginTime=12:00&sTrailEndTime=14:00&dBufferedLimit=0
URL Parameters and Acceptable Values:
1. symbol = <any valid stock or option symbol> (e.g. MSFT, .CYQGH)
2. username = <a valid optionsXpress username>
3. password = <a valid optionsXpress password>
4. sessionId = <a valid optionsXpress session>
5. pricetype =
a. limit
b. stop
c. mkt
d. stop_limit
e. debit
f. credit
6. limitPrice = <valid price value> (e.g. 50.5)
7. stopPrice = <valid price value> (e.g. 50.5)
8. TIF (Time In Force):
a. DAY – Day Order
b. GTC – Good Until Cancelled
9. AON (All or Nothing):
a. True
b. FALSE
10. qty = number of stock/options to buy
11. strategy_type =
a. STOCK – stock order, 1 stock symbol/action/qty only.
b. OPTION – option order, 1 options symbol/action/qty only.
c. SPREAD – spread strategy, 2 stock or options symbol/action/qty sets. The first action value must be (BTO) and second action value must be (STO).
d. STRADDLE – spread strategy, 2 options symbol/action/qty sets. One symbol must be a put and the other symbol must be a call. Both action values must be the same.
e. COVERED_CALL – covered call strategy, 1 stock symbol/action/qty set and one options symbol/action/qty set. If the stock is being sold (action=SELL) then the options must be Buy To Close (action=BTC). If the stock is being bought (action=BUY) then the options must be Sell To Open (action=STO).
f. BUTTERFLY – spread strategy, 3 options symbol/action/qty sets.
g. COLLAR – spread strategy, 1 symbol/action/qty set and 2 options symbol/action/qty sets.
h. MUTUAL_FUND - mutual fund order, one mutual fund symbol/action/qty only.
12. action =
a. BTO – Buy to Open
b. STO – Sell to Open
c. BTC – Buy to Close
d. STC – Sell to Close
e. BUY – Buy
f. SELL – Sell
g. SHRT – Sell Short
* For combo orders you need to pass two or three “action”, “qty”, “symbol” parameters.
* For limit orders supply “LimitPrice”
* For stop orders supply “StopPrice”
* For combo orders supply “PriceType” parameter as “MKT”, “DEBIT” or “CREDIT”
* For “DEBIT” and “CREDIT” orders supply “LimitPrice”.
Test Account should supply “dev” for Username and “dev” for Password or a valid session for Session
For Place Option with Route
13. Route =
a. NBBO
b. CBOE or RAZ
c. AMEX or AMO
d. PSE or POE
e. PHLX or ATM
f. ISE
g. BOX
For Contingent / Trailing Stop Orders
14. Contingent/ Trail Symbol = <any valid stock or option symbol> (e.g. MSFT, .CYQGH)
15. Contingent Direction =
a. greater
b. less
16. Trail Direction =
a. up
b. down
17. Contingent Price / Trail Amount = <any value greater than 0>
18. Contingent / Trail TIF
a. DAY – Day Order
b. GTC – Good Until Cancelled
19. Contingent Price Type / Trail Trigger
a. std - Standard
b. bid
c. ask
d. last
20. Contingent/Trail Time (Use the begin and end contingent times)
a. True
b. False
21. Contingent /Trail Begin Time and End Time = Should be 5 characters eastern time in the form xx:xx.
For example 10:30, 14:30, etc. Begin Time most be prior to end time and in the range 09:30 to 16:15
22. TrailType =
a.Point
b.Percent
23. Buffered Limit = <Any valid positive number>
No comments:
Post a Comment