¿ªÔÆÌåÓý

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

Locked Re: How to increase chance of filling and order

 

@ds-avatar?

Thanks for detailed reply. That is roughly how i understand it. I guess my question was mostly what we can do to improve the odds. Are there any settings similar to TriggerMethod or some sell order i am missing, which can do better? Is SMART an option in api?
I guess part of the confusion comes from the fact that i can see trades happening at the price i want to trade, but my orders never trigger there. Its like if there are some other traders, who have priority, they get to trade at the best price, while others dont. I might be misinterpreting things or be wrong about this, but that is my current impression, when i watch my orders set, not fill, while other trades happen at that price. I would just like to understand why.


Locked Re: How to increase chance of filling and order

 

Is it possible to use an 'algo order' to get your orders filled?

B

On Sat, 4 Sep 2021, 10:15 ds-avatar, <dimsal.public@...> wrote:
I guess the hard truth is that the best way to satisfy your desire to fill as close as possible to the target price is to determine the right target price (and order size). It should be realistic while maintaining probabilistic benefit for your trading routine. Learn your stock's trading volumes and buy/ask spread for the start. The effective spread is the price range where any price targets are meaningful most of the time. Understand that the highest chance of your order executing is when the price is closer to the unfavorable end of the spread, and when your order size is reasonably small to get absorbed by the other side of the trade before the spread moves in unfavorable direction.

Generally speaking there is zero guarantee that the stock you are interested in will ever trade at the price you consider beneficial, and there is almost zero order types that are guaranteed to execute at any price. With market orders you have to accept insurmountable slippage?tendency of the target price, and with limit orders you have to accept longer times and higher uncertainty of execution. Therefore try to learn what you trade and plan accordingly.

That said, generally speaking small marketable orders in highly liquid stocks tend to execute very close to the last trade price, especially approaching market closing time when trading volumes are at their highest and spreads are smallest. Your asking these questions suggests to me you are trying to trade illiquid stocks, or placing very large orders, which together with poor understanding of the problem can make your trading somewhat prone to some funky mistakes.

These questions are actually not only beyond the scope of this forum but indeed one of the most complicated problems of the market and business in general. Market makers make their living by putting the science of it into action on the supply side.

In respect to the technicalities, TriggerMethod property is not used for market or limit orders; it's just for stops. You can try tinkering with SMART routing execution preferences in TWS configuration but it will get you only so far. I believe there's really no substitute for determining the right price and size of the order.


Locked Re: How to increase chance of filling and order

 

I guess the hard truth is that the best way to satisfy your desire to fill as close as possible to the target price is to determine the right target price (and order size). It should be realistic while maintaining probabilistic benefit for your trading routine. Learn your stock's trading volumes and buy/ask spread for the start. The effective spread is the price range where any price targets are meaningful most of the time. Understand that the highest chance of your order executing is when the price is closer to the unfavorable end of the spread, and when your order size is reasonably small to get absorbed by the other side of the trade before the spread moves in unfavorable direction.

Generally speaking there is zero guarantee that the stock you are interested in will ever trade at the price you consider beneficial, and there is almost zero order types that are guaranteed to execute at any price. With market orders you have to accept insurmountable slippage?tendency of the target price, and with limit orders you have to accept longer times and higher uncertainty of execution. Therefore try to learn what you trade and plan accordingly.

That said, generally speaking small marketable orders in highly liquid stocks tend to execute very close to the last trade price, especially approaching market closing time when trading volumes are at their highest and spreads are smallest. Your asking these questions suggests to me you are trying to trade illiquid stocks, or placing very large orders, which together with poor understanding of the problem can make your trading somewhat prone to some funky mistakes.

These questions are actually not only beyond the scope of this forum but indeed one of the most complicated problems of the market and business in general. Market makers make their living by putting the science of it into action on the supply side.

In respect to the technicalities, TriggerMethod property is not used for market or limit orders; it's just for stops. You can try tinkering with SMART routing execution preferences in TWS configuration but it will get you only so far. I believe there's really no substitute for determining the right price and size of the order.


Locked How to increase chance of filling and order

 

I have a bit hard time figuring out how to fill orders in a best possible way. Related to this i am wondering about two things.

1) Is there some way to understand stock liquidity or chance of filling an order through the api? I understand if the current traded volume is low, the chance of filling an order is lower, but is there some more specific/exact way to figure out if an order will get filled? To me it seems like a black box right now, where i have no idea
when orders have a chance of filling. It feels a bit more like gambling, because the chance of filing an order where i need to is rather rare.

2) Would you recommend any specific order types to fill as close as possible to target price as quickly as possible? With MKT order the chance of filing is much higher, but its usually way off the target price and LMT order fills at correct price, but very often does not get to filled at the target price and then misses it. Ie there is fast swing to the limit price, order does not fill, price swings back and thats it.
I have also looked into TriggerMethod, i have mostly tried "last close" and "last bid/ask and last close". That being said, i am not sure it improves things all that much.

I guess i am wondering if there is any way how to catch those fast swings. Ie if your trading strategy is correct, it sets up correct order at right time and price, but it essentialy never fills where it should and misses the target sell price, because it did not fill.


Re: TWS will periodically "hang" on Initializing managers after daily restart and have purple grid

 

Will do. Thanks


Re: Install TWS or IB gateway on Ubuntu and ARM64 bit processor

 

Thanks for your quick and clear response ´³¨¹°ù²µ±ð²Ô.? I'll follow your instructions and see how it goes.


Re: Install TWS or IB gateway on Ubuntu and ARM64 bit processor

 
Edited

You can get quite far very quickly with the stock installation for Intel x86 processors by doing four steps:

  • Download the offline installer for a Linux TWS
  • Install a decent Oracle 64bit Java JVM for ARM processors that must include JavaFX
  • Install it with like this: app_java_home="/path/to/your/Java/installation" sh tws-latest-standalone-linux-x86.sh
  • Use the "Start TWS" option from the last installation screen
I only have an old and very tired 32bit Raspberry Pi 2 with less than 800MB of RAM. It runs a 32bit version of Debian 10 (Buster) but does not meet many of the requirements for TWS,

However, TWS installation, startup, and login works fine. It hangs at "Starting Managers" but since TWS logs are encrypted at that point, debugging would be a challenge. A modern 64bit processor with good graphics might just work.

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







On Thu, Sep 2, 2021 at 11:13 AM, <makingmyliving-fin@...> wrote:
Hi Derek,

Did you achieve to run TWS on Raspberry Pi 4 or any other ARM processor?? If the answer is yes, could you please provide a detailed explanation of how to do it?? Does anybody else know?

I am looking forward to your reply,


?

?


Re: TWS will periodically "hang" on Initializing managers after daily restart and have purple grid

 

If you are still getting resets, just send a secure message to IB and describe your problem to them. I did the same yesterday regarding my reset times (see post 48041 above), and had a response from IB overnight (Sydney time). I've seen many people bag IB support, but this was a very quick response, and directly to the point.

It turns out that I am connected to a US server, with Hong Kong reset times, resulting in a disconnection from the Primary Server, with the resulting purple grids, at 07:15 and 15:45 US Central time each trading day. IB are going to change me to the Hong Kong server, with US reset times. I will still get the resets, but not while I am looking at the US markets. It will be interesting to see how this turns out.

KH


Re: TWS will periodically "hang" on Initializing managers after daily restart and have purple grid

 

Yeah, I also trade the US markets only. So far I was doing the restart ahead of the nightly resets (around 7:55 pm PST), and so if the reset (recovery) wasnt clean, my TWS would be stuck till next morning when trading starts and I needed to doublecheck early morning that it was stuck or not. Now I have pushed the restart past the reset in the hope that the restart fixes any lingering issues from the reset. At least it worked last night.


Re: TWS will periodically "hang" on Initializing managers after daily restart and have purple grid

Nick
 

¿ªÔÆÌåÓý

If you can move the TWS restart farther from the nightly IB reset I think you have a better chance of avoiding surprises.

It all depends on the markets you trade of course. I only look at US markets so I can restart TWS at 5:15Pm eastern when all local markets are closed.


On 9/2/2021 1:05 PM, rajeshh_98 via groups.io wrote:

So this still happens after upgrading to the recent version of TWS - I think I have noticed now that it has only happened after Wednesday disconnects and recovery( the daily midnight EST disconnects) the last 3 weeks. For now, what I have done is changed my daily TWS restart to happen after these disconnects ( 1am EST). This worked last night..


Re: TWS will periodically "hang" on Initializing managers after daily restart and have purple grid

 

So this still happens after upgrading to the recent version of TWS - I think I have noticed now that it has only happened after Wednesday disconnects and recovery( the daily midnight EST disconnects) the last 3 weeks. For now, what I have done is changed my daily TWS restart to happen after these disconnects ( 1am EST). This worked last night..


Re: Install TWS or IB gateway on Ubuntu and ARM64 bit processor

 

Hi Derek,

Did you achieve to run TWS on Raspberry Pi 4 or any other ARM processor?? If the answer is yes, could you please provide a detailed explanation of how to do it?? Does anybody else know?

I am looking forward to your reply,


Re: TWS API earning dates..

 

Subscribed yesterday to WSH.

Now able to get WSH_PREV_EARNINGS and?WSH_NEXT_EARNINGS via scanner.

But request?reqWshMetaData(1001) fails with API error: "Error Code: 10276? Error Msg: News feed Is Not allowed."

Error description doesn't say much: "The API client is not permissioned for receiving WSH news feed."


When I check Global Configuration -> API -> News Configuration there is no WSH listed.
Also in Global Configuration -> Information Tools -> News Configuration can't find anything WSH related.

Using TWS build 985.1k as gateway. API ver?9.85.2.0? and Vb.NET

Seems like I miss some subscription but what and where?

Thanks
Priit


security id ;3 Socket disconnected

 

anyone who know the meaning of this?

51:151:1:0:4:2:DET] [4;2;1;321;Error validating request.-'bQ' : cause - Unknown security type : 3]
2021-09-01 17:04:00.965 [XU] INFO? [JTS-EServerSocket-437] - [0:151:151:1:0:4:2:DET] Error sent.
2021-09-01 17:04:00.965 [XU] INFO? [JTS-EServerSocket-437] - [0:151:151:1:0:0:0:INFO] Handling incoming UnSet(494713387) message.
2021-09-01 17:04:00.965 [XU] INFO? [JTS-EServerSocket-437] - [0:151:151:1:0:0:0:ERR] Invalid incoming request type - 494713387
2021-09-01 17:04:00.965 [XU] ERROR [JTS-EServerSocket-437] - [0:151:151:1:0:0:0:ERR] Client socket broken -


Re: FTI futures symbol name

 

Thanks for the clear answer.

Kind regards

Harry


Re: Limitations on data requests. Requesting 120 options in option chain.

 

Sorry for the late reply.

My starting point was the sample app of the API. Very usefull. My call I now use for example:

reqMktData(mktDataRequest, FullContract, "", true, false, new List<TagValue>());

Where
mktDataRequest is an int number
FullContract is the contract I get in API message

ibClient.ContractDetails += HandleContractDataMessage;
void HandleContractDataMessage(ContractDetailsMessage message) {};

after asking for the contract details.

I hope this helps, success.


Re: futures options data via API

 

¿ªÔÆÌåÓý

You need to use OPT rather than FOP for DAX futures options.

?

I think, though I don't know for sure, that this applies to European futures options in general.

?

?

From: [email protected] <[email protected]> On Behalf Of Sadr-Hashemi
Sent: 01 September 2021 12:06
To: [email protected]
Subject: Re: [TWS API] futures options data via API

?

Hi,
I am looking for help in getting my reqMktData to work in getting me market data. I was hoping you may be able to help.
For options on Dow Jones. This gives no error (wether it is working is another question :)
symbol="YM"
secType="FOP"
currency="USD"
exchange="ECBOT"
localSymbol="C OYM SEP 21 35650"

But for DAX the following gives me security definition not found
symbol="DAX"
secType="OPT"
currency="EUR"
exchange="DTB"
localSymbol="P ODX1 SEP 21 15800"

any ideas/help/documentation?

Much appreciated


Re: FTI futures symbol name

 

A long time ago, the letters were used to designate about 2 years worth of futures contracts. 2 years, 12 months = 24 letters. In time, with rare exceptions a year was added and just 12 months of letter codes were used. ex: ESU1 =? E-Mini S&P for September 2021.

The months now used, in order are; F,G,H,J,K,M,N,Q,U,V,X and Z

On Wed, Sep 1, 2021 at 10:33 AM <arnoud@...> wrote:
Hi All,

Can someone tell me what the logic is of the month in the symbol name of a FTI future (FTA)

I know the prefix of the name is FTI and a number describing the year (1 for 2021).
Between 'FTI' and '1' there is a character which is for the month.

What I have so far is:

???? ??? jan
??? ??? feb
FTIH1??? ??? mrt
FTIJ1??? ??? apr
??? ??? may
FTIM1??? ??? jun
??? ??? jul
??? ??? aug
FTIU1??? ??? sep
FTIV1??? ??? okt
FTIX1??? ??? nov
FTIZ1??? ??? dec

Why is H used for the 3th month. What is used for jan, feb, may,jun, jul, aug...

Kind regards

Harry


FTI futures symbol name

 

Hi All,

Can someone tell me what the logic is of the month in the symbol name of a FTI future (FTA)

I know the prefix of the name is FTI and a number describing the year (1 for 2021).
Between 'FTI' and '1' there is a character which is for the month.

What I have so far is:

???? ??? jan
??? ??? feb
FTIH1??? ??? mrt
FTIJ1??? ??? apr
??? ??? may
FTIM1??? ??? jun
??? ??? jul
??? ??? aug
FTIU1??? ??? sep
FTIV1??? ??? okt
FTIX1??? ??? nov
FTIZ1??? ??? dec

Why is H used for the 3th month. What is used for jan, feb, may,jun, jul, aug...

Kind regards

Harry


Re: Limitations on data requests. Requesting 120 options in option chain.

 

Hi Nick64,

I am trying to get my API working to get some option data using reqMktData. Very interested in the fact that you have got yours to work. I'm using JAVA but even if you are using another language I will be grateful if you could show me an example of what are the parameters you are using for reqMktData to work. Thanks in advance for your timw.