Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Unable to parallelize entire python trade sequence
The code looks mostly correct but I am not a Python practitioner and someone else might want to chime in. Here a few thoughts:
And finally, you might want to put some more thought into the exact times for the opening and closing order conditions. It feels like the time condition for the opening order should be (well) before the time condition for the closing order. How much depends on the instrument you are trading and the amount of time you expect it will take for a position to become profitable (by at least the commission). If opening and closing orders have the same time condition (in your example 15:50) you can still lend up with an opening order that fills at 15:49:59 just so that the position gets closed a second later at 15:50:00. It is unlikely that, in average, the position value has increased so quickly that at least commissions for the two trades are paid for. Analyze the 5 second bars for price changes of your instrument just before 15:50, but my feeling is that you want the opening order time condition be at least 5 to 10 minutes before the closing order time condition. Maybe something like 15:45 for the opening order and 15:55 for the closing order. ´³¨¹°ù²µ±ð²Ô |
Re: Unable to parallelize entire python trade sequence
Hi ´³¨¹°ù²µ±ð²Ô, sorry for posting about this topic again, but I finally extensively tried what you suggested and I now understand what you meant by making the order self destruct. I ran into the problem where an order did not fill at all and it did not self destruct after 3:50, so I am trying to take your advice into consideration now using the timecondition. Is this the correct way of doing it? I will try it on paper trade tomorrow once I have figured it out. To ensure that if
Is my code below correct?
|
Re: MNQ Incorrect and Inconsistent Fills with Order Type = STP and any Market Order
Thanks for the response, on using UI we din't see 10-15 ticks increments, but with API we observed it more, as our test cases with API were more extensive.
We will try and use STP LMT as you suggested and find out a way to flatten orders when needed using Price/Time conditions. |
Re: MNQ Incorrect and Inconsistent Fills with Order Type = STP and any Market Order
What makes you believe those fill prices are incorrect? I agree 10-15 ticks are unfavorable but not unheard of for orders and contracts worth $4,400 (MES) and $15,100 (MNQ). Depending on the market situation or trading time, market order fills can be significantly away from the last displayed ask/bid. Market order provides no price protection and may fill at a price far lower/higher than the current displayed bid/ask. If you want more price control, consider LMT or STP LMT orders. The trade-off is, obviously, time-to-fill. ´³¨¹°ù²µ±ð²Ô |
MNQ Incorrect and Inconsistent Fills with Order Type = STP and any Market Order
Hi all,
We are using a TWS simulated account with live Market Data and are seeing the following inconsistencies with the fills.? 1. Behavior is pretty consistent with MNQ and sometimes we see the same with MES as well. 2. "LMT" Order Type works OK and results are accurate or sometimes there is a gap of 2 points 3. "STP" Order Type results in a gap of 10-15 points in case of MNQ 4. Market Order behavior is the same as "STP" Order Type results in a gap of 10-15 points in case of MNQ 5. Upon reviewing logs in TWS we see fills consistent with the behavior, so TWS 6. On TWS UI on creating similar Bracket Order results are accurate or sometimes there is a gap of 2 points 7. On contacting and sharing TWS logs with contact support response, a lot of people use the API. Order created is a Bracket Order with? Parent Order Type = "LMT" Take Profit Order Type = "LMT" Stop Loss Order TYpe = "STP" -- incorrect fills, gaps of 10-15 points It seems like there is something that we are missing, gaps of 10-15 is quite high and if you see the screen shot Price is nowhere near what was filled. Any insight will help thanks Deep |
Re: Time to Fill Orders During Paper Trading
Hi All, Interestingly, I have worked with a client who has same account as mine and I placed same order at the same time on both accounts, mine and his.? |
Re: Having trouble submitting ZT (2 yr treas) futures orders thru API.
On Thu, Jun 22, 2023 at 01:29 PM, Lou Dudka wrote:
The deadline is looming... roughly three weeks I think. I just finished rolling my stuff out the other day. On the bright side, it should take a couple of hours (max) to write a unit test in a virtual/paper-trading environment and confirm an update resolves that issue. That's all I did, but since I've liberated myself from the MSFT eco-system, my help was of limited value. Sorry for that. Good luck Lou. |
Re: Having trouble submitting ZT (2 yr treas) futures orders thru API.
Richard - I checked once before and didn't realize they included it.? I was looking in the TwsActiveX directory and didn't look in Excel.
It'll take some work to upgrade my app from 9.17 to 10.19, but well worth it.? I still have to upgrade TWS so I might as well do it together. buddy - you're the BEST! Thanks (Again), as usual Lou Dudka |
Re: Having trouble submitting ZT (2 yr treas) futures orders thru API.
On Wed, Jun 21, 2023 at 10:58 PM, Lou Dudka wrote:
You're welcome. BTW... thanks for replying to the list instead of a direct email. My manager was getting a bit ticked that I was fielding support out of band. They keep me on a short leash :-( |
Re: Having trouble submitting ZT (2 yr treas) futures orders thru API.
¿ªÔÆÌåÓýLou ? What you call the ¡®¡®old¡¯¡¯ Excel API (ie using the ActiveX component and VBA, rather than DDE or RTD) is still very much in play and is included in every API version. ? So it¡¯s not clear to me what you¡¯re asking for, or why. I do have some (but by no means all) older versions, but I think you¡¯d probably do best to install the current stable API which is 10.19. ? Richard |
Re: Having trouble submitting ZT (2 yr treas) futures orders thru API.
Hi buddy,
Just saw your post. You saved me some testing - THANKS! Yeah, I'm starting to think the same thing about the API.? I'm running an ancient version. I know Richard (and rightfully so) doesn't distribute older versions anymore. If someone has a later install for Excel API (the "old" way with VBA code in the XLS) could you please contact me? Thanks, Once again to everyone, Lou Dudka |
Re: 2105: HMDS data farm connection is broken:ushmds
I may get a little bit more of this 2105 than usual. But I must admit that I don't care about it because: |
2105: HMDS data farm connection is broken:ushmds
I am concerned about the many error messages code 2105 "HMDS data farm connection is broken:ushmds" I am receiving. I am receiving these day and night, and every day of the week. What surprises me is not only that it happens so often, but also that it is only ushmds which is apparently having issues. It is never any of the other IB servers which is having issues. For the current month of June have I received this message 148 times so far. In most cases I receive it when I'm requesting historical data, but there are also cases where I'm only asking for my account details, and am not requesting any historical data at all.
Are others here observing the same issue? |
Moderated
Looking for help with Python project (paid)
Hello dear members.?
?
I am in need of coding services in order to finish a python project. This project is based on the current session self updating Fibonacci levels for intraday trading and takes advantage of reversals using bracket orders. It is functional but is missing a bit of logic for unfilled order cancelation and it has a few bugs to be fixed. It also requires a general review before a complete GUI or a CSV can be created.? It will trade NQ/ES and MNQ/MES, each pair on a different login.
I am looking for someone available capable of delivering quickly at a fair price.
Interested members please contact me directly to ferreira.helhazar@....
?
Thanks,
?
Marcos
[subject edited by moderator] |
Re: Error - 2157
Building on Gordon's comments here some thoughts:
Gordon is correct in that most of these "disconnect" events take place during the daily IBKR maintenance/reset window for your region and it takes only seconds (in fact often sub-seconds) for the "reconnected" message to come in. And if you have several accounts connected (such as a live and a paper trading account), each account will get the disconnect/reset at a different time within the daily reset window, I suggest you do nothing special as long as your disconnects are brief and during the reset window. Restarting TWS/IBGW or your client will change nothing, will likely take much longer than the disconnect periods, and runs the risk of failing in case the connection is not back up yet. In case of 2157 you might just avoid making any requests that relate to instrument information (such as reqContractDetails, trading schedules, and similar) or be prepared to repeat the requests once the secdef farm is reconnected. But that should not be too hard, since you will likely make those calls when your client starts anyway. The story changes considerably if your disconnects are for extended periods of time, outside the maintenance/reset window, several different 2xxx disconnects happen simultaneously, and you also get error 1100 as well. In those cases, look for a transient network issue between your TWS/IBGW and the IBKR infrastructure. Here a few situations that come to mind from real life experiences:
But chances are that your 2157 are brief during the reset window and you don;t have to do anything special. Hope this helps,´³¨¹°ù²µ±ð²Ô |
Re: Error - 2157
Forgot to mention: |
Re: Error - 2157
IB designed the SDK ABI without special consideration to what we call "messages" (from them to us) , they are like "errors" (from them about us, understand bad behavior of our own code)
|
SUIE code
Dear community, I use coa code "SUIE" to retrieve unusual expense(inc) for Allianz SE (Ticker: ALV, Exchange:IBIS, Currency: EUR) and from unknown reasons my TWS does only provide me with values for 2017 up to 2021 but the value for 2022 is missing even though the value is available in the fundementals explorer of the TWS. If I run the same query for Volkswagen (VOW3, IBIS,EUR) then my TWS provides me with unusual exp.(inc) for 2022. Did someone experience the same problem or does someone have an idea what might be the reason for this strange outcome? Kind regards, Marc? |