Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Market data sharing between Live and Paper account
I am experiencing the problem with both IBG 10.24 (which ran fine until today) and with IBG 10.25 - to which i just updated. So, it is definitely smth on the backend.? Brrr... On Thu, Sep 14, 2023 at 2:16?PM Richard L King <rlking@...> wrote:
|
Re: Market data sharing between Live and Paper account
¿ªÔÆÌåÓýInteresting, I¡¯m seeing something similar. ? I run live and paper TWS on the same computer. I have a number of API clients, some of which run on the same computer as the TWS instances, and others on several other computers. ? Until today this has worked faultlessly for years. ? But today the paper TWS is receiving no market data at all, while the live TWS is perfectly fine. ? I¡¯ve checked in Account Management to ensure the data sharing option was still set, and it is (I hadn¡¯t been near Account Management for weeks, but I had to make sure it hadn¡¯t somehow been reset by IB). ? I¡¯ve submitted a ticket to IB. I hope they fix this soon, as I used the paper TWS pretty much all the time for testing my trading platform. ? Just for the record, live TWS is 10.19, paper TWS is 10.25. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of Evgeni Andreyev
Sent: Thursday, September 14, 2023 11:52 AM To: [email protected] Subject: Re: [TWS API] Market data sharing between Live and Paper account ? Up until today, there was no problem running both Live and Paper Trading account connections (2 IBG instances) on the same computer , and occasionally establishing a connection to a Paper trading account from an API client? on a different computer. ? But from today, i have started getting: Error 162, reqId 3: Historical Market Data Service error message:Trading TWS session is connected from a different IP address,... ? when it is clearly not. ? |
Re: Market data sharing between Live and Paper account
Up until today, there was no problem running both Live and Paper Trading account connections (2 IBG instances) on the same computer , and occasionally establishing a connection to a Paper trading account from an API client? on a different computer. But from today, i have started getting: Error 162, reqId 3: Historical Market Data Service error message:Trading TWS session is connected from a different IP address,... when it is clearly not. ? On Thu, Sep 14, 2023 at 1:30?PM Greg Angelow <twsapi@...> wrote:
|
Re: Market data sharing between Live and Paper account
¿ªÔÆÌåÓýThanks, ´³¨¹°ù²µ±ð²Ô, for the reply. The document you name enlightened me. But allow one more
question: The question finally is, if the API Gateways (TWS and IBGW) must
be running at the same computer or (also) their API clients (i.e.
at localhost only). 1. Trading Session: For trading session, we consider a user session successfully
established and actively running on any of the following
platforms:
On 13.09.2023 22:52, ´³¨¹°ù²µ±ð²Ô Reinold via
groups.io wrote:
|
Re: Market data sharing between Live and Paper account
There is an IBKR document called that describes the various scenarios when paper and live accounts can have simultaneous access to shared real-time market data subscriptions and when not. Market data line consumption is accounted for on a per instrument basis. So when paper and live account hold real-time subscriptions for the same instrument, only one market line is actually used. You can always bring up the data subscriptions window in TWS with "crtl alt +" (on Windows). There you should see how many subscriptions you are entitled to and how many are currently in use. Without purchasing booster packs, you should see:
Tick-By-Tick subscriptions also are accounted for on a per instrument basis. Meaning that only one subscription is utilized when you subscribe to Last, and BidAsk (and maybey Midpoint) simultaneously for the same instrument. Running two session simultaneously does not cause 2105 error situations as long as your computer is connected to a decent network with reasonable latencies and your ISP does not play any "traffic shaping": games ´³¨¹°ù²µ±ð²Ô |
Market data sharing between Live and Paper account
¿ªÔÆÌåÓýIt is unclear to me how the realtime market data lines are shared
between the Live and Paper account. *Note that due to regulatory laws, only one of these accounts can have an active session at any given time. At the TWS API manual we read: Important: since your paper trading market data permissions are bound to your live one, you can only obtain live market data on your paper trading user if;
Up to now I understood the manual such, that I can have e.g. a
TWS (Live) session running at a computer and an IBGW (Paper)
session at the *same* computer and both sessions have simultaneous
access to all market data lines (at least 3). However, the footnote above confuses me: Can I have only a Live
*or* a Paper session running simultaneously? |
Re: API historical data with less decimals than seen in chart for EUR.USD
yesterday i accidentally ran test code related to this issue and i found out that the issue is fixed. i think i did the test a week or so back and the issue was still there.
here is the output from my log. the messages are sorted by the message type rather than by the arrival time to make it more readable. # i use v178, but i doubt that is really related, just keeping it here for transparency, other initialization messages omitted INFO: Sending message: V100API_HEADER[2023-09-13 05:32:58.384]: API-----v178
INFO: Received message: SERVER_VERSION[2023-09-13 05:32:58.389]: ---178-20230913 07:32:57 CET-
INFO: Sending message: START_API[2023-09-13 05:32:58.390]: ----71-2-1111--
# here is a request for 5s midpoint realtime bars, there are values even with 6 decimal places, so half a tick (that is exactly what it should be for midpoint data) INFO: Sending message: REQUEST_REALTIME_BARS[2023-09-13 05:32:58.439]: ---350-3-1--EUR-CASH-----IDEALPRO--USD---5-MIDPOINT-0--
INFO: Received message: REAL_TIME_BARS[2023-09-13 05:32:58.778]: --->50-3-1-1694583170-1.074625-1.074645-1.074625-1.07464--1--1--1-
INFO: Received message: REAL_TIME_BARS[2023-09-13 05:33:01.022]: --->50-3-1-1694583175-1.07464-1.074645-1.074625-1.074625--1--1--1-
INFO: Received message: REAL_TIME_BARS[2023-09-13 05:33:06.020]: --->50-3-1-1694583180-1.074625-1.074645-1.074625-1.07464--1--1--1-
# here is a request for 5s midpoint historical bars with keep-up-to-date turned on, there are again even half a tick values INFO: Sending message: REQUEST_HISTORICAL_DATA[2023-09-13 05:32:58.439]: ---B20-1--EUR-CASH-----IDEALPRO--USD---0--5 secs-50 S-0-MIDPOINT-2-1--
INFO: Received message: HISTORICAL_DATA[2023-09-13 05:32:58.616]: --U17-1-20230913-05:32:07-20230913-05:32:57-10-1694583120-1.074685-1.074715-1.074675-1.074715--1--1--1-1694583125-1.074715-1.074715-1.07467-1.074675--1--1--1-1694583130-1.074675-1.074675-1.074625-1.074625--1--1--1-1694583135-1.074625-1.074655-1.074625-1.074625--1--1--1-1694583140-1.074625-1.074655-1.074625-1.074645--1--1--1-1694583145-1.074645-1.07465-1.074625-1.07463--1--1--1-1694583150-1.07463-1.074645-1.07463-1.074635--1--1--1-1694583155-1.074635-1.074655-1.074635-1.074635--1--1--1-1694583160-1.074635-1.074645-1.074625-1.07464--1--1--1-1694583165-1.07464-1.074645-1.074625-1.074625--1--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:32:58.779]: ---<90-1--1-1694583170-1.074625-1.07464-1.074645-1.074625--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:01.023]: ---<90-1--1-1694583175-1.07464-1.074625-1.074645-1.074625--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:01.551]: ---=90-1--1-1694583180-1.074625-1.074625-1.074625-1.074625--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:06.020]: ---<90-1--1-1694583180-1.074625-1.07464-1.074645-1.074625--1--1-
# here is a request for 15m ask historical data, the values are with tick resolution (that is what it should be for bid/ask values) INFO: Sending message: REQUEST_HISTORICAL_DATA[2023-09-13 05:32:58.440]: ---R20-2--EUR-CASH-----IDEALPRO--USD---0-20230913-05:32:58-15 mins-54000 S-0-ASK-2-0--
INFO: Received message: HISTORICAL_DATA[2023-09-13 05:32:58.656]: --?17-2-20230912-14:32:58-20230913-05:32:58-61-1694528100-1.07139-1.07154-1.07109-1.07135--1--1--1-1694529000-1.07135-1.07169-1.07105-1.07168--1--1--1-1694529900-1.07168-1.07178-1.07117-1.07139--1--1--1-1694530800-1.07139-1.07238-1.07138-1.07207--1--1--1-1694531700-1.07207-1.07304-1.07205-1.07299--1--1--1-1694532600-1.07299-1.07302-1.07252-1.07253--1--1--1-1694533500-1.07253-1.07286-1.07247-1.07256--1--1--1-1694534400-1.07256-1.07349-1.07256-1.07343--1--1--1-1694535300-1.07343-1.07377-1.07327-1.07328--1--1--1-1694536200-1.07328-1.07328-1.07235-1.07251--1--1--1-1694537100-1.07251-1.07258-1.07217-1.07234--1--1--1-1694538000-1.07234-1.07277-1.07233-1.07274--1--1--1-1694538900-1.07274-1.07343-1.07273-1.07326--1--1--1-1694539800-1.07326-1.07335-1.07294-1.07295--1--1--1-1694540700-1.07295-1.07337-1.07259-1.07262--1--1--1-1694541600-1.07262-1.07298-1.07247-1.07270--1--1--1-1694542500-1.07270-1.07340-1.07269-1.07335--1--1--1-1694543400-1.07335-1.07345-1.07314-1.07335--1--1--1-1694544300-1.07335-1.07340-1.07303-1.07324--1--1--1-1694545200-1.07324-1.07340-1.07311-1.07321--1--1--1-1694546100-1.07321-1.07323-1.07309-1.07310--1--1--1-1694547000-1.07310-1.07317-1.07277-1.07280--1--1--1-1694547900-1.07280-1.07301-1.07277-1.07283--1--1--1-1694548800-1.07283-1.07293-1.07278-1.07285--1--1--1-1694549700-1.07285-1.07419-1.07279-1.07414--1--1--1-1694550600-1.07414-1.07516-1.07412-1.07499--1--1--1-1694551500-1.07499-1.07652-1.07494-1.07545--1--1--1-1694553300-1.07581-1.07599-1.07537-1.07554--1--1--1-1694554200-1.07554-1.07607-1.07551-1.07602--1--1--1-1694555100-1.07602-1.07640-1.07587-1.07599--1--1--1-1694556000-1.07599-1.07611-1.07560-1.07566--1--1--1-1694556900-1.07566-1.07569-1.07548-1.07549--1--1--1-1694557800-1.07549-1.07568-1.07548-1.07559--1--1--1-1694558700-1.07559-1.07567-1.07558-1.07563--1--1--1-1694559600-1.07563-1.07572-1.07549-1.07561--1--1--1-1694560500-1.07561-1.07581-1.07561-1.07564--1--1--1-1694561400-1.07564-1.07570-1.07539-1.07549--1--1--1-1694562300-1.07549-1.07569-1.07528-1.07533--1--1--1-1694563200-1.07533-1.07643-1.07532-1.07614--1--1--1-1694564100-1.07615-1.07623-1.07570-1.07577--1--1--1-1694565000-1.07577-1.07624-1.07577-1.07614--1--1--1-1694565900-1.07614-1.07631-1.07588-1.07595--1--1--1-1694566800-1.07595-1.07618-1.07578-1.07614--1--1--1-1694567700-1.07614-1.07651-1.07597-1.07610--1--1--1-1694568600-1.07610-1.07615-1.07565-1.07566--1--1--1-1694569500-1.07566-1.07585-1.07558-1.07578--1--1--1-1694570400-1.07578-1.07601-1.07506-1.07514--1--1--1-1694571300-1.07514-1.07539-1.07483-1.07504--1--1--1-1694572200-1.07504-1.07507-1.07456-1.07464--1--1--1-1694573100-1.07464-1.07488-1.07452-1.07468--1--1--1-1694574000-1.07468-1.07490-1.07459-1.07489--1--1--1-1694574900-1.07489-1.07489-1.07445-1.07465--1--1--1-1694575800-1.07465-1.07503-1.07465-1.07479--1--1--1-1694576700-1.07479-1.07488-1.07468-1.07473--1--1--1-1694577600-1.07473-1.07480-1.07464-1.07468--1--1--1-1694578500-1.07468-1.07484-1.07463-1.07482--1--1--1-1694579400-1.07482-1.07502-1.07473-1.07501--1--1--1-1694580300-1.07501-1.07538-1.07499-1.07525--1--1--1-1694581200-1.07525-1.07548-1.07497-1.07504--1--1--1-1694582100-1.07504-1.07507-1.07462-1.07468--1--1--1-1694583000-1.07468-1.07472-1.07453-1.07465--1--1--1-
?
# here is a request for 15m bid historical data, the values are again with tick resolution
INFO: Sending message: REQUEST_HISTORICAL_DATA[2023-09-13 05:32:58.440]: ---R20-3--EUR-CASH-----IDEALPRO--USD---0-20230913-05:32:58-15 mins-54000 S-0-BID-2-0--
INFO: Received message: HISTORICAL_DATA[2023-09-13 05:32:58.726]: --?17-3-20230912-14:32:58-20230913-05:32:58-61-1694528100-1.07138-1.07153-1.07108-1.07134--1--1--1-1694529000-1.07134-1.07167-1.07104-1.07166--1--1--1-1694529900-1.07166-1.07176-1.07116-1.07138--1--1--1-1694530800-1.07138-1.07237-1.07137-1.07205--1--1--1-1694531700-1.07205-1.07302-1.07204-1.07298--1--1--1-1694532600-1.07298-1.07301-1.07251-1.07252--1--1--1-1694533500-1.07252-1.07284-1.07244-1.07255--1--1--1-1694534400-1.07255-1.07347-1.07255-1.07342--1--1--1-1694535300-1.07342-1.07375-1.07325-1.07325--1--1--1-1694536200-1.07325-1.07325-1.07234-1.07249--1--1--1-1694537100-1.07249-1.07255-1.07215-1.07232--1--1--1-1694538000-1.07232-1.07275-1.07232-1.07272--1--1--1-1694538900-1.07272-1.07340-1.07271-1.07322--1--1--1-1694539800-1.07322-1.07333-1.07292-1.07292--1--1--1-1694540700-1.07292-1.07335-1.07257-1.07260--1--1--1-1694541600-1.07260-1.07297-1.07245-1.07268--1--1--1-1694542500-1.07268-1.07339-1.07267-1.07334--1--1--1-1694543400-1.07334-1.07344-1.07313-1.07334--1--1--1-1694544300-1.07334-1.07338-1.07301-1.07322--1--1--1-1694545200-1.07322-1.07338-1.07310-1.07318--1--1--1-1694546100-1.07318-1.07321-1.07307-1.07309--1--1--1-1694547000-1.07309-1.07314-1.07275-1.07277--1--1--1-1694547900-1.07277-1.07300-1.07276-1.07281--1--1--1-1694548800-1.07281-1.07291-1.07276-1.07283--1--1--1-1694549700-1.07283-1.07417-1.07275-1.07413--1--1--1-1694550600-1.07413-1.07513-1.07410-1.07497--1--1--1-1694551500-1.07497-1.07649-1.07492-1.07534--1--1--1-1694553300-1.07514-1.07547-1.07514-1.07535--1--1--1-1694554200-1.07535-1.07592-1.07535-1.07588--1--1--1-1694555100-1.07588-1.07635-1.07581-1.07590--1--1--1-1694556000-1.07590-1.07607-1.07557-1.07562--1--1--1-1694556900-1.07562-1.07567-1.07544-1.07546--1--1--1-1694557800-1.07546-1.07566-1.07544-1.07556--1--1--1-1694558700-1.07556-1.07565-1.07555-1.07560--1--1--1-1694559600-1.07560-1.07569-1.07544-1.07558--1--1--1-1694560500-1.07558-1.07579-1.07558-1.07562--1--1--1-1694561400-1.07562-1.07567-1.07537-1.07546--1--1--1-1694562300-1.07546-1.07567-1.07525-1.07531--1--1--1-1694563200-1.07531-1.07642-1.07531-1.07613--1--1--1-1694564100-1.07613-1.07621-1.07568-1.07575--1--1--1-1694565000-1.07575-1.07623-1.07575-1.07612--1--1--1-1694565900-1.07612-1.07630-1.07586-1.07593--1--1--1-1694566800-1.07593-1.07616-1.07577-1.07612--1--1--1-1694567700-1.07612-1.07649-1.07596-1.07608--1--1--1-1694568600-1.07608-1.07614-1.07562-1.07564--1--1--1-1694569500-1.07564-1.07584-1.07556-1.07576--1--1--1-1694570400-1.07576-1.07599-1.07505-1.07513--1--1--1-1694571300-1.07513-1.07537-1.07483-1.07503--1--1--1-1694572200-1.07503-1.07505-1.07455-1.07463--1--1--1-1694573100-1.07463-1.07487-1.07451-1.07467--1--1--1-1694574000-1.07467-1.07489-1.07456-1.07488--1--1--1-1694574900-1.07488-1.07488-1.07444-1.07463--1--1--1-1694575800-1.07463-1.07502-1.07463-1.07477--1--1--1-1694576700-1.07477-1.07487-1.07467-1.07472--1--1--1-1694577600-1.07472-1.07478-1.07463-1.07467--1--1--1-1694578500-1.07467-1.07484-1.07462-1.07481--1--1--1-1694579400-1.07481-1.07500-1.07471-1.07499--1--1--1-1694580300-1.07499-1.07537-1.07497-1.07522--1--1--1-1694581200-1.07522-1.07546-1.07495-1.07503--1--1--1-1694582100-1.07503-1.07505-1.07461-1.07467--1--1--1-1694583000-1.07467-1.07471-1.07452-1.07463--1--1--1-
?
# here is a request for 15m bid-ask historical data, the values are again with tick resolution
INFO: Sending message: REQUEST_HISTORICAL_DATA[2023-09-13 05:32:58.440]: ---V20-4--EUR-CASH-----IDEALPRO--USD---0-20230913-05:32:58-15 mins-54000 S-0-BID_ASK-2-0--
INFO: Received message: HISTORICAL_DATA[2023-09-13 05:32:58.819]: --?17-4-20230912-14:32:58-20230913-05:32:58-61-1694528100-1.07129-1.07154-1.07108-1.07130--1--1--1-1694529000-1.07141-1.07169-1.07104-1.07143--1--1--1-1694529900-1.07150-1.07178-1.07116-1.07152--1--1--1-1694530800-1.07197-1.07238-1.07137-1.07199--1--1--1-1694531700-1.07260-1.07304-1.07204-1.07262--1--1--1-1694532600-1.07277-1.07302-1.07251-1.07278--1--1--1-1694533500-1.07264-1.07286-1.07244-1.07265--1--1--1-1694534400-1.07301-1.07349-1.07255-1.07303--1--1--1-1694535300-1.07349-1.07377-1.07325-1.07350--1--1--1-1694536200-1.07275-1.07328-1.07234-1.07277--1--1--1-1694537100-1.07240-1.07258-1.07215-1.07242--1--1--1-1694538000-1.07256-1.07277-1.07232-1.07258--1--1--1-1694538900-1.07306-1.07343-1.07271-1.07308--1--1--1-1694539800-1.07316-1.07335-1.07292-1.07318--1--1--1-1694540700-1.07300-1.07337-1.07257-1.07302--1--1--1-1694541600-1.07275-1.07298-1.07245-1.07277--1--1--1-1694542500-1.07296-1.07340-1.07267-1.07298--1--1--1-1694543400-1.07326-1.07345-1.07313-1.07329--1--1--1-1694544300-1.07323-1.07340-1.07301-1.07324--1--1--1-1694545200-1.07323-1.07340-1.07310-1.07325--1--1--1-1694546100-1.07312-1.07323-1.07307-1.07314--1--1--1-1694547000-1.07292-1.07317-1.07275-1.07294--1--1--1-1694547900-1.07287-1.07301-1.07276-1.07289--1--1--1-1694548800-1.07284-1.07293-1.07276-1.07286--1--1--1-1694549700-1.07344-1.07419-1.07275-1.07346--1--1--1-1694550600-1.07479-1.07516-1.07410-1.07481--1--1--1-1694551500-1.07578-1.07652-1.07492-1.07582--1--1--1-1694553300-1.07537-1.07599-1.07514-1.07562--1--1--1-1694554200-1.07556-1.07607-1.07535-1.07570--1--1--1-1694555100-1.07603-1.07640-1.07581-1.07609--1--1--1-1694556000-1.07574-1.07611-1.07557-1.07579--1--1--1-1694556900-1.07555-1.07569-1.07544-1.07558--1--1--1-1694557800-1.07554-1.07568-1.07544-1.07557--1--1--1-1694558700-1.07558-1.07567-1.07555-1.07560--1--1--1-1694559600-1.07559-1.07572-1.07544-1.07562--1--1--1-1694560500-1.07569-1.07581-1.07558-1.07571--1--1--1-1694561400-1.07552-1.07570-1.07537-1.07555--1--1--1-1694562300-1.07549-1.07569-1.07525-1.07551--1--1--1-1694563200-1.07603-1.07643-1.07531-1.07605--1--1--1-1694564100-1.07593-1.07623-1.07568-1.07595--1--1--1-1694565000-1.07609-1.07624-1.07575-1.07610--1--1--1-1694565900-1.07609-1.07631-1.07586-1.07611--1--1--1-1694566800-1.07597-1.07618-1.07577-1.07598--1--1--1-1694567700-1.07623-1.07651-1.07596-1.07625--1--1--1-1694568600-1.07588-1.07615-1.07562-1.07590--1--1--1-1694569500-1.07570-1.07585-1.07556-1.07572--1--1--1-1694570400-1.07557-1.07601-1.07505-1.07558--1--1--1-1694571300-1.07513-1.07539-1.07483-1.07514--1--1--1-1694572200-1.07482-1.07507-1.07455-1.07484--1--1--1-1694573100-1.07470-1.07488-1.07451-1.07471--1--1--1-1694574000-1.07474-1.07490-1.07456-1.07476--1--1--1-1694574900-1.07468-1.07489-1.07444-1.07470--1--1--1-1694575800-1.07483-1.07503-1.07463-1.07484--1--1--1-1694576700-1.07478-1.07488-1.07467-1.07479--1--1--1-1694577600-1.07472-1.07480-1.07463-1.07473--1--1--1-1694578500-1.07472-1.07484-1.07462-1.07474--1--1--1-1694579400-1.07485-1.07502-1.07471-1.07487--1--1--1-1694580300-1.07519-1.07538-1.07497-1.07520--1--1--1-1694581200-1.07525-1.07548-1.07495-1.07527--1--1--1-1694582100-1.07477-1.07507-1.07461-1.07479--1--1--1-1694583000-1.07463-1.07472-1.07452-1.07464--1--1--1-
?
# here is a request for 15m midpoint historical data with keep-up-to-date turned on, the values are with half a tick resolution, both the historical and the real-time
INFO: Sending message: REQUEST_HISTORICAL_DATA[2023-09-13 05:32:58.441]: ---F20-5--EUR-CASH-----IDEALPRO--USD---0--15 mins-54000 S-0-MIDPOINT-2-1--
INFO: Received message: HISTORICAL_DATA[2023-09-13 05:32:58.890]: --
17-5-20230912-14:32:57-20230913-05:32:57-61-1694528100-1.071385-1.071535-1.071085-1.071345--1--1--1-1694529000-1.071345-1.07168-1.071045-1.07167--1--1--1-1694529900-1.07167-1.07177-1.071165-1.071385--1--1--1-1694530800-1.071385-1.072375-1.071375-1.07206--1--1--1-1694531700-1.07206-1.07303-1.072045-1.072985--1--1--1-1694532600-1.072985-1.073015-1.072515-1.072525--1--1--1-1694533500-1.072525-1.07285-1.072455-1.072555--1--1--1-1694534400-1.072555-1.07348-1.072555-1.073425--1--1--1-1694535300-1.073425-1.07376-1.07326-1.073265--1--1--1-1694536200-1.073265-1.073265-1.072345-1.07250--1--1--1-1694537100-1.07250-1.072565-1.07216-1.07233--1--1--1-1694538000-1.07233-1.07276-1.072325-1.07273--1--1--1-1694538900-1.07273-1.073415-1.07272-1.07324--1--1--1-1694539800-1.07324-1.07334-1.07293-1.072935--1--1--1-1694540700-1.072935-1.07336-1.07258-1.07261--1--1--1-1694541600-1.07261-1.072975-1.07246-1.07269--1--1--1-1694542500-1.07269-1.073395-1.07268-1.073345--1--1--1-1694543400-1.073345-1.073445-1.073135-1.073345--1--1--1-1694544300-1.073345-1.07339-1.07302-1.07323--1--1--1-1694545200-1.07323-1.07339-1.073105-1.073195--1--1--1-1694546100-1.073195-1.07322-1.07308-1.073095--1--1--1-1694547000-1.073095-1.073155-1.07276-1.072785--1--1--1-1694547900-1.072785-1.073005-1.072765-1.07282--1--1--1-1694548800-1.07282-1.07292-1.07277-1.07284--1--1--1-1694549700-1.07284-1.07418-1.07277-1.074135--1--1--1-1694550600-1.074135-1.075145-1.07411-1.07498--1--1--1-1694551500-1.07498-1.076505-1.07493-1.075395--1--1--1-1694553300-1.075475-1.075665-1.075315-1.075445--1--1--1-1694554200-1.075445-1.075985-1.07543-1.07595--1--1--1-1694555100-1.07595-1.076375-1.075845-1.075945--1--1--1-1694556000-1.075945-1.07609-1.075595-1.07564--1--1--1-1694556900-1.07564-1.07568-1.07546-1.075475--1--1--1-1694557800-1.075475-1.07567-1.07546-1.075575--1--1--1-1694558700-1.075575-1.07566-1.075565-1.075615--1--1--1-1694559600-1.075615-1.075705-1.075465-1.075595--1--1--1-1694560500-1.075595-1.07580-1.075595-1.07563--1--1--1-1694561400-1.07563-1.075685-1.075375-1.075475--1--1--1-1694562300-1.075475-1.07568-1.075265-1.07532--1--1--1-1694563200-1.07532-1.07642-1.075315-1.07614--1--1--1-1694564100-1.07614-1.076225-1.07569-1.07576--1--1--1-1694565000-1.07576-1.076235-1.07576-1.07613--1--1--1-1694565900-1.07613-1.07631-1.075875-1.07594--1--1--1-1694566800-1.07594-1.07617-1.075775-1.07613--1--1--1-1694567700-1.07613-1.07650-1.07597-1.07609--1--1--1-1694568600-1.07609-1.076145-1.075635-1.07565--1--1--1-1694569500-1.07565-1.075845-1.07557-1.07577--1--1--1-1694570400-1.07577-1.07600-1.075055-1.075135--1--1--1-1694571300-1.075135-1.075375-1.074835-1.075035--1--1--1-1694572200-1.075035-1.07506-1.074555-1.074635--1--1--1-1694573100-1.074635-1.074875-1.074515-1.074675--1--1--1-1694574000-1.074675-1.074895-1.074575-1.074885--1--1--1-1694574900-1.074885-1.074885-1.074445-1.07464--1--1--1-1694575800-1.07464-1.075025-1.07464-1.07478--1--1--1-1694576700-1.07478-1.074875-1.07467-1.074725--1--1--1-1694577600-1.074725-1.07479-1.074635-1.074675--1--1--1-1694578500-1.074675-1.074835-1.074625-1.074815--1--1--1-1694579400-1.074815-1.07501-1.07472-1.07500--1--1--1-1694580300-1.07500-1.075375-1.07498-1.075235--1--1--1-1694581200-1.075235-1.07547-1.07496-1.075035--1--1--1-1694582100-1.075035-1.07506-1.074615-1.074675--1--1--1-1694583000-1.074675-1.074715-1.074525-1.074625--1--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:01.023]: ---=90-5--1-1694583000-1.074675-1.074625-1.074715-1.074525--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:01.551]: ---=90-5--1-1694583000-1.074675-1.074625-1.074715-1.074525--1--1-
INFO: Received message: HISTORICAL_DATA_UPDATE[2023-09-13 05:33:06.021]: ---<90-5--1-1694583000-1.074675-1.07464-1.074715-1.074525--1--1-
i'm running ib gateway 10.25.1f, it worked also yesterday with 10.25.1e. |
Re: Options chains for NQ futures using reqSecDefOptParams
¿ªÔÆÌåÓýYes, your parameters are correct and they work fine for me. ? Here¡¯s the (lightly) formatted results: ? 20230912 16:39:50.829? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: QN3, multiplier: 20, expirations: 20230915,20231020,20231117, strikes: 3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9250,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,12950,13000,13050,13100,13150,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14260,14270,14275,14280,14290,14300,14310,14320,14325,14330,14340,14350,14360,14370,14375,14380,14390,14400,14410,14420,14425,14430,14440,14450,14460,14470,14475,14480,14490,14500,14510,14520,14525,14530,14540,14550,14560,14570,14575,14580,14590,14600,14610,14620,14625,14630,14640,14650,14660,14670,14675,14680,14690,14700,14710,14720,14725,14730,14740,14750,14760,14770,14775,14780,14790,14800,14810,14820,14825,14830,14840,14850,14860,14870,14875,14880,14890,14900,14910,14920,14925,14930,14940,14950,14960,14970,14975,14980,14990,15000,15010,15020,15025,15030,15040,15050,15060,15070,15075,15080,15090,15100,15110,15120,15125,15130,15140,15150,15160,15170,15175,15180,15190,15200,15210,15220,15225,15230,15240,15250,15260,15270,15275,15280,15290,15300,15310,15320,15325,15330,15340,15350,15360,15370,15375,15380,15390,15400,15410,15420,15425,15430,15440,15450,15460,15470,15475,15480,15490,15500,15510,15520,15525,15530,15540,15550,15560,15570,15575,15580,15590,15600,15610,15620,15625,15630,15640,15650,15660,15670,15675,15680,15690,15700,15710,15720,15725,15730,15740,15750,15760,15770,15775,15780,15790,15800,15810,15820,15825,15830,15840,15850,15860,15870,15875,15880,15890,15900,15910,15920,15925,15930,15940,15950,15960,15970,15975,15980,15990,16000,16010,16020,16025,16030,16040,16050,16060,16070,16075,16080,16090,16100,16110,16120,16125,16130,16140,16150,16160,16170,16175,16180,16190,16200,16210,16220,16225,16230,16240,16250,16260,16270,16275,16280,16290,16300,16325,16350,16375,16400,16425,16450,16475,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17300,17400,17500,17600,17700,17750,17800,18000,18250,18500,18750,19000,19250,19500,20000,20500,21000,21500,22000 20230912 16:39:50.850? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: QN2, multiplier: 20, expirations: 20231013, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14150,14200,14250,14300,14350,14400,14450,14500,14550,14600,14650,14700,14750,14800,14850,14900,14950,15000,15050,15100,15150,15200,15250,15300,15350,15400,15450,15500,15550,15600,15650,15700,15750,15800,15850,15900,15950,16000,16050,16100,16150,16200,16250,16300,16350,16400,16450,16500,16550,16600,16650,16700,16750,16800,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.852? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: QN1, multiplier: 20, expirations: 20231006, strikes: 3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9250,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14150,14200,14250,14300,14350,14400,14450,14500,14550,14600,14650,14700,14750,14800,14850,14900,14950,15000,15050,15100,15150,15200,15250,15300,15350,15400,15450,15500,15550,15600,15650,15700,15750,15800,15850,15900,15950,16000,16050,16100,16150,16200,16250,16300,16350,16400,16450,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.852? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: QNE, multiplier: 20, expirations: 20230929,20231031,20231130, strikes: 3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9250,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,13000,13050,13100,13150,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14150,14200,14250,14300,14350,14400,14450,14500,14550,14600,14650,14700,14750,14800,14850,14900,14950,15000,15050,15100,15150,15200,15250,15300,15350,15400,15450,15500,15550,15600,15650,15700,15750,15800,15850,15900,15950,16000,16050,16100,16150,16200,16250,16300,16350,16400,16450,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17300,17400,17500,17600,17700,17750,18000,18250,18500,18750,19000,19250,19500,20000,20500,21000,21500,22000 20230912 16:39:50.853? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: NQ, multiplier: 20, expirations: 20231215, strikes: 2500,3000,3500,4000,4500,5000,5500,6000,6200,6300,6400,6500,6600,6700,6800,6850,6900,6950,7000,7050,7100,7150,7200,7250,7300,7350,7400,7500,7600,7700,7800,7900,8000,8050,8100,8150,8200,8250,8300,8350,8400,8450,8500,8550,8600,8700,8800,8900,9000,9100,9200,9250,9300,9350,9400,9450,9500,9550,9600,9700,9750,9800,9900,10000,10100,10200,10250,10300,10400,10450,10500,10550,10600,10650,10700,10750,10800,10850,10900,10950,11000,11050,11150,11200,11250,11300,11400,11500,11600,11700,11750,11800,11900,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13400,13500,13600,13700,13750,13800,13900,14000,14100,14200,14250,14300,14400,14500,14600,14700,14750,14800,14900,15000,15100,15200,15250,15300,15400,15500,15600,15700,15750,15800,15900,16000,16250,16500,16750,17000,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500,22000 20230912 16:39:50.854? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q3D, multiplier: 20, expirations: 20230921, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14425,14450,14475,14500,14525,14550,14575,14600,14625,14650,14675,14700,14725,14750,14775,14800,14825,14850,14875,14900,14925,14950,14975,15000,15025,15050,15075,15100,15125,15150,15175,15200,15225,15250,15275,15300,15325,15350,15375,15400,15425,15450,15475,15500,15525,15550,15575,15600,15625,15650,15675,15700,15725,15750,15775,15800,15825,15850,15875,15900,15925,15950,15975,16000,16025,16050,16075,16100,16125,16150,16175,16200,16225,16250,16275,16300,16325,16350,16375,16400,16425,16450,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.856? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q3C, multiplier: 20, expirations: 20230920, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14425,14450,14475,14500,14525,14550,14575,14600,14625,14650,14675,14700,14725,14750,14775,14800,14825,14850,14875,14900,14925,14950,14975,15000,15025,15050,15075,15100,15125,15150,15175,15200,15225,15250,15275,15300,15325,15350,15375,15400,15425,15450,15475,15500,15525,15550,15575,15600,15625,15650,15675,15700,15725,15750,15775,15800,15825,15850,15875,15900,15925,15950,15975,16000,16025,16050,16075,16100,16125,16150,16175,16200,16225,16250,16275,16300,16325,16350,16375,16400,16425,16450,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.856? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q3B, multiplier: 20, expirations: 20230919, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14425,14450,14475,14500,14525,14550,14575,14600,14625,14650,14675,14700,14725,14750,14775,14800,14825,14850,14875,14900,14925,14950,14975,15000,15025,15050,15075,15100,15125,15150,15175,15200,15225,15250,15275,15300,15325,15350,15375,15400,15425,15450,15475,15500,15525,15550,15575,15600,15625,15650,15675,15700,15725,15750,15775,15800,15825,15850,15875,15900,15925,15950,15975,16000,16025,16050,16075,16100,16125,16150,16175,16200,16225,16250,16275,16300,16325,16350,16375,16400,16425,16450,16475,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.857? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q4C, multiplier: 20, expirations: 20230927, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13400,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14150,14200,14250,14300,14350,14400,14450,14500,14550,14600,14650,14700,14750,14800,14850,14900,14950,15000,15050,15100,15150,15200,15250,15300,15350,15400,15450,15500,15550,15600,15650,15700,15750,15800,15850,15900,15950,16000,16050,16100,16150,16200,16250,16300,16350,16400,16450,16500,16550,16600,16650,16700,16750,16800,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.858? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q3A, multiplier: 20, expirations: 20230918, strikes: 3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9250,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,12950,13000,13050,13100,13150,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14420,14425,14430,14440,14450,14460,14470,14475,14480,14490,14500,14510,14520,14525,14530,14540,14550,14560,14570,14575,14580,14590,14600,14610,14620,14625,14630,14640,14650,14660,14670,14675,14680,14690,14700,14710,14720,14725,14730,14740,14750,14760,14770,14775,14780,14790,14800,14810,14820,14825,14830,14840,14850,14860,14870,14875,14880,14890,14900,14910,14920,14925,14930,14940,14950,14960,14970,14975,14980,14990,15000,15010,15020,15025,15030,15040,15050,15060,15070,15075,15080,15090,15100,15110,15120,15125,15130,15140,15150,15160,15170,15175,15180,15190,15200,15210,15220,15225,15230,15240,15250,15260,15270,15275,15280,15290,15300,15310,15320,15325,15330,15340,15350,15360,15370,15375,15380,15390,15400,15410,15420,15425,15430,15440,15450,15460,15470,15475,15480,15490,15500,15510,15520,15525,15530,15540,15550,15560,15570,15575,15580,15590,15600,15610,15620,15625,15630,15640,15650,15660,15670,15675,15680,15690,15700,15710,15720,15725,15730,15740,15750,15760,15770,15775,15780,15790,15800,15810,15820,15825,15830,15840,15850,15860,15870,15875,15880,15890,15900,15910,15920,15925,15930,15940,15950,15960,15970,15975,15980,15990,16000,16010,16020,16025,16030,16040,16050,16060,16070,16075,16080,16090,16100,16110,16120,16125,16130,16140,16150,16160,16170,16175,16180,16190,16200,16210,16220,16225,16230,16240,16250,16260,16270,16275,16280,16290,16300,16325,16350,16375,16400,16425,16450,16475,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.859? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q4B, multiplier: 20, expirations: 20230926, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14150,14200,14250,14300,14350,14400,14450,14500,14550,14600,14650,14700,14750,14800,14850,14900,14950,15000,15050,15100,15150,15200,15250,15300,15350,15400,15450,15500,15550,15600,15650,15700,15750,15800,15850,15900,15950,16000,16050,16100,16150,16200,16250,16300,16350,16400,16450,16500,16550,16600,16650,16700,16750,16800,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.861? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: Q4A, multiplier: 20, expirations: 20230925, strikes: 3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12250,12400,12500,12600,12700,12750,12800,12900,13000,13100,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,14000,14050,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14425,14450,14475,14500,14525,14550,14575,14600,14625,14650,14675,14700,14725,14750,14775,14800,14825,14850,14875,14900,14925,14950,14975,15000,15025,15050,15075,15100,15125,15150,15175,15200,15225,15250,15275,15300,15325,15350,15375,15400,15425,15450,15475,15500,15525,15550,15575,15600,15625,15650,15675,15700,15725,15750,15775,15800,15825,15850,15875,15900,15925,15950,15975,16000,16025,16050,16075,16100,16125,16150,16175,16200,16225,16250,16275,16300,16325,16350,16375,16400,16425,16450,16500,16550,16600,16650,16700,16750,16800,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 20230912 16:39:50.862? reqId 0, exchange CME, underlyingConId: 563947728, tradingClass: QN4, multiplier: 20, expirations: 20230922,20231027, strikes: 3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9250,9500,9750,10000,10250,10500,10750,11000,11250,11500,11750,12000,12100,12200,12250,12300,12400,12500,12600,12700,12750,12800,12900,12950,13000,13050,13100,13150,13200,13250,13300,13350,13400,13450,13500,13550,13600,13650,13700,13750,13800,13850,13900,13950,13975,14000,14025,14050,14075,14100,14125,14150,14175,14200,14225,14250,14275,14300,14325,14350,14375,14400,14425,14450,14475,14500,14525,14550,14575,14600,14625,14650,14675,14700,14725,14750,14775,14800,14825,14850,14875,14900,14925,14950,14975,15000,15025,15050,15075,15100,15125,15150,15175,15200,15225,15250,15275,15300,15325,15350,15375,15400,15425,15450,15475,15500,15525,15550,15575,15600,15625,15650,15675,15700,15725,15750,15775,15800,15825,15850,15875,15900,15925,15950,15975,16000,16025,16050,16075,16100,16125,16150,16175,16200,16225,16250,16275,16300,16325,16350,16375,16400,16425,16450,16500,16550,16600,16650,16700,16750,16800,16850,16900,17000,17100,17200,17250,17500,17750,18000,18250,18500,18750,19000,19500,20000,20500,21000,21500 ==== Security Definition Option Parameter End (requestId=0) ==== |
Options chains for NQ futures using reqSecDefOptParams
I am trying to get the options chain for futures symbol "NQ" using reqSecDefOptParams.
The call for "ES" works and returns the all the strikes and expirations. app.reqSecDefOptParams(22, "ES","CME","FUT", 497222760) But, the following for "NQ" returns nothing. app.reqSecDefOptParams(23, "NQ","CME","FUT", 563947728) Am I using the incorrect symbol or conId for NQ? Thanks for any help. |
Re: C++ Multi-Threaded System Order Book & Historical Data Monitoring
Suggestion, look at the average volume over 50 days to get an idea of where you stand as risk for liquidity.
Your question have no safe answer and it depend also if you trade RTH only or aside of RTH. NQ or not, quit a few NQ stocks have zero vol during even a full minutes, in pre RTH, others have so small volume that this more garbage collection than trend (which is interesting to see anyway) MarketDeepth need a constant monitoring to be of use. Otherwise better stay with monitoring bid/ask. L2 is close to "of no use" if you look at it every minutes, you should look at it real time for a bout a minute then compute the trend/risk IB API is pretty well made to help doing that This imply that you have it already running (unlikely you can wait a minute to finalize decision on your orders) I don't know how to give advice on "loop" oriented coding, you typically should have "scenario" that unwind once triggered by a condition, like arrival of a tick (or any relevant event) rogers |
Re: C++ Client Class visibility w/ the Sample App
I completely revamped my design over the weekend and just went with a class architecture similar to the Java Implementation rather than using inheritance. I took David's advice and am passing a smart pointer around that is my IBClient() which contains all callbacks and logic involving the TWS API. I then took Jurgen's advice and built IBHistData(), IBOrders(), IBMktDepth(), etc. to handle specific tasks. These include logic to store information from callbacks, etc. These are then located in the IBClient() and wrapped nicely so I can now grab what I need when I need it in my main Model() Class through the IBClient() smart pointer.?? |
Re: C++ Multi-Threaded System Order Book & Historical Data Monitoring
Thanks for the tip Gordon. Currently, I am just doing "reqMktDepth()" in my main loop that also every xth minute submits a "reqHistoricalData()". In this loop, I am still building and storing the order book in a data structure, but I feel it is probably more efficient to just pop both these tasks into their own threads. That way in the order book thread, if I am in a position, I can be monitoring strictly for my stop being hit. Right now, I don't really have to worry too much about liquidity, but hopefully as my account grows I can add that logic. My thought process was if I keep positions under 5 contracts on NQ I should not really have an issue getting filled, no? I guess you never know though, the book can get extremely thin and pretty wide prior to economic announcements.?
|
Re: C++ Multi-Threaded System Order Book & Historical Data Monitoring
It worth it. You can even do both (safer but require strong discipline) Stop is just another order. |
Re: C++ Client Class visibility w/ the Sample App
My grain of salt after theses excellent answers
I would be surprised that you can do what you want directly through inheritance. 1-??? IB did make some privates for good reasons, and if you break this model, you may postpone some pretty hard to track bug. Remember this is Asynchronous coding.? So, I strongly recommend that you keep all private and protected the way they are in particular what is around m_osSignal. 2-??? It¡¯s a data model issue before being a class issue. (classical) EWrapper is a IO model. (data model of it is focused on IO need) Once your data model set then you derived your automates for handling the data and then you look at the EWrapper for what you need. Here also I would be surprised that you can directly hook your needs using EWrapper as the underlying structure, even for what seems a simple action like Buy/Sale your need more than a couple of call. Also handling position even once open, require quit some calls that give rewards thanks to the asynchronous capabilities of the API. 3-??? The API is very fast but not that fast. Some structures(class) Contract/Orders/etc are pretty verbose once decoded. Otherwise said exchange of data in a thread safe manner between your model and theirs will not induce a lag that you should ever feel. So, to share experiences I start by a data model suited for the needs, then slightly superclass the IB Wrapper to feed it (In/Out) to do all the handling but in a completely separated class system. (Allowing relax coding in multiple thread) Additional reason to not consider the EWrapper as a model class is that you may have to federate data from other feeds and will be happy to not depend upon the data model of IB. Once all that said, nothing is as good as self-inflicted experience and it look to me like you need to experiment first to see what suit your programming style, keeping what is written above just as MHO amongst others, just to make your feeling more comfortable with tradeoff you will most likely need to do but you may feel afraid to do so because you wonder if it will hold very long. Answer is no it won't if you use EWrapper model. In short, your first implementation will be pretty far away from final one, so better do it ASAP without investing too much in putting your implementation atop existing API model. |
Re: why bracket quantity reduces after parent filled?
A group of orders for the same instrument with parent/child relationship is ... a bracket order. You probably could build an order construct without parent/child relationships for your scenario (using groups, and other features) but it will be challenging (or impossible) to protect your orders from the many things that can go really wrong (such over fills or order failures). We can't design the exact solution for you, but here a couple paths you could explore. Both start with a traditional bracket order for entry, profit taking, stop loss, and other conditions. IBKR synchronizes order quantities based upon actual parent order fill or the entire set of orders gets cancelled. Nothing bad happens even if your client or TWS/IBGW crash or your network connection with IBKR gets disrupted for an extended period of time. The worst case is that the stop-loss order closes the position instead of reversing the position. The first path to implementing position side reversal requires your client to be around and observe all order status callbacks. Once the parent order is filled
The second path you could explore is a tree of bracket orders. You can have up to 20 open orders for the same instrument at any point in time. For this approach:
I have not tried this, so there may be caveats but I'd expect that the position reversal order quantity is updated automatically to the actual stop loss order quantity. This would effectively reverse the position to the actual fill quantity of the entry order (which may be less than the originally requested quantity). You could extend this approach such that the reversal order has siblings in the second level bracket (profit taker, close position at end of day, others) or you could attach profit and loss orders to the reversal order for a third level. Attached an example of a two-level bracket that IBKR accepted (though it has not executed since markers are closed):
Hope this helps, ´³¨¹°ù²µ±ð²Ô On Thu, Sep 7, 2023 at 11:09 PM, <ofirbux@...> wrote: Yes , i read it. |
Re: Client Version - Connecting to the API
¿ªÔÆÌåÓýHowever the startapi message begins with API\0 followed by the length prefix for the remainder of the message. ? From: [email protected] <[email protected]> On Behalf Of noreply.section+dev@...
Sent: Saturday, September 9, 2023 10:40 PM To: [email protected] Subject: Re: [TWS API] Client Version - Connecting to the API ? Starting with v100, each message exchanged between client and server is prefixed with a 4-byte header containing the big-endian (network order) binary representation of the length of the message string. Refer to the official IB API implementations for the exact steps to encode and decode the messages. |
Re: Client Version - Connecting to the API
Starting with v100, each message exchanged between client and server is prefixed with a 4-byte header containing the big-endian (network order) binary representation of the length of the message string. Refer to the official IB API implementations for the exact steps to encode and decode the messages. |