开云体育

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

Re: How to programatically approve a transaction: Security is under Surveillance

 

开云体育

Hi 闯ü谤驳别苍,

Thanks for the welcome. <smile

?

I made the changes but no go.

Here is the log output.

ERROR -1 1743033608079 2104 Market data farm connection is OK:hfarm

ERROR -1 1743033608080 2107 HMDS data farm connection is inactive but should be available upon demand.apachmds

ERROR -1 1743033608080 2158 Sec-def data farm connection is OK:secdefhk

56989180,SRF,STK,,,0,,,NSE,NSE,INR,SRF,SRF,False,,,,combo:

eason:Security is under Surveillance Measure - The scrip PE is greater than 50 for the previous 4 trailing quarters.<br><br><br>Would you like to continue?. {"rejects":[{"buttons":[{"options":[{"fixstr":"8229=SURVEILLANCE","text":"Yes, transmit the order."}],"style":"chk"}],"id":2,"text":"Security is under Surveillance Measure &ndash; The scrip PE is greater than 50 for the previous 4 trailing quarters. <br><br>Would you like to continue?","textsep":"125"}],"version":"1.0"}

?

<snip I'd check that the option API -> Settings -> "Show advanced order reject UI always" is unchecked.

PL] Is there a configuration file where I can check this value?

?

I use a screen reader and given that TWS uses its own jvm, the screen reader is unable to talk to java unless I can put the java access bridge into the jvm.

?

Pranav


Re: How to programatically approve a transaction: Security is under Surveillance

 

Welcome Pranav!

I'd check that the option API -> Settings -> "Show advanced order reject UI always" is unchecked.

Also, select all bypass options you are comfortable with in API -> Precautions.

And your thought about the advancedErrorOverride field of the Order class may help. The documentation says that "advancedErrorOverride accepts a comma-separated list with parameters containing error tags. This list will override the mentioned errors and proceed with the order placement". From your log it sounds like you could try setting the field to "8229".

闯ü谤驳别苍

?

?

?
On Wed, Mar 26, 2025 at 10:09 AM, Pranav Lal wrote:

Hi all,

Sorry about the poor subject line.

I am trying to buy a stock and am getting the following error in my logs.
56989180,SRF,STK,,,0,,,NSE,NSE,INR,SRF,SRF,False,,,,combo:
eason:Security is under Surveillance Measure - The scrip PE is greater than
50 for the previous 4 trailing quarters.<br><br><br>Would you like to
continue?.
{"rejects":[{"buttons":[{"options":[{"fixstr":"8229=SURVEILLANCE","text":"Ye
s, transmit the order."}],"style":"chk"}],"id":29,"text":"Security is under
Surveillance Measure &ndash; The scrip PE is greater than 50 for the
previous 4 trailing quarters. <br><br>Would you like to
continue?","textsep":"125"}],"version":"1.0"}

How do I get around this? Is the answer to use the advancedErrorOverride
property of the order object? If yes, what do I enter as its value?

Pranav


How to programatically approve a transaction: Security is under Surveillance

 

Hi all,

Sorry about the poor subject line.

I am trying to buy a stock and am getting the following error in my logs.
56989180,SRF,STK,,,0,,,NSE,NSE,INR,SRF,SRF,False,,,,combo:
eason:Security is under Surveillance Measure - The scrip PE is greater than
50 for the previous 4 trailing quarters.<br><br><br>Would you like to
continue?.
{"rejects":[{"buttons":[{"options":[{"fixstr":"8229=SURVEILLANCE","text":"Ye
s, transmit the order."}],"style":"chk"}],"id":29,"text":"Security is under
Surveillance Measure &ndash; The scrip PE is greater than 50 for the
previous 4 trailing quarters. <br><br>Would you like to
continue?","textsep":"125"}],"version":"1.0"}

How do I get around this? Is the answer to use the advancedErrorOverride
property of the order object? If yes, what do I enter as its value?

Pranav


Re: Improvements to Intraday Momentum Strategies Using Parameter Optimization and Different Exit Strategies

 

Hi.
?
Looks very interesting, however I could not replicate you results in my implementation.?
can you provide a code example of how did you implement it?
?
Thanks
?
Amit


is reqHistoricalData() returning partial trade bars?

 

Hi,

I seem to be witnessing the following behaviour: if I request historical data with a timestamp?that is not aligned with the trade bar size I'm requesting, the last trade bar will be a partial trade bar, 'up to' the requested timestamp. Is this a correct assumption?

To be a bit specific, for example requesting 2 minute trade bars with an endDateTime of 15:02:30 will return a trade bar for 15:02:00 but contain data only for the half minute period between 15:02:00 - 15:02:30.

An alternative would be that the API only returns complete trade bars, which?seems not to be the case.


?kos


Re: FX/CASH Pegged to Midpoint Order

 

On Mon, Mar 24, 2025 at 10:08 PM, 闯ü谤驳别苍 Reinold wrote:

I see PEGMID only in ContractDetails objects for STK instruments with exchange "SMART".

For what it's worth I've been able to use PEGMID with a some directly routed orders, e.g. to NYSE. I vaguely recall seeing IBKR documentation that says which exchanges support it, but I wasn't able to dig it up with a quick search.


Re: FX/CASH Pegged to Midpoint Order

 

The ContractDetails class contains the orderTypes field that lists all valid order types for an instrument. PEGMID is not listed for the CASH instruments I monitor, so I guess "Pegged to Midpoint" is not available.

I see PEGMID only in ContractDetails objects for STK instruments with exchange = "SMART".

闯ü谤驳别苍

?

On Mon, Mar 24, 2025 at 08:29 PM, John wrote:

Hello,
?
As the title suggests, is there any way to send pegged to midpoint orders for CASH instruments?
?
Regards,
John
?


FX/CASH Pegged to Midpoint Order

 

Hello,
?
As the title suggests, is there any way to send pegged to midpoint orders for CASH instruments?
?
Regards,
John
?


Re: Using Wall Street Horizon API w/ TWS-API

 

All,
?
I am continuing to work with the Wall Street Horizon API but receiving the following error message.? ?
?

Error. Id: 1101 1742678739416 Code: 10283 Msg: Failed to request WSH event data.Could not verify account AdvancedOrderRejectJson:

?
?
--
? ? data = app.reqWshMetaData(1100)
? ? time.sleep(5)
? ? wsh_object = WshEventData()
? ? wsh_object.fillWatchlist = True
? ? wsh_object.fillPortfolio = True
? ? wsh_object.fillCompetitors = True
? ? wsh_object.filter = '{"country": "All","watchlist": ["8314"],"limit_region": 10,"limit": 10,"wshe_ed": "true"}'? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? app.reqWshEventData(1101, wsh_object, app.serverVersion())
?
?# Full output of error:
?

Calling reqWshEventData....

2025-03-22 14:25:43,123 - INFO - REQUEST reqWshEventData {'reqId': 1101, 'wshEventData': 1696605632032: WshEventData. ConId: , Filter: {"country": "All","watchlist": ["8314"],"limit_region": 10,"limit": 10,"wshe_ed": "true"}, Fill Watchlist: 1, Fill Portfolio: 1, Fill Competitors: 1, 'MIN_SERVER_VER_WSH_EVENT_DATA_FILTERS_DATE': 199}

2025-03-22 14:25:43,124 - INFO - SENDING reqWshEventData b'\x00\x00\x00\x81102\x001101\x002147483647\x00{"country": "All","watchlist": ["8314"],"limit_region": 10,"limit": 10,"wshe_ed": "true"}\x001\x001\x001\x00\x00\x002147483647\x00'

Error. Id: 1101 1742678739416 Code: 10283 Msg: Failed to request WSH event data.Could not verify account AdvancedOrderRejectJson:

2025-03-22 14:25:48,126 - INFO - disconnecting

2025-03-22 14:25:48,127 - INFO - ANSWER connectionClosed {}

2025-03-22 14:25:48,129 - INFO - Disconnected from IB API.

2025-03-22 14:25:48,133 - INFO - Disconnected from IB API.

?
?
Thank you for any info.
?


Re: Upcoming stock earnings dates

 

I see that the subscription fee for the original poster was $2.50 USD back in 2013.? I signed up for the Wall Street Horizon API and the fee looks to be $50 / USD per month.? Does this sound right to everyone or are there different pricing tiers that I might be missing?? Thanks for any info on the current pricing.
?
?


Re: Closing positions

 

You don't have to adjust quantities manually.

As IBKR support already told you, you can request updates for all relevant information about the account, the positions, and open orders so that your client application can calculate quantities for orders as you see fit. You would probably monitor the value of a position as it increases or decreases, the available margin in the account, the required margin for a given order, the net liquidation value for the account and others.

Take a look at:
  • IBApi.EClient.reqPositions -->
  • IBApi.EClient.reqAccountSummary and IBApi.EClient.reqAccountUpdates -->
  • IBApi.EClient.reqOpenOrders -->
闯ü谤驳别苍
?
On Fri, Mar 21, 2025 at 03:17 PM, donye wrote:

I mean that if I enter a trade for 1 lot and that trade goes so well that it doubles the value of the account. Like if I enter a long position and the value of the eur/usd skyrockets. "Doubling" the account is purely for a hypothetical. It looks like for now, I'll have to manually change the order quantity value as I see fit.


Re: Closing positions

 

I mean that if I enter a trade for 1 lot and that trade goes so well that it doubles the value of the account. Like if I enter a long position and the value of the eur/usd skyrockets. "Doubling" the account is purely for a hypothetical. It looks like for now, I'll have to manually change the order quantity value as I see fit.


Re: When to update ibgateway

 

That is not entirely correct.

While TWS/IBGW 10.30 does seem to send an extraneous empty string at the end of openOrder messages, TWS API is designed such that older TWS API version simply ignore the extra data. There is no error if you use IBKR provided TWS API implementations or if you use custom API implementations that properly decode messages. See for Richard's detailed description.

My client applications use TWS API version 173 (10.17.02) with stable TWS and IBGW 10.30 and everything works just fine, including openOrder callbacks.

闯ü谤驳别苍

?

On Fri, Mar 21, 2025 at 10:07 AM, Yair Altman wrote:

While in general the stable version is indeed more stable (as in "less buggy", at the expense of fewer new features) compared to the latest version, in some specific cases the stable version may actually be more buggy. For example, the current stable version (10.30) has a known issue for users of old API engines, causing a Fatal 505 error after order placement. This was reportedly fixed in 10.31 onward, and the latest version (10.34) does not exhibit this problem. In other words, users of old API engines CANNOT use the stable version and MUST use the latest version instead, especially since using a pre-10.30 version is no longer possible as of yesterday. Unfortunately, it takes a bit of digging in the IBKR website to find the latest version, since the stable version is offered by default. I have no clue as to why IBKR continues to use the 10.30 branch as the promoted "stable" version rather than 10.31 or newer, although they know about the 505 problem for at least the past 6 months.


Re: When to update ibgateway

 

While in general the stable version is indeed more stable (as in "less buggy", at the expense of fewer new features) compared to the latest version, in some specific cases the stable version may actually be more buggy. For example, the current stable version (10.30) has a known issue for users of old API engines, causing a Fatal 505 error after order placement. This was reportedly fixed in 10.31 onward, and the latest version (10.34) does not exhibit this problem. In other words, users of old API engines CANNOT use the stable version and MUST use the latest version instead, especially since using a pre-10.30 version is no longer possible as of yesterday. Unfortunately, it takes a bit of digging in the IBKR website to find the latest version, since the stable version is offered by default. I have no clue as to why IBKR continues to use the 10.30 branch as the promoted "stable" version rather than 10.31 or newer, although they know about the 505 problem for at least the past 6 months.


Re: When to update ibgateway

 

On Thu, Mar 20, 2025 at 02:31 PM, Scott Kister wrote:
I haven't found any logging, errors
I am monitoring error callbacks. In my case up till this week I was running 1019.2 gateway yet the "stable" branch is 1030.1 (1030+ has major bugs with real time data delivery for my scenarios so I tried to delay "upgrading" as long as possible). In my experience several month before retiring a version IB would call the error callback with a descriptive message giving plenty of time to upgrade. For example for past several months I was getting this error:
?
The version of the application you are running, 1019.2, needs to be upgraded, as it will be desupported on 20250320. The minimum supported version at that time will be 1030.1.??
?
Just FYI, the error Id is 2172. But I wouldn't count on that :). I just log all the errors and analyze offline. I know you say you didn't see the error. But maybe worth double checking the code for error monitoring (that specific error comes with reqId = -1, i.e. general application wide error). At least I was getting above message up until I upgraded to 1030 (and was getting similar messages before with other builds in the past if I was running older builds and they were about to be retired by IB)
?
AJ


Re: When to update ibgateway

 

On Fri, Mar 21, 2025 at 02:27 PM, Richard L King wrote:
beta
?
Yes, there is a beta channel for TWS at least.
?
--
Best,
DS


Re: When to update ibgateway

 

Not much to add to Richard's detailed reply except mentioning that I subscribe to the idea that the "stable" channel is likely the most reliable and light on maintenance, so I only use TWS and GW versions therefrom. If IB announced that a "stable" version is no longer supported, I guess it must have been really old enough to warrant an upgrade. I will typically check and upgrade myself about once in a quarter on ad hoc basis, so I'm now using TWS 10.30.1t on my home-office development computer and GW 10.30.1u on my unattended trading virtual private server which is a cheap 24/7 machine where I rely on auto-restart and weekly manual logons through RDP, without IBC.
--
Best,
DS


Re: When to update ibgateway

 

开云体育

[The following is my understanding of how IBKR deals with Gateway and TWS version updates. This is based on my 22 years of using TWS (and somewhat less for Gateway, which is younger). However it may well not be completely correct, since IBKR has never explained all this in detail to my knowledge.]

?

The are two versions of Gateway, ‘Stable’ and ‘Latest’ (possibly ‘beta’ as well but I’m not sure about that). For some reason, the IBKR website doesn’t seem to contain a published link to the stable version, only the Latest (in the Login menu at top right). However, the stable version can be found at https://www.interactivebrokers.com/en/trading/ibgateway-stable.php.

?

The ‘Stable’ version does not have any new features added, but it may still have bugs. These bugs are fixed by IBKR, and a new version is published with just the last part of the version number (the letter) updated. So the version you were using (10.30.1g) is rather old and has been superseded by several later 10.30.1? versions: the current one is 10.30.1u. I’d be willing to bet that version would work well for you.

?

The ‘Latest’ version is under active development, and is more likely to have faults, though I think that by the time IBKR release a new ‘Latest’, they’re pretty happy with it. If a significant new feature is introduced, this will be released as a new ‘Latest’ version, so the ‘Latest’ version number might go from 10.34.1c to 10.35.1a (fictional example).

?

Periodically IBKR decide that what was once the ‘Latest’ version has proven to be nice and reliable, and they promote it to be the ‘Stable’ version (it’s not normally the actual latest ’Latest’ that gets promoted – so the next ‘Stable’ version from 10.30.1u could be say 10.33.nn, rather than 10.34.nn or later)).

?

Rather less frequently, IBKR decide that an old version is no longer safe to use, and they retire it completely: this usually involves plenty of notice to users via various mechanisms, but invariably there are some users who fail to notice the warnings (or ignore them) until that version actually stops working. It’s generally advisable to take careful note of what IBKR says.

?

Once a ‘Latest’ version has been superseded by a new ‘Latest’, development of the first one ceases – no bug fixes, no new features (unless it has been promoted to ‘Stable’). So if you’re using a version like 10.31.1j, which was once a ‘Latest’ but is now neither a ‘Stable’ nor a ‘Latest’, it may contain bugs that have been fixed in a later version. Therefore it’s always safer to use either the current ‘Stable’ or the current ‘Latest’ (with the latter being somewhat more vulnerable than the former).

?

As you’ve noticed, IBKR does nothing to actively notify users of routine new versions, so it’s entirely up to you to monitor the status of the various downloads. I’m not very disciplined about this myself…

?

Richard

?

?

?

From: [email protected] <[email protected]> On Behalf Of Scott Kister
Sent: 20 March 2025 13:31
To: [email protected]
Subject: [TWS API] When to update ibgateway

?

What policy do you use for when to update the ibgateway? It seems like every 4-8 months, my ibgateway fails to login after a daily restart and updating to the newest version fixes it.

?

I haven't found any logging, errors, or other notifications that the old version is no longer being supported. Today, my version 10.30.1g stopped working, and was still failing after I restarted it again, so I updated to 10.34.1c. It is possible the old version does still work, but for some reason upgrading consistently fixes it. It seems odd that they would make the change mid-week and there were no errors in the ibc logs, it just never logged "IBC: Login has completed". I wanted to get it running, so didn't debug it too long.

?

Is there a way to get notifications when IB increases a version, or should I just set a monthly or quarterly upgrade reminder?


Re: Closing positions

 

What do you mean by the sentence "enter a position for 1 lot in EURUSD that trade would double the size of the account"? Your account size is measured by the NLV, net liquidation value. That value does not suddenly double if you take on a larger position size.
The way how you have worded your question make me guess that you are familiar with operating a so-called hedging account. That is not how IBKR operates. Your IBKR account is a so-called netting account. This difference makes that you have to look differently at account value, position size, and opening, modifying and closing positions.


Re: When to update ibgateway

 

I notice that you mention two pieces of software in your message. Both IB Gateway, and IBC (IB Controller). Which of these is causing the problem for you?
I am running IB Gateway 10.31.1j together with IBC version 3.20.0 and have not experienced any issue with this combination. I log on on Sunday evening and then let it run until the next Saturday morning.