¿ªÔÆÌåÓý

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

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


Re: How to get longer historical data?

 

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


Adding delta information to positions in ApiDemo (java)

Jos van de Werken
 

¿ªÔÆÌåÓý

Hello all,

?

I¡¯m trying to add delta¡¯s to my positions in a adjusted ApiDemo example, and I¡¯m encountering some issues. I hope somebody can help me.

?

I¡¯ve added a ¡°FishTailContractData¡± (FishTail is the name of my strategy) object to the existing PositionRow, a working copy of the ApiDemo program.

This object can receive tickdata and remember the last ask, bid, markprice, but also delta, theta etc. of a contract.

When the data has changed I would like to update the position panel using the FishTailContractDataHandler to invoke a screen-update and/or portefeuille-delta-calucations.

?

?

My problem:

When I receive a position from TWS I also get a Contract-object with the position. It contains everything including description() and conid() etc. etc.

(approach1)

When I pass this contract in the constructor of a new FishTailContractData object, I¡¯m will not receive any ticks from TWS.

(approach2)

When I use this contract in a contract-details-request, and use the returned ConrtractDetails.contract() from TWS, then I will receive ticks.

However after the ¡°->¡± I cannot ¡°see¡± my current row, so I cannot connect the right row to the right ticks in the right FishTailContractData object.

?

?

I¡¯m relatively new to java. I¡¯ve a general knowledge of object oriented programming, but sometimes it¡¯s hard to understand where an instance of an object is.

Nevertheless I¡¯ve some automated option trading programs running on a daily basis in java, so I think everything can be learned! But now I¡¯m hoping for some help¡­ ?

?

?

?

public class FishTailContractData extends TopMktDataAdapter implements IOptHandler {

?????? Contract contract;

?????? double minPrice;

?????? double maxPrice;

?????? double ask;

?????? double bid;

?????? double last;

?????? double open;

?????? double close;

?????? double markPrice;

?????? double high;

?????? double low;

?????? double tickSize;

?????? int position;

??????

?????? double impliedVol;

?????? double delta;

?????? double optPrice;

?????? double gamma;

?????? double vega;

?????? double theta;

?????? double undPrice;

??????

?????? double deltaDollar=0;

??????

?????? FishTailContractDataHandler fishTailContractDataHandler;

??????

?????? boolean dataRequested=false;???

??????

?????? FishTailContractData(Contract newContract, FishTailContractDataHandler handler) {??????

???????????? contract = newContract;??

???????????? fishTailContractDataHandler = handler;

?????? }

??????

?????? void setTickSize(double newTickSize) {

???????????? tickSize = newTickSize;????????

?????? }

??????

?????? void subscribeMarketData() {

????????????

?????? ?????ApiDemo.INSTANCE.controller().reqTopMktData(contract, "221", false, false, this);

?????? ???? ApiDemo.INSTANCE.controller().reqOptionMktData(contract, "", false /* snapshot */, false /* regulatory snapshot */, this);

?????? ????

?????? ?????dataRequested=true;

?????? ????

?????? ?????System.out.printf("Data subscribed: %s / %s %s\n", contract.description(), this, contract.conid() );

?????? }

?????? void unSubscribeMarketData() {

?????? ???? ApiDemo.INSTANCE.controller().cancelTopMktData(this);

?????? ???? ApiDemo.INSTANCE.controller().cancelOptionMktData(this);

?????? ???? dataRequested=false;

?????? }?????

??????

?????? @Override public void tickPrice( TickType tickType, double price, TickAttrib attribs) {

???????????? switch( tickType) {????????????

??????????????????? case BID:

??????????????????? case DELAYED_BID:?????????????????????

????????????????????????? bid = price;????????????????????

????????????????????????? break;

??????????????????? case ASK:

??????????????????? case DELAYED_ASK:?????????????????????

????????????????????????? ask = price;????????????????????

????????????????????????? break;

??????????????????? case LAST:

??????????????????? case DELAYED_LAST:

????????????????????????? last = price;

????????????????????????? break;

??????????????????? case CLOSE:

??????????????????? case DELAYED_CLOSE:

????????????????????????? close = price;

????????????????????????? break;

??????????????????? case OPEN:

??????????????????? case DELAYED_OPEN:

????????????????????????? open = price;

????????????????????????? break;???????????????????

??????????????????? case MARK_PRICE:??????????

????????????????????????? markPrice = price;

????????????????????????? if (last==0) last=markPrice;

????????????????????????? break;

??????????????????? case HIGH:

????????????????????????? high = price;

????????????????????????? break;??????????????????????????

??????????????????? case LOW:

????????????????????????? low = price;

????????????????????????? break;?????????????

??????????????????? default:????????????????????????

????????????????????????? break;

???????????? }

???????????? tickReceived();

???????????? System.out.printf("Tick (%s) received for %s (%s): %.02f\n", tickType, contract.description(), contract.conid(), last);

?????? }

??????

?????? void tickReceived() {

???????????? if (fishTailContractDataHandler != null)

???????????? ?????? fishTailContractDataHandler.fishTailContractDataReceived();

?????? }

??????

?????? double getPrice() {??????

???????????? if (markPrice!=0) return roundToTickSize(markPrice);

???????????? if (last!=0) return roundToTickSize(last);

???????????? if ((ask!=0) && (bid!=0)) return roundToTickSize((bid+ask)/2);

???????????? if (bid!=0) return roundToTickSize(bid);

???????????? if (ask!=0) return roundToTickSize(ask);

???????????? if (close!=0) return roundToTickSize(close);

???????????? return 0;

?????? }

??????

?????? public double roundToTickSize(double price) {

???????????? if (tickSize==0) {

??????????????????? return Math.round((price * (1/0.01))) * 0.01;

???????????? } else {

??????????????????? return Math.round((price * (1/tickSize))) * tickSize;

???????????? }??????????????????

?????? }

?

?????? @Override

?????? public void tickOptionComputation(TickType tickType, double impliedVolNew, double deltaNew, double optPriceNew,

??????????????????? double pvDividendNew, double gammaNew, double vegaNew, double thetaNew, double undPriceNew) {

????????????

???????????? if (delta>1000) return; //zie soms echte bagger binnenkomen???

????????????

???????????? impliedVol = impliedVolNew;

???????????? delta= deltaNew;

???????????? optPrice = optPriceNew;

???????????? gamma= gammaNew;

???????????? vega = vegaNew;

???????????? theta = thetaNew;

???????????? undPrice = undPriceNew;

???????????? System.out.printf("Option data tick received for %s (%s)? *? Delta %.03f Theta %.03f? *? TickType %s\n", contract.description(), contract.conid(), delta, theta, tickType);?????????

?????? }

??????

?????? public void publicCalcGreeks() {??????

???????????? deltaDollar = delta * position * ( contract.secType()==SecType.OPT ? 100 : 1); //to do: change 100 in multiplier

?????? }

??????

?????? public interface FishTailContractDataHandler {

???????????? void fishTailContractDataReceived();????????

?????? }

?

}

?

?

?

?

?

?

?

?


additional messages besides in messages.py to facilitate reading of tws api log

 

Besides the list of ? incoming messages with? the highest? number 102??

COMPLETED_ORDERS_END =102
and highest
EQ_COMPLETED_ORDERS????????? = 99

Are there any other messages besides the listed? ones in message.py?


Regards
Maths


Re: Getting a list of all ticker symbols

 

Have you tried googling

"list of US tickers"

? Plenty of results

On Thu, Jan 14, 2021, 21:08 Don Rubin <donrubin@...> wrote:

Using the api I would like to get a list of all USA stock ticker symbols. In TWS when you enter an ambiguous ticker it displays a dialog with close matches. I wonder if that mechanism is accessible via the api.

?

Ultimately what I am trying to do is determine when a NEW symbol is added. I have looked at the NYSE and NASDAQ websites to see if they have that information to scrape but didn¡¯t find anything.

?

Ideas?


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

 

Bar time - 30 m


What time is returning to the Bar "Time" field

 

Good morning. What time is returned in a Bar "Time" field - the start time of a bar formation or the end time?

The NQ futures closed on Friday at 17:00 EST,?but the time of the last candle returns as the time of its beginning at 16:30.?

20210115? 15:30:00 12824.25 12838 12793 12799
20210115? 16:00:00 12799.25 12800 12767 12772.25
20210115? 16:30:00 12770.25 12778.25 12755.5 12759

What could be a mistake?



Re: Getting a list of all ticker symbols

 

Unless you're going after pink sheets too, the R3000 lists (1k + 2k) basically cover every listed stock in America.? Those aren't hard to find.??


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

 

It was immediately clear from the logs that your GAT string was not included in the request to IB, the rest was simple deduction.

Here's was a MKT order with GAT should look like in the logs - in this case, GAT="20210117 15:20:00", note the?highlighted?part:
19:57:08:053 <- 3-39-1131846390-0-IBM-STK--0.0---SMART--USD----sell-1-MKT-0.0-0.0-GTC---O-0--1-0-0-0-0-0-0-0--0.0-20210117 15:20:00------0---1-0---0---0-0--0------0-----0--------0---0-0--0-
p.s. your log might look a bit different [extra/missing fields etc.] depending on the IB API version that you're using, but it's very similar in all versions of recent years?


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

 

I hope you are right. ( sounds logical)
However the TSW API clearly stipulates an upper case.........
string? ?[get, set]
As well PYcharm did auto complete it......
Will check on Monday.

P.S how do you diduct from the??debug log extract,?that "GoodAfterTime?" field was not transmitted to IB?

Toda Raba, cheers, Erez


Re: Historical downloader

 

Richard, what's bar time is returned by the broker's servers - the start time of the bar or the end time of the bar?


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

 

If you look at your debug log extract, for your order id 283 (the GAT order, you'd see the following:

10:31:32:617 <- 3-283-0-FB-STK--0.0---SMART--USD-----BUY-42-MKT-------0--1-280-0-0-0-0-0-0--0--------0---1-0---0---1-1--0------0-----0-----------0---0-0---0--0-0-0-0--1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-0----1.7976931348623157e+308-----0-0-0--

This indicates that your GoodAfterTime field was not transmitted to IB, which explains why the MKT order executed immediately.
The reason this was not transmitted is possibly because you did not use the correct field name - I think it should be "goodAfterTime" (lowercase g) and not "GoodAfterTime"


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

 

This has vexed me for years. Pulling RTD data into Excel mostly works reliably for me during regular trading hours ("RTH").?However, when I run the same RTD data requests?outside of RTH, the data populates very inconsistently. For instances, it's currently Saturday and I'm running the RTD formulas to get data for the BMO option chain, and about 12 of the 50 rows populate properly (with the closing prices from Friday), while the rest just have placeholder "-1.00" values in all of the Bid/Ask/Size/etc cells. But what's weirdest about this behavior is that if I cancel all the RTD requests, and then run the exact same query again,?a different, and seemingly random selection of contract rows will populate data, while some rows that had worked on the previous query now display -1.00's.

In short, outside of RTH it seems almost random which rows of data populate in a given request...sometimes I luck out and get good coverage, i.e. perhaps 80% of rows might properly populate with data, while other times I might only get a handful of rows working properly. I can't think of anything that would account for this behavior. It would be one thing if ALL the data populated, or NO data populated (e.g. the DDE API does not display data for?any rows outside of RTH). But what makes no sense is that it seems completely haphazard as to which rows populate and which do not on any given data request. Can anyone explain this behavior? I.e. is there something about how IB has its API set up outside of RTH that would give rise to this, despite it seeming to work reliably during RTH?