Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
Nick
开云体育That's because there are a zillion ways to calculate continuous
futures prices and the continuous contract price may be far from
the actual futures contract price. If you trade based on
continuous futures you're trying to navigate Chicago with a map of
Detroit. On 3/13/2022 7:30 PM, dent wrote:
|
Re: Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
开云体育Excellent I will get on that immediately, seems like a GREAT solution and thank you so much for taking the time. cp
On 3/13/22 18:51, 闯ü谤驳别苍 Reinold via
groups.io wrote:
|
Re: Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
We do use CONTFUT with real time data, But not directly. As a matter of practice we follow this work flow:
For CONTFUT contracts, reqContractDetails returns the contract for the actual current front-month future (such as ESH2 today). That contract has a SecType of FUT and reqMktData is happy. 闯ü谤驳别苍 |
Re: Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
开云体育Uh OH just found this
``` Continuous futures are available from the API with TWS v971 and higher. Continuous futures cannot be used with real time data or to place orders, but only for historical data. ```
On 3/13/22 18:28, 闯ü谤驳别苍 Reinold via
groups.io wrote:
No problem. has an overview of most (if not all) SecTypes as well as the contract object fields you want to set to properly describe the instrument you are interested in. |
Re: Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
开云体育Hi jurgen I think you've spotted the flaw in my cunning plan. I hadn't AND
when I did it I got ``` Error: 1 321 Error validating request.-'bW' : cause - Please
enter a valid security type ?I didn't know that security type existed so I'm going to go through the code to see if I can actually send that. Thanks for the headsup on CONTFUT. cp
On 3/13/22 18:10, 闯ü谤驳别苍 Reinold via
groups.io wrote:
Are you setting SecType = "CONTFUT" somewhere ? |
Error: 1 321 Error validating request.-'bW' : cause - Please enter a local symbol or an expiry
I want to get continuous futures and don't want to mess around with expiration et al. Basically what I see in the TWS watchlist. I tried
and got the error in the subject line. Is there ANY variant of reqMktData that might work OR do I have to resort to reqRealTimeBars and pick the last bar? No point in posting code as I am writing in julia. The calls to the TWS api are populated the same so ANY help would be appreciated. thanks and got the error in the subject line. |
Re: bunch of reqMktData requests for options
Do you also get the message that they will stop the support for older versions after 31st March 2022? I'm still unsure what this actually means. It could be that starting from this day, this client will not work anymore. It could also mean that they would just don't process any tickets regarding this version anymore.
So hopefully, they will fix it asap. |
Re: bunch of reqMktData requests for options
Sorry for my late reply, But I've opened several tickets about it.
The IB development is investigating it.? Hope they will patch it soon. I opened my first tickets about this issue more than 2 years ago. We still use TWS 9.73 as it was the last release before the 'regression/bug' was introduced in their code. |
Re: OCA Group Orders being placed, and executed, but the stop loss orders or Take profit order are not being cancelled after one of the bracket orders are executed
Nick
Probably because you are not placing a bracket order, you're just sending 3 independent orders.
toggle quoted message
Show quoted text
See bracket order info here: On 3/13/2022 8:46 AM, alcatrazam wrote:
Hey everyone, so I am placing the bracket orders, they are going to IB, being placed, and executed, but once one part is triggered, the remaining ordered is hanging, and not being canceled, then my python program crashes as it sees the remaining fragment of the order. |
OCA Group Orders being placed, and executed, but the stop loss orders or Take profit order are not being cancelled after one of the bracket orders are executed
Hey everyone, so I am placing the bracket orders, they are going to IB, being placed, and executed, but once one part is triggered, the remaining ordered is hanging, and not being canceled, then my python program crashes as it sees the remaining fragment of the order.
Anyone have any suggestions why this is happening? ? take_profit = stop_loss = None
? ? ? ? if order.asset.right == "CALL":
? ? ? ? ? ? take_profit = price + self.call_take_profit
? ? ? ? ? ? stop_loss = price - self.call_stop_loss
? ? ? ? elif order.asset.right == "PUT":
? ? ? ? ? ? take_profit = price + self.put_take_profit
? ? ? ? ? ? stop_loss = price - self.put_stop_loss
?
? ? ? ? if order.side == "buy":
? ? ? ? ? ? self.last_filled_price = price
? ? ? ? ? ? if take_profit is not None and stop_loss is not None:
? ? ? ? ? ? ? ? tp_order = self.create_order(
? ? ? ? ? ? ? ? ? ? order.asset,
? ? ? ? ? ? ? ? ? ? order.quantity,
? ? ? ? ? ? ? ? ? ? "sell",
? ? ? ? ? ? ? ? ? ? limit_price=take_profit,
? ? ? ? ? ? ? ? )
? ? ? ? ? ? ? ? stop_order = self.create_order(
? ? ? ? ? ? ? ? ? ? order.asset,
? ? ? ? ? ? ? ? ? ? order.quantity,
? ? ? ? ? ? ? ? ? ? "sell",
? ? ? ? ? ? ? ? ? ? stop_price=stop_loss,
? ? ? ? ? ? ? ? )
? ? ? ? ? ? ? ? self.submit_orders([tp_order, stop_order])
-- Allan in Toronto. |
How Can I Locate Hard to Borrow Shares to Short with TWS API?
Does anyone have insight as to how you can locate HTB shares to short on TWS API? My main strategy involves shorting small caps which requires locating shares to short and can be done manually with a number of brokers, but I have yet to figure out how to locate shares to short do using a broker api like tws or another api.
|
Re: Market data lines
I already tried it since I have a German QWERTZ layout. Unfortunately, it didn't work.
However, I found the solution: I changed my keyboard layout to US QWERTY and now it works! I guess that the QWERTZ based layout could also work theoretically, but maybe this keyboard here is not able to detect four or more keys pressed simultaneously. |
Re: reqMktdata SPX call
开云体育thank you Jurgen great help as always. cp
On 3/11/22 09:44, 闯ü谤驳别苍 Reinold via
groups.io wrote:
Under "File -> Global Configuration -> API -> Settings" |