¿ªÔÆÌåÓý

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

Re: Why is RTD data in Excel so buggy outside of market hours?

 

Anyone have any ideas? Surprised to get no replies...I can't be the only one experiencing this(?)


TwsActiveX.xls and Historical Bond Data

 

Greetings,

I've been a member and reader of the group for about a year, ...hello everyone!? I've been reading mostly, trying to figure an entry point in to
API programming for tws.??

I haven't dived in yet, but have been fiddling with the TwsActiveX.xls sample workbook.? Question? when attempting to receive historical bond
price data, the result is always one row, the most current.? Is this a limitation or is there a way to get historical bond data?


Re: Paper trading account value reset

 

Hello Stuart, thank you so much for your wonderful help.

I never would have figured that out on my own.

It works.

Thanks again,
Josef


Re: Bracket Order help

 

Python?


Bracket Order help

 

Hello everyone,

I am trying to mke a regular bracket order, however I would like the take profit price to be automatically placed a percentage, say 10% above the filled price of the parent order, and a percentage, say 5% automatically placed below the parent filled price..
Any help would be greatly appreciated.
Thank you
Adam


Re: Starting with TWS APi using C++, looking for advice

 

Regarding 2, I use TWS API. I can't remember why I didn't opt the second.

Cancelling/changing and tracking orders is a little bit more difficult. Modifying orders () necessitates you remembering all the order IDs. To modify order with id, say 300, you just submit another order using the same id: 300. Some fields you will be able to revise (e.g. price), others you won't.

If you're continuously revising passive limit orders, you'll need to keep all of these ids in some container, and then remove them when you get fill information back, taking care never to use any id more than once.

I remember a few things about it:

1.) revising orders seemed to be much quicker than cancelling and re-sending an order. This was my experience just by visually assessing performance on TWS GUI.

2.) I was always ending up with occasional errors, telling me that that order had already been filled or cancelled. I was always quite suspicious of the order info data feed. For instance, if IB doesn't trigger execDetails() fast enough to tell you about a fill, and you send off a revision, then you'll get a delayed error. I was being an idiot though, and trying to peg a limit buy at a tick below the best bid.

Conceivably you would have to deal with partial fills, too, but I personally was only trading a contract at a time for Eminis.?

3.) I was always ending up with "bad" fills, and had difficulty reconciling backtest behavior and live/paper trading behavior. I was always quite suspicious of the price/order data feed as well. For example, if your order data feed is delayed a little, and you're trying to peg orders to the best bid/ask, then you're probably not actually pegged. You tend to get filled faster for overly-ambitious orders, and not filled for too under-ambitious orders.

I gave up on this particular strategy, and moved to market orders, not keeping track of ids, and just incrementing the order id by 1 every time.


Re: OTC

 

Do a first to get it

Getting contract details is not an option! Forget about guessing, even is ISLAND = NASDAQ? you need to knwo whcih tape you listen to.

Avoid this mess do a reqConrtactDetails!

You will need it mandatory , not only do you need primary exchange but you will need the vital "conid"!

?


amex otc

Stuart Cracraft
 

Looks like the default out of the gate for new accounts is not to give universal trading access to amex and otc but okay for nasdaq and nyse.

Hopefully raising a ticket gets the
permissions granted.


Re: Bracket order - "good after time" fires immediately

 

You also need to set the TIF parameter to "GAT", otherwise the GAT value will be ignored (the default TIF is "GTC" = Good Till Cancelled)


Reuters Stock Report Plus

Jens Rohweder
 

Dear all,

is there a way to automatically download the latest Reuters Stock Report through the API?


Best regards
Jens


Re: Python Tws Api Target order

 

I know that yes you can create a bracket order with a "TRAIL LIMIT" buy order, (tip, simply set the buy price to a number much higher than the average price) when the buy order is submitted the trail automatically takes up the slack and starts trailing at the specefied trailing amount....?

As for the take profit and stop limit order, I am still struggling with myself, I would like to have the SELL take profit order automatically priced at say 20% above the fill order price, and stop limit SELL order priced 5% below the fill order price,?

If anyone can show the full code for a bracket order as described above, I would be super super grateful to.
Thank you
Adam


OTC

Stuart Cracraft
 

¿ªÔÆÌåÓý

Hi,

Anyone know what to set the primaryExchange to so that it is general (e.g. would buy from OTC even?)

I looked at:


but it simply said NASDAQ vs. ISLAND as far as I could see. So maybe it means ¡°ISLAND¡± for the various exchanges?

My present code runs fine in the paper trading account for NASDAQ, NYSE, AMEX, OTC trading all,
but when switched to the cash account isn¡¯t able to submit the OTC trades. They simply don¡¯t submit.
All the other submit fine.

Is there some value for contract.PrimaryExchange (or code) I can use which would submit it for NASDAQ / OTC / Amex / NYSE?


? ??def start(self):
contract = Contract()
? ? ? ? contract.secType = "STK"
contract.exchange = "SMART"
? ? ? ? contract.currency = "USD"
? ? ? ? contract.primaryExchange = "NASDAQ"

? ? ? ? order = Order()



Re: Paper trading account value reset

Stuart Cracraft
 

¿ªÔÆÌåÓý

This, from IB, worked:

You can reset your paper account equity to a value different than the original and up to five times your production account value. Please note that reset requests should be entered before 16:00 EST in order to take effect for the next business day.??


Please follow below steps to reset paper equity balance:??

1. Log into your paper trading Client Portal by clicking the toggle on the login screen??
2. Select Settings followed by Account Settings??
3. Click the Configure (gear) icon next to Paper Trading Account Reset??
4. Select the reset amount from the drop down menu provided and click Continue.?

On Jan 18, 2021, at 11:32 AM, Josef Haydn <josef.haydn@...> wrote:

I saw there has been some discussion here about the paper trading account value
not being able to be reset. I just wanted to ask if this is still the case or IB's documentation
is simply outdated. They write here how it is supposedly done, but I simply cannot find
the menu items they refer to in my account management:



Am I correct that this is once again an outdated documentation by IB? They do not
seem to check the actuality I guess. If yes, the funny (and annoying) thing ist that it
indeed was possible at some stage to reset the account (I remember doing it but now
cannot find the menu item again, seems it has been removed).

Thanks for clarification if anyone here knows more about how to do it.

Thanks a lot,

Josef



Paper trading account value reset

 

I saw there has been some discussion here about the paper trading account value
not being able to be reset. I just wanted to ask if this is still the case or IB's documentation
is simply outdated. They write here how it is supposedly done, but I simply cannot find
the menu items they refer to in my account management:



Am I correct that this is once again an outdated documentation by IB? They do not
seem to check the actuality I guess. If yes, the funny (and annoying) thing ist that it
indeed was possible at some stage to reset the account (I remember doing it but now
cannot find the menu item again, seems it has been removed).

Thanks for clarification if anyone here knows more about how to do it.

Thanks a lot,

Josef


Re: Getting a list of all ticker symbols

 

¿ªÔÆÌåÓý

Thanks! I will look into it. Please let me know if you find a solution for NASDAQ

?

From: [email protected] <[email protected]> On Behalf Of Isaack Rasmussen
Sent: Friday, January 15, 2021 9:09 AM
To: [email protected]
Subject: Re: [TWS API] Getting a list of all ticker symbols

?

You can get the data directly from NASDAQ here

Under the SymbolDirectory folder and a description of the fields here:?

I haven't found the equivalent for NYSE yet.

I have a similar need right now and I'm looking into the different data providers like Polygon.io


Re: cancellation/modifying fee

 

Your first link is broken, I got a 404.

Unclear issue, intersting however.

For me a Bust order is a request on an executed order. you ask to unwind a wind up transaction. That is always a frustration for the Exchange involved and prone to abuse in HFT so they penalize that.

Interesting, I never heard of fee for cancel/modify, as long as the order is not started you are free to do that.(Rephrased: I feel free to do it without minding that)

Unless that a limitation on small amount of cash, Put at least 25K$

?

I also understand the difference between SMART and DIRECTED. I will hypothesis that:

With Smart , IB is in charge and will decide, where and when, the order may stay pending in their pool until they found the NBBO.

Direct, IB must place the order at the place of exchange for you and they are under the rules of the exchange.


Re: What time is returning to the Bar "Time" field

 

Caveat, last bar can be received while time slot not completed. You must be ready for this case,

BTW you can ask for live update of last bar and get end of slot when see firing historicalDataEnd

http://interactivebrokers.github.io/tws-api/historical_bars.html#hd_request


Re: Adding delta information to positions in ApiDemo (java)

 

I use C++ so my answer more gving a hand to avoiding you to stay blind.

?

Why is your class "static" ?

It maybe that your class structure does feed another object than the one you look for. I dislike new/static together

IHMO I would have remove the static attribute and handle the error will create at compile/run start, generating dynamically your object with new (which tailored for that)

Just a thought


Re: odd error in IB trading account

 

Look a lot more as an account issue than a technical issue. It should work

IB is pretty selective and sectorlal as per permissions. Never even try OTC.

BTW

Looks like you "funded for test" be careful/aware that under 25K USD you may hit the "Pattern day Trader error" which is not an IB limitation, it's the law


Re: How to get longer historical data?

 

Hi David,

[Q] I don't know how to open 2 TWS on my mac.
[A] Try officially documented solution:




They suggest installing 2 TWS flavours on your mac:?
? ? - one "auto-updating"?
? ? - and another "offline",
then they show how to run both at the same time.?

If you want exact same TWS apps running in parallel: I recall on mac (I quit using it a couple years ago) I was able to run a few TWS apps in parallel and all of them were based on the same "offline" flavour downloaded only once, but if I recall correctly - I had to create a recursive copy of the folder where TWS was installed and tweak some of the TWS start bash scripts. My point is - imho it is also doable, but I don't remember all the exact steps/words from that spell..

Cheers,
Dmitry Shevkoplyas

On Sun, Jan 17, 2021 at 10:41 PM <david03kimo@...> wrote:
Hi,Dmitry,

It works.Thank you for your guidance.
I use TWS and IB gateway to run API concurrently.One is live account and the other is paper account with different port numbers and client ID, although?I don't know how to open 2 TWS on my mac.
But I can now test strategies and get historical data concurrently.


?Thanks and cheers,
------
Forex trader
David Liao