¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Is it possible to place order at 15:59 or 16:00 and get a fill?

 

I am currently using this code to do my trades as bracket orders. I need my trades to exit by the end of the day. Is it possible to place a limit or market order at 15:59 or 16:00 and have it continue trading after market hours to get the fill using this?

def BracketOrder(self, parentOrderId:int, openinglimitPrice:float, quantity:Decimal, trailingPercent:float, timeswitch:str, adaptive_type:str):

# 1st part: Buy Adaptive Algo order
opening = Order()
opening.orderId = parentOrderId
opening.action = "BUY"
opening.orderType = "LMT"
opening.lmtPrice = openinglimitPrice
opening.totalQuantity = abs(quantity)
opening.transmit = False
opening.tif = 'GTC'
algo.FillAdaptiveParams(opening, adaptive_type)

timeCondition = TimeCondition()
timeCondition.time = timeswitch
timeCondition.isMore = True
opening.conditions.append(timeCondition)

# 2nd part: Trailing Stop Sell order
trailingStopLoss = Order()
trailingStopLoss.orderId = opening.orderId + 1
trailingStopLoss.action = "SELL"
trailingStopLoss.trailingPercent = trailingPercent
trailingStopLoss.orderType = "TRAIL"
trailingStopLoss.totalQuantity = abs(quantity)
trailingStopLoss.parentId = parentOrderId
trailingStopLoss.tif = "GTC"
trailingStopLoss.transmit = False

# 3rd part: Sell Market order
closing = Order()
closing.orderId = opening.orderId + 2
closing.action = "SELL"
closing.orderType = "MKT"
closing.totalQuantity = abs(quantity)
closing.parentId = parentOrderId
closing.tif = "GTC"
closing.goodAfterTime = timeswitch
closing.transmit = True
closing.conditionsCancelOrder = False 

timeCondition = TimeCondition()
timeCondition.time = timeswitch
timeCondition.isMore = True
closing.conditions.append(timeCondition)

bracketOrder = [opening, trailingStopLoss, closing]
return bracketOrder


Re: Error when requesting 20 years of price data for specific ticker [CHTR]

 

May I guess that the reason for the difference in CHTR prices?between Island and Smart in the last pair of screenshots must be that the prices quoted are for very different dates - 2010 vs 2009...
--
Best,
DS


Re: Error when requesting 20 years of price data for specific ticker [CHTR]

 

Interesting!
You probably noticed on your example that recent days are way more similar (identical)
The reason a close differ to an adjusted close are generally fix values (div/split etc ...) I mean not related to the place of exchange itself.
I won't be surprised that SMART Adjusted Close and NASDAQ Adjusted Close differ in 2002 because the Close itself did differ more from one exchange to another in theses epoch than the 'current epoch' post "Flash boys"


Re: Level2 data falls behind actual market

 

Look to me like the Highest Bid and Lowest Ask. They are unrealized transaction.
They are reported in the callbacks, "I am sure of it."
How you compare it is the issue, if you display TWS in // to a SQL SELECT, definitively it's move too fast to be insync, you may even have TWS late to the API, but your DB is most probably the reference, or you should investigate your INSERT timing. (you better bulk it in a separate thread)

If you want to make a visual inspection, don't use the [0] but someplace deeper, like around the 20th row or with 0.25% <> to top, they change less frequently as they are more "fishing" position and any better bid or more aggressive ask may insert above but faster.
Or take a stock that not aggressively traded, low daily volume typically.
Or take a look at it outside RTH, market are way slower.
Or don't use a DB but a memory Map and dump it,
etc ....
Trust the API and dig elsewhere.


Re: Level2 data falls behind actual market

 

Current market price meaning the top of the limit order book - what Updatemktdepth would display as the ¡°0¡± position.

On Wed, Aug 9, 2023 at 5:08 PM Gordon Eldest via <hymagik=[email protected]> wrote:

"show" ? as in a "SELECT in a tool like MySQL WorkBench" ? because L2 run so fast that extremely unlikely you can catch it "visually"
L2 show B/A book, which are different beast than last trade. So what do you call "current market price" ?
Also: be careful that depending upon what you look for (and anyway in every cases as a default method)? you need to listen to both updateMktDepth and updateMktDepthL2 to get a complete picture.

Opinion:
MySQL is not a real time tool but should be fast enough, with proper indexing method (simplest one), proper DB engine, MyISAM is better for that than Innodb that may have "relaxation" period. If under windows for things like L2 prefer the MemoryMapped connection rather than the TCP/IP. (or even use the MEMORY engine, risky but theses L2 data are inherently rarely used aside of real time)

As per my own experience with it using L2 from IB and also from other provider, IB is generally faster (10ms to 1s) than others.
So IMHO IB deliver faster data, the only draw back is the limitation IB give you on simultaneous L2 you can listen to, probably the price to pay to get data faster.


Re: Error when requesting 20 years of price data for specific ticker [CHTR]

 

Thank you for the tips - I will try tomorrow morning with the ISLAND exchange settings (before opening the chart I mentioned above) to check if it acquires the data without a glitch. I can't use "TRADES"? because it brings the price?unadjusted for dividends. See the detta for PCAR (a company that pays dividends):



What is quite scary is how different the prices are from another source (FactSet) - see below. But I will address this later:



The price for ISLAND and SMART (using "ADJUSTED_LAST") is similar (a little scary that it isn't the same, but close enough) for CHTR:



I will post back here re: data acquisition before trying the workaround (once you do it, the code works during the whole day).

Thank you again,

Danilo


Re: Level2 data falls behind actual market

 

"show" ? as in a "SELECT in a tool like MySQL WorkBench" ? because L2 run so fast that extremely unlikely you can catch it "visually"
L2 show B/A book, which are different beast than last trade. So what do you call "current market price" ?
Also: be careful that depending upon what you look for (and anyway in every cases as a default method)? you need to listen to both updateMktDepth and updateMktDepthL2 to get a complete picture.

Opinion:
MySQL is not a real time tool but should be fast enough, with proper indexing method (simplest one), proper DB engine, MyISAM is better for that than Innodb that may have "relaxation" period. If under windows for things like L2 prefer the MemoryMapped connection rather than the TCP/IP. (or even use the MEMORY engine, risky but theses L2 data are inherently rarely used aside of real time)

As per my own experience with it using L2 from IB and also from other provider, IB is generally faster (10ms to 1s) than others.
So IMHO IB deliver faster data, the only draw back is the limitation IB give you on simultaneous L2 you can listen to, probably the price to pay to get data faster.


Re: Error when requesting 20 years of price data for specific ticker [CHTR]

 

The TWS API Guide suggests for retrieval:
  • In general, a smart-routed historical data requests will require subscriptions to all exchanges on which a instrument trades.
  • For instance, a historical data request for a pink sheet (OTC) stock which trades on ARCAEDGE will require the subscription "OTC Global Equities" or "Global OTC Equities and OTC Markets" for ARCAEDGE in addition to the regular subscription (e.g. "OTC Markets").
That is the reason for Gordon to suggest you use ISLAND (direct routing) instead of SMART (smart-routed). Check the ContractDetails object for CHTR. They are listed on more than 25 exchanges (real and virtual ones) and there is probably one that you do not have subscribed to. The consequence, however, is that the returned data is based solely on trades that took place on ISLAND. If your approach needs all data from all exchanges, you'd have to get additional subscriptions.

For licensing reasons, IBKR has to be much more stringent when they provide you market data in machine readable form via the API than when they display charts within TWS. So I am not surprised that, for charting, TWS may receive more data than what you have subscribed to for and that you can retrieve unsubscribed but locally cached data after pulling up the chart in TWS.

Hope this helps,
´³¨¹°ù²µ±ð²Ô

PS. Going forward, please do not post large chunks of code. TWS API is language independent and discussions are more meaningful for the entire group when we focus on API behavior, not the implementation in one language. Chances are you get more and better responses that way, too.



On Wed, Aug 9, 2023 at 01:46 PM, Rational-IM wrote:

I have a strange issue when requesting data for a specific ticker: CHTR (for?Charter Communications Inc. - Class A). Below you can see a printout of my console, showing that price data for other test tickers is correctly retrieved. However, when reaching CHTR, it stops and says I don't have access to a database that can provide the data:

However, I do have access to multiple databases. I'm assuming that the most relevant one is the NASDAQ one - highlighted in green below. And I know the database is working because my code retrieves data for CHRW and CSX, both Nasdaq listed.

But there is a workaround - if I open CHTR in a chart with 20 years of weekly data, I can now retrieve the data for CHTR. See below the chart and the retrieved data for CHTR on my console:

Also, if I ask for a couple of weeks data for CHTR, even without opening a chart with the ticker in it, the data retrieval works fine.

Below is the test code I use. It works for multiple tickers, for multiple exchanges etc. I only have an issue with this one security (that I'm aware so far).

IBKR help desk will send me the typical answer "we are not a data provider" etc. Sure, but ironically IBKR's API is faster than the other three backup databases I have.

Any insight on this issue would be greatly appreciated,

Danilo


Re: g++ command for including the proper libraries

 

I concur with Jurgen
your issue seems with bidlib which is a third party lib, and not very much in use in general audience, hence not part of general std lib. (VS doesn't seems to deliver it's own version for example)
IB have nothing to do with it, but unfortunately for them they deliver a "stub" of it to help, giving the impression that it is there stuff.

Look at this thread /g/twsapi/topic/87904832#50045
and /g/twsapi/topic/88762658#50521? where my post deal with the proper version (option) to use.


Re: g++ command for including the proper libraries

 

I am not following your logic here.

TWS API is a language independent request/response message protocol that serializes requests made by your client into messages that are sent through a network socket socket to TWS/IBGW and de-serializes any response messages. IBKR provides implementations of this protocol for several programming languages, including C++. So there are no derivatives and I have no idea what you think we are all settling for.

All IBKR client facing software (TWS, IBGW, the Client Portal API gateway) is implemented in Java. In V10 of TWS/IBGW and TWS API, the data type for various size/quantity fields was changed from double to a more stable Decimal type. Java, and many other languages, have a built-in Decimal datatype, but C++ does not.

IBKR opted to base the C++ TWS API adapter implementation of Decimal on the "Intel? Decimal Floating-Point Math Library", as you probably have read in the . The TWS API release ships with various binary versions of that library, but not all versions for all environments. As your error log suggests, your g++ environment is not happy with the ones it finds. So you have to locate or compile a compatible version yourselves, or use a compile environment that is happy with one of the provided versions.

If you search for C++ in our archives, you will find several posts that talk about where you can find a suitable binary version or which open-source version you can use to make your own library..

´³¨¹°ù²µ±ð²Ô



On Wed, Aug 9, 2023 at 01:31 PM, <blydon12@...> wrote:
I've had no problems using g++ on windows for C++. I am just trying to see if anyone else has tried doing this successfully rather than using TwsApiL0 because I imagine the API was written in C++ to be used directly regardless of compiler or system. Otherwise, what are they doing over at Interactive Brokers? It doesn't make sense to me that I have to use some derivation of the API, and it is strange that everyone on here seems to be settling for that. With that being said, do you have any advice on how to link directly to the TWS API via g++ on windows? Any technical advice would be appreciated.


Re: Error when requesting 20 years of price data for specific ticker [CHTR]

 

Just suggestions: try CHTR with ISLAND instead of SMART. if failed then try with 'TRADES' instead of 'ADJUSTED_LAST'


Error when requesting 20 years of price data for specific ticker [CHTR]

 

I have a strange issue when requesting data for a specific ticker: CHTR (for?Charter Communications Inc. - Class A). Below you can see a printout of my console, showing that price data for other test tickers is correctly retrieved. However, when reaching CHTR, it stops and says I don't have access to a database that can provide the data:



However, I do have access to multiple databases. I'm assuming that the most relevant one is the NASDAQ one - highlighted in green below. And I know the database is working because my code retrieves data for CHRW and CSX, both Nasdaq listed.



But there is a workaround - if I open CHTR in a chart with 20 years of weekly data, I can now retrieve the data for CHTR. See below the chart and the retrieved data for CHTR on my console:





Also, if I ask for a couple of weeks data for CHTR, even without opening a chart with the ticker in it, the data retrieval works fine.

Below is the test code I use. It works for multiple tickers, for multiple exchanges etc. I only have an issue with this one security (that I'm aware so far).

IBKR help desk will send me the typical answer "we are not a data provider" etc. Sure, but ironically IBKR's API is faster than the other three backup databases I have.

Any insight on this issue would be greatly appreciated,

Danilo
___ ___ ___ ___ ___?

CODE:

#%% DATA REQUEST EXAMPLES
?
# VARIOUS EXAMPLES OF DATA REQUEST FROM INTERACTIVE BROKERS
?
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
from ibapi.common import TickerId
?
from threading import Thread
import time
?
import pandas
import sys
?
class IBapi(EWrapper, EClient):
?
? ? def __init__(self):
? ? ? ? EClient.__init__(self, self)
? ? ? ? self.data = []
? ? ? ? self.data_sent = -1 # used to check if full data requested returned
?
? ? def error(self, reqId:TickerId, errorCode:int, errorString:str, advancedOrderRejectJson = ""):
? ? ? ? ?if advancedOrderRejectJson:
? ? ? ? ? ? ?print("\nError. Id:", reqId, "\nCode:", errorCode, "\nMsg:", errorString, "\nAdvancedOrderRejectJson:", advancedOrderRejectJson)
? ? ? ? ?else:
? ? ? ? ? ? ?print("\nError. Id:", reqId, "\nCode:", errorCode, "\nMsg:", errorString)
?
? ? def historicalData(self, reqId, bar):
? ? ? ? self.data.append([bar.date, bar.close])
?
? ? def historicalDataEnd(self, reqId, start, end):
? ? ? ? self.data_sent = reqId
?
def run_loop():
? ? app.run()
?
app = IBapi()
app.connect('127.0.0.1', 7496, 0)
?
#Start the socket in a thread
api_thread = Thread(target=run_loop, daemon=True)
api_thread.start()
time.sleep(0.5) #Sleep interval to allow time for connection to server
?
?
# HISTORICAL DATA TEST OF DATABASES vs. API
?
# AAP (NYSE) and CHTR (Nasdaq):
# Had to sign-up for "NYSE (Network A/CTA) Billed by Broker" @ $45/month and "NASDAQ (Network C/UTP)" @ $25/month
# Didn't work with "NYSE American, BATS, ARCA, IEX, and Regional Exchanges (Network B)" @ $25/month
# "Worked" with "Cboe One" @ $5/month but data is inconsistent (e.g. multiple days with same price)
# The "NYSE American, BATS, ARCA, IEX, and Regional Exchanges (Network B)" was better to show streaming prices on TWS (with the Cboe One, live data disapears when using a Basket trade)
?
# Volvo worked with "Nordic Equity" @ 36 EUR/month
# Didn't work with "Turquoise ECNs and Gettex Europe" @ 9.5 GBP/month
# But didn't work with "European (BATS/Chi-X)" @ 31.5 GBP/month
?
# Nestle worked with "European (BATS/Chi-X) Equities" @ GBP 31.50/Month;?
# "SIX Swill Exchange" @ 32.5 CHF/Month partialy worked (would cause an error for 20 years of data request)
# "Tuquoise ECNs and Gettex" didn't work (same for Volvo - see above)
# Noticed that when using "SMART" for exchange getting different figures for Neste (vs. EOD and Yahoo Finance)
# Tried specific exchanges: AQXECH - no permission; BATECH: matched other databases; CHIXCH: permission but a few figures still wrong
# EBS - no permission; TRQXCH: no permission
?
contracts = {'NYSE listed 1':? ?['AAP',? ? 'SMART',? 'USD'],
? ? ? ? ? ? ?'NYSE listed 2':? ?['AGCO',? ?'SMART',? 'USD'],
? ? ? ? ? ? ?'Nasdaq listed 1': ['CHRW',? ?'SMART',? 'USD'],
? ? ? ? ? ? ?'Nasdaq listed 2': ['CSX',? ? 'SMART',? 'USD'],
? ? ? ? ? ? ?'Nasdaq listed 3': ['CHTR',? ?'SMART',? 'USD'],
? ? ? ? ? ? ?'Index':? ? ? ? ? ?['SPY',? ? 'SMART',? 'USD'],
? ? ? ? ? ? ?'Nestle':? ? ? ? ? ['NESN',? ?'BATECH', 'CHF'],
? ? ? ? ? ? ?'Volvo':? ? ? ? ? ?['VOLV.B', 'SFB',? ? 'SEK']}
?
#Create contract object
con = Contract()
con.secType = 'STK'
?
# short-term data
for c in contracts:
? ? con.symbol = contracts[c][0]
? ? con.exchange = contracts[c][1]
? ? con.currency = contracts[c][2]
?
? ? #Request Market Data
? ? reqId = 100
? ? app.data = []
? ? app.data_sent = -1
? ? app.reqHistoricalData(reqId, con, '', '2 W', '1 day', 'ADJUSTED_LAST', 1, 1, False, [])
? ? while app.data_sent != reqId:
? ? ? ? try:
? ? ? ? ? ? time.sleep(0.1)
? ? ? ? except:
? ? ? ? ? ? print("\nError while reading security "+contracts[c][0]+"\n")
? ? ? ? ? ? app.disconnect()
? ? ? ? ? ? sys.exit(1) # will exit code either due to an true error or if CTRL+C pressed
?
? ? # Work with "data" from IB API
? ? df = pandas.DataFrame(app.data, columns=['DateTime', 'Adj. Close'])
? ? df['DateTime'] = pandas.to_datetime(df['DateTime'], format='%Y%m%d')
? ? print('\n2 Weeks of price data for {}:\n'.format(con.symbol))
? ? print(df)
?
?
# long-term data
for c in contracts:
? ? con.symbol = contracts[c][0]
? ? con.exchange = contracts[c][1]
? ? con.currency = contracts[c][2]
?
? ? #Request Market Data
? ? reqId = 100
? ? app.data = []
? ? app.data_sent = -1
? ? app.reqHistoricalData(reqId, con, '', '20 Y', '1 day', 'ADJUSTED_LAST', 1, 1, False, [])
? ? while app.data_sent != reqId:
? ? ? ? try:
? ? ? ? ? ? time.sleep(0.1)
? ? ? ? except:
? ? ? ? ? ? print("\nError while reading security "+contracts[c][0]+"\n")
? ? ? ? ? ? app.disconnect()
? ? ? ? ? ? sys.exit(1) # will exit code either due to an true error or if CTRL+C pressed
?
? ? # Work with "data" from IB API
? ? df = pandas.DataFrame(app.data, columns=['DateTime', 'Adj. Close'])
? ? df['DateTime'] = pandas.to_datetime(df['DateTime'], format='%Y%m%d')
? ? print('\n20 years of price data for {}:\n'.format(con.symbol))
? ? print(df)
?
app.disconnect()


Re: g++ command for including the proper libraries

 

On Wed, Aug 9, 2023 at 06:31 PM, blydon12@... wrote:

any advice on how to link directly to the TWS API via g++ on windows

Sorry, I haven't used Windows since the early 2000s.


Re: g++ command for including the proper libraries

 

I've had no problems using g++ on windows for C++. I am just trying to see if anyone else has tried doing this successfully rather than using TwsApiL0 because I imagine the API was written in C++ to be used directly regardless of compiler or system. Otherwise, what are they doing over at Interactive Brokers? It doesn't make sense to me that I have to use some derivation of the API, and it is strange that everyone on here seems to be settling for that. With that being said, do you have any advice on how to link directly to the TWS API via g++ on windows? Any technical advice would be appreciated.


Re: g++ command for including the proper libraries

 

On Wed, Aug 9, 2023 at 04:32 PM, blydon12@... wrote:

not looking to use any wrapper that someone has created

You don't want a fuss but decided against using the de facto standard compiler for your platform? That sounds awfully silly to me... may I suggest you brace for some impact or, perhaps use the MSFT tools.


g++ command for including the proper libraries

 

I have been trying to use the TWS API directly. I am not looking to use any wrapper that someone has created on GitHub in C++. Can someone direct me to a link on what g++ command to use to include the proper libraries?
Any help is appreciated.

Here is my current batch file I have been running unsuccessfully. I get the same thing when trying the -m32 or -m64 flag. I also, have tried linking to TwsSocketClient.dll in the same fashion instead of biddll.dll via the directory "C:\IB_TWS\api\source\CppClient\client\Release" and/or "C:\IB_TWS\api\source\CppClient\lib" for TwsClientSocket.lib and get the same results. The docs say use TwsClientSocket.dll, but my way of doing that does not work. I am on windows here.

set twsFull=C:\IB_TWS\api\source\CppClient\client
set twsLib=C:\IB_TWS\api\source\CppClient\client\lib
set twsBid=biddll
set headers=C:\Users\blydo\Repos\Cpp\IBMachLearn\headers
set src=C:\Users\blydo\Repos\Cpp\IBMachLearn\src
set exes=C:\Users\blydo\Repos\Cpp\IBMachLearn\exe
g++ -o %exes%\main.exe %src%\main.cpp -I%headers% -I%twsFull% -I%twsLib% -L%twsLib% -l%twsBid%


Output:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.lib when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.dll when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.lib when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.dll when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib\biddll.lib when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lbiddll: No such file or directory C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.lib when searching for -lbiddll C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\IB_TWS\api\source\CppClient\client\lib/biddll.dll when searching for -lbiddll collect2.exe: error: ld returned 1 exit status


Re: Level2 data falls behind actual market

 

When I check the latest updated rows in the DB show values different than the current market price.? The instrument I get quotes for is NQ futures.



Re: getting overnight trading bid/ask via api

 

Let the group know what you find. Not an area we are active in, but would be interesting to know.

Also, keep in mind that the IBEOS/OVERNIGHT exchange supports only a tiny fraction of order types that regular exchanges allow. Specifically, "Market Orders" are not supported:

Order Type SMART IBEOS
? ? ?
ACTIVETIM X X
AD X X
ALERT X X
ALLOC X X
AVGCOST X X
BASKET X X
BENCHPX X X
CASHQTY X X
DAY X X
DEACT X X
DEACTDIS X X
HID X X
LMT X X
NGCOMB X X
NONALGO X X
OCA X X
PEGBENCH X X
SCALE X X
SCALERST X X
WHATIF X X
? ? ?
ADJUST X no
ALGO X no
AON X no
COND X no
CONDORDER X no
DARKONLY X no
DARKPOLL X no
DEACTEOD X no
DIS X no
DUR X no
GAT X no
GTC X no
GTD X no
GTT X no
IBKRATS X no
ICE X no
IOC X no
LIT X no
LOC X no
MIDPX X no
MIT X no
MKT X no
MOC X no
MTL X no
NODARK X no
OPG X no
OPGREROUT X no
PEGMID X no
POSTATS X no
POSTONLY X no
PREOPGRTH X no
PRICECHK X no
REL X no
REL2MID X no
RELPCTOFS X no
RTH X no
SCALEODD X no
SIZECHK X no
SMARTSTG X no
SNAPMID X no
SNAPMKT X no
SNAPREL X no
STP X no
STPLMT X no
SWEEP X no
TRAIL X no
TRAILLIT X no
TRAILLMT X no
TRAILMIT X no



On Mon, Aug 7, 2023 at 02:17 PM, <TrumX@...> wrote:
Thanks a lot, I will test it! ??


Re: getting overnight trading bid/ask via api

 

Thanks a lot, I will test it! ??


Re: getting overnight trading bid/ask via api

 

It is "Regular Trading Hours" just not for all exchanges. As the article you pointed to indicates, you need to select the exchange "IBEOS". Apparently an exchange name of "OVERNIGHT" works as well. tickByTickBidAsk should therefore provide data during the overnight session as long as the Contract object for the subscription call specifies one of those two exchanges. I say should since I have not tried that yet. But that is how market data selection works.

From the ContractDetails object for AAA:
"exchange" : "IBEOS",
"tradingHours" : "20230806:2000-20230807:0350;20230807:2000-20230808:0350;20230808:2000-20230809:0350;20230809:2000-20230810:0350;20230810:2000-20230811:0350"
"exchange" : "OVERNIGHT",
"tradingHours" : "20230806:2000-20230807:0350;20230807:2000-20230808:0350;20230808:2000-20230809:0350;20230809:2000-20230810:0350;20230810:2000-20230811:0350"

´³¨¹°ù²µ±ð²Ô


On Mon, Aug 7, 2023 at 01:11 PM, <TrumX@...> wrote:

Hi! Thanks for your answer.

?

I'm talking about?

It is different from regular/ OutsideRTH.