开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Why strike price 5635 missing from SPX option chain for 2025-03-14?

 

Sorry, I attach here the screen shot for the missing strike?


Why strike price 5635 missing from SPX option chain for 2025-03-14?

 

My algo tried to define options contract for strike price 5635 with expiry on 2025-04-14 (0DTE), but got error message saying "Unknown contract". I then found that this particular strike (5635) was missing from the options chain (spot was trading at around 5610 at that moment). I suppose SPX's strikes are listed every 5 points (unless the strike is very far away from spot or it is long dated like a year ahead). Is this common ? How do you guys' code cater for this missing strike ??


What does the following error message mean?

 

ib_async.wrapper: ERROR orderStatus: No order found for orderId 109 and clientId 2

This message happens right after I issue ib.connectAsync(). I am pretty sure it is printed out from ib_async. What does it mean and what do I need to do?


Re: discrepancy with historic data

 

For the opening there's an auction and the price of the auction is the opening price (code=Q); note the high volume.
In-between the first ticks and the big auction there are some odd-lot trades (code=I) that could not be matched.
?
On the other hand, ticks relate to normal trade and the first tick is different than the opening auction price.
?
There is a good explanation on CME client systems wiki if you are so technically inclined. Here's an intro video that summarizes the approach.
I assume it's similar on the exchange you mentioned.
?
Net, for you as a trader, if you want to catch the opening price, you need to use:
- MOO orders (MKT with TIF=OPG) -> you get what price you get but guaranteed
- LOO orders (LMT with TIF=OPG) -> you try to make the market and have a say in the auction; if your limit is way off the auction price, it stays as normal LMT order after the auction
- LMT orders that are enabled for outside liquid hours (LMT with TIF=GTC and Outside RTH = True)
- OVERNIGHT orders
- non-US Auctions: MOO orders (MTL with TIF=AUC)
?
NB: IB might simulate MKT orders even if they are earmarked for open (TIF=OPG).
NB2: Back testing and paper trade cannot deal with the opening auction.
?
How and where you want to include the opening price - you need to really think about it hard.
?
* Liquidity: For 1 lot, don't worry about it. If you have $10m exposure and you need to get out cause some news came out, then you wouldn't be asking here. So don't worry about it.
* Trading Strategy: If 90.21 vs 90.28 is a deal breaker for your strategy, then the strategy is wrong 100%. I said.


Re: discrepancy with historic data

 

Hey woolloomooloo,?
?
Yahoo Finance shows the opening price was $90.25. Perhaps they had the same issue as you (seeing the two numbers of 9.21 and 9.28) and just took an average of the two lol.
?
?
Pulling up BIDU's opening price data on 2/5/25, I show the following price action (note that I'm on MST so the market opens at 7:30 for me):
?
?
The above data is sorted Z-A and the bottom-most 4 rows have a code of T indicating those trades were made during non-regular trading hours.?Hovering over and clicking on the code's link takes me to this site here:
?
I imagine the the API's opening price of $90.28 is based on the 4th row (whose value is $90.28 and is the final row having a code of T) or perhaps it's the 5th row's data (whose value is $90.29^8, whatever that means).
?
A few rows further up, we find your $90.21 for the ISLAND exchange with a code of Q, which I believe is the number that you saw a month ago.?
?
All that to say, the two numbers are valid for different reasons. Hopefully that helps clear up the mystery that you were staring down. I for one hate to endure mysteries when my money is involved.?
?
?


Re: Automatic bid or ask price change until funded

 

How about the Relative/Pegged to Primary order-type? I have used them in the past and they're pretty neat. IB continually adjusts your order's limit price as the market moves. You can also set an offset to be a penny or more competitive than the market to help it fill quicker. The order type allows one to set a limit as well.?
?
You can read more about it here: https://www.interactivebrokers.com/en/trading/ordertypes.php


Re: Automatic bid or ask price change until funded

 

Well, you can make your 'emulated IB Algo' as complicated as you like. To start with a timer (like I described above) seems like the simplest and most logical choice.
To make you algo 'smarter' you can also look how the market ('last') price is moving. If the current price is moving towards your limit price, you can simply sit and wait and 'let the market come to you'. If market price is moving away from your current limit price, you have to decide how bad you want the order filled. If you want very much to have the order filled, you must 'chase the market' and move your limit price faster towards the market price ...
That's why the IB Algo has this 'aggressiveness' parameter.
You could for example create a parameter in your algo, that specifies the 'change rate' of your limit price. That would be 'how much cents per minute' you want your limit to change. A high change rate would compare with a high aggressiveness in the IB Algo ....
What I describe above is basically how I fill my orders manually. I start with a limit price that is very much in my favour (right at the bid or ask price), and start changing the limit price until filled. With a liquid security that is usually around the mid price. And with options it is usually also very close to the model price that my orders are filled.
?
?
?


Re: Automatic bid or ask price change until funded

 

开云体育

Agreed, that would be an option. I would like to prevent to put in a timer though. Makes the code a bit unreliable. Or do you have something else in mind. Appreciate the response!

--
Secured with Tuta Mail:



Feb 11, 2025, 09:34 by lasgo2000-1@...:

You could just use a limit order and change the limit price every x seconds by a certain price increment that you choose.
So you would basically simulate the IB Algo order type. Only, you have more control over it.
With IB Algo, you can just set the 'aggressiveness' of the order, but not actual parameters (such as price increments).
?
?


Re: Automatic bid or ask price change until funded

 

You could just use a limit order and change the limit price every x seconds by a certain price increment that you choose.
So you would basically simulate the IB Algo order type. Only, you have more control over it.
With IB Algo, you can just set the 'aggressiveness' of the order, but not actual parameters (such as price increments).
?
?


Re: Automatic bid or ask price change until funded

 

开云体育

This is a good idea. I have the code for the order. Hoped that there was a preset order type for it. Appreciate the response!

--
Secured with Tuta Mail:



Feb 10, 2025, 17:46 by climbermel@...:

That should be doable.? I don't have code for that, but if you already have the code to place the order, wrap that in a loop that until filled place order plus .01, wait whatever time you want between orders, cancel order and back to top of loop.
Now you will need to watch (and wait) for callbacks to assure that the order was placed and that the cancel order was placed.?
Another option might be to place modify orders in the loop.? I've never used them so not sure if there are issues with that, but others may chi.e i? with advice on that.
Cheers,
Mel






-------- Original message --------
From: "28coins via groups.io" <28coins@...>
Date: 2025-02-10 8:26 a.m. (GMT-08:00)
Subject: Re: [ib-async] Automatic bid or ask price change until funded

. I found the IB algo etc, but this seems to peg the order to the midpoint and changes the price based on market price changes. Within the api I'd like to give my order a start price and have the algo add say 0.1$ per second until the buy is filled. So regardless of market price changes in that one second.


Re: Automatic bid or ask price change until funded

 

开云体育

That should be doable.? I don't have code for that, but if you already have the code to place the order, wrap that in a loop that until filled place order plus .01, wait whatever time you want between orders, cancel order and back to top of loop.
Now you will need to watch (and wait) for callbacks to assure that the order was placed and that the cancel order was placed.?
Another option might be to place modify orders in the loop.? I've never used them so not sure if there are issues with that, but others may chi.e i? with advice on that.
Cheers,
Mel





-------- Original message --------
From: "28coins via groups.io" <28coins@...>
Date: 2025-02-10 8:26 a.m. (GMT-08:00)
Subject: Re: [ib-async] Automatic bid or ask price change until funded

. I found the IB algo etc, but this seems to peg the order to the midpoint and changes the price based on market price changes. Within the api I'd like to give my order a start price and have the algo add say 0.1$ per second until the buy is filled. So regardless of market price changes in that one second.


Re: Automatic bid or ask price change until funded

 

. I found the IB algo etc, but this seems to peg the order to the midpoint and changes the price based on market price changes. Within the api I'd like to give my order a start price and have the algo add say 0.1$ per second until the buy is filled. So regardless of market price changes in that one second.


Automatic bid or ask price change until funded

 

开云体育


Tws interactive brokers visual basic api question

Is it possible within the IB Api (I use? the VB version) to use an order type that based on a user set bid ( or ask ) price, walks the price up ( or down ) in preset steps until the order is filled?


discrepancy with historic data

 

Hi, when i download historic data on say BIDU, primary exchange is NASDAQ (ISLAND on ib) i dont get the correct info relating to open price.
?
For example, on the 5th Feb just gone, the open price for BIDU was 90.21 according to TWS tick history which correlates to the info on the TWS quote summary, but when i download, with primary exchange set to ISLAND?
i get 90.28. Infact i cant get 90.21 with any variation i can think of sofar? Does anyone have any thoughts on why this is? Is it a shortcoming of the download functionality or could i be doing something else incorrect? Regards B.
?
contract = Stock('BIDU', 'ISLAND', 'USD')
? ? ? ? ? ? ? ? ? ? ib.qualifyContracts(contract)
? ? ? ? ? ? ? ??? ? ? ? ? ? ? ?
bars = ib.reqHistoricalData(
? ? ? ? ? ? ? ? ? ? ? ? ? ? contract,
? ? ? ? ? ? ? ? ? ? ? ? ? ? endDateTime='',
? ? ? ? ? ? ? ? ? ? ? ? ? ? durationStr='1 Y',
? ? ? ? ? ? ? ? ? ? ? ? ? ? barSizeSetting='1 Day',
? ? ? ? ? ? ? ? ? ? ? ? ? ? whatToShow='TRADES',
? ? ? ? ? ? ? ? ? ? ? ? ? ? useRTH=True,
? ? ? ? ? ? ? ? ? ? ? ? ? ? formatDate=2)


Re: Caution

 

I managed to recover my Discord, but it reminded me how much trouble it can be if only one person holds the keys to the clubhouse! I remember the confusion and frustration when Ewald passed away and the old group was deleted. So I will be adding at least one more admin to both this group and the discord, just in case something should happen to me (or my account).

Thanks, Mel


Re: Caution

 

开云体育

Thanks, it brings up shared admin for me.? I have thought about it before and now feel I really need to get at least 1 other person set up as admin for this group and the duscord group.? I hate the idea of something happening to me and both groups get locked or worse deleted...
Anyone interested let me know...?

Mel





-------- Original message --------
From: "wordd via groups.io" <howtoreached@...>
Date: 2025-01-21 10:23 p.m. (GMT-08:00)
Subject: Re: [ib-async] Caution

Discord looks ok. at least, no strange messages from your account so far.


Re: Does ib_insync work with TWS 10.30?

 

The interesting thing there is that within minutes of it not working on 10.30, I went back to 10.19 to see if it would work, and it did. Will keep that link handy though. Thanks.?


Re: Define “NOT for AM-settled” SPX option contracts

 

Oh no ! Never thought this was caused by IBKR. I will search for the relevant thread about this issue. Thanks for pointing me to the right direction.
However, I am afraid the issue actually occurs every day.
I looked into yesterday's situation (i.e. 20250121) where I traded as usual the 0DTE SPX options. Here are the details :

opt_contract = Option(‘SPX’, ’20250121’, 6015, ‘P’, ‘SMART’, currency=‘USD’, tradingClass=‘SPXW’)

Then, after ib.qualifyContracts(opt_contract), I got the contents of opt_contract as follows :

Option(conId=750913196, symbol='SPX', lastTradeDateOrContractMonth='20250122', strike=6015.0, right='P', multiplier='100', exchange='SMART', currency='USD', localSymbol='SPXW? 250121P06015000', tradingClass='SPXW')

So, I started wondering whether this is IBKR's screw-up or ib_insync's problem.


Re: Caution

 

Discord looks ok. at least, no strange messages from your account so far.


Caution

 

My discord account may have been compromised, so until I can get that resolved please be cautious of any messages from ClimberMel. Can anyone on the ib_async discord group check and let me know if there is any odd activity?

Mel