- ago
I am testing order manager using Interactive Brokers to buy the EXS2.DE (Frankfurt stock exchange) using a manual entered trade. The trade is a market order during market hours. I have tried using as symbol EXS2.DE and EXS2 . So far getting Error and in message: Could not find contract for symbol

Any help you can provide?

Many thanks

Michael
0
696
Solved
21 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.07% )
- ago
#1
Please see the Interactive Brokers section in the Help to identify non-U.S. stocks, but here's a shortcut that I hope works for you -

1. Click File > Open Wealth-Lab User Data Folder
2. Close Wealth-Lab
3. Open IBContracts.txt
4. Paste this record at the bottom.
EXS2.DE=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|

In this case you can use EXS2.DE when referring to the symbol in Wealth-Lab, but you can use anything you want for the symbol to the left of the = sign, e.g.,
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
or...
EXS2.ISHRS=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|

5. Repeat #4 for other German symbols (just replace the symbol name for each record).

6. Save and close IBContracts.txt.

Now IB should be able to identify the contract. Let us know how it works out!
1
Best Answer
- ago
#2
works perfect - thank you Cone :)
1
- ago
#3
I am using IB extension in the demo

Can I route orders to a specific exchange or just "smart" ?

I followed this chat and added this line to the
IBcontracts.txt
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|

The manual order manager transmits orders, but always smart, even so I tried TGATE, GETTEX and other exchanges the symbol can be traded.
I also tried a direct entry in the order manager symbol field:
EXS2;STK;EUR;TGATE
EXS2;STK;EUR;TGATE;TGATE
EXS2;STK;EUR;SMART;TGATE
EXS2;STK;EUR;IBIS;TGATE
Same result: All orders are smart-routed in IB-TWS

Best regards
Stefan
0
Cone8
 ( 6.07% )
- ago
#4
We're not doing directed trading in WealthLab.
SMART gives you the best price for the inside market, so why wouldn't you want to use that?
0
- ago
#5
Thanks for your fast response!

Ok, I understand.
At IB not all European/German exchanges are considered in smart routing and commissions are differing strongly.

Furthermore, it seems, that WealthLab only allows regular trading hours ?

At least my trials resulted in after-hour-markets in smart-orders, which are hold inactive until the next day.
0
Cone8
 ( 6.07% )
- ago
#6
It looks to me like SMART is used for any of those exchanges.

Close WealthLab and make sure there's only one record for the symbol in IBContracts.txt and use the exchange to identify the contract where you want it to to trade, e.g., IBIS
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|

Although you could even create unique symbols for different exchanges like this -
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
EXS2T=EXS2|EUR|STK|SMART|TGATE|EXS2|||0|
EXS2S=EXS2|EUR|STK|SMART|SWB|EXS2|||0|

If for example you use EXS2S, then it would trade on SWB (I think). You'll have to see if it works.
Restart WealthLab after making changes to IBContracts.txt.

To enable Pre/Post Market trading -

0
- ago
#7
Thanks for your response.
Unfortunately it doesn't work. I changed and saved IBcontracts file (Wealth-Lab closed).


Than I started Wealth-Lab (pre/post trading enabled)



Same result. Only the symbol EXS2 worked (evenso TWS returned an error, that no security defintion has ben found) and resulted in an non-active order (waiting for the next day). Order placing with EX2S and EXS2T resulted in errors in Wealth-Lab (could not find contrcat for symbol)

Charts also don't work for EXS2S and EXS2T.

Best regards
Stefan
0
- ago
#8


Screenshot Order Manager
0
- ago
#9
After the above tests, I just renamed
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
to
EXS3=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
in IBcontracts.

It seems that the name-cast doesn't work. EXS3 can't be used in chart or in manual order manager.
0
Cone8
 ( 6.07% )
- ago
#10
I'm looking at your TWS image and it looks to me like you don't have data subscriptions for that data. The API will only work if you subscribe to the data you need.
0
- ago
#11
I have market data for SWB and TGATE (which I tested) but not for IBIS-ETF or FWB-ETF.



Evenso I was able to open an order for EXS2 at IBIS, but it is getting more strange.
If I reopen WealthLab and write at the beginning EXS2;STK;EUR;IBIS in the manual order window, it will be placed at IBIS. All further orders even the once with EXS2 are routed then to IBIS and not to SMART.

I will try tomorrow with a simple stock, for which I have all market data at all tested exchanges.


0
Cone8
 ( 6.07% )
- ago
#12
Give this a try - IBIS is the Primary Exchange.

CODE:
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0| EXS2T=EXS2|EUR|STK|TGATE|IBIS|EXS2|||0| EXS2S=EXS2|EUR|STK|SWB|IBIS|EXS2|||0|
0
- ago
#13
I managed after some testing to use the Order Manager sucessfully for some German stocks.
I used in IBcontracts.txt
BMW.IBIS=BMW|EUR|STK|IBIS|IBIS
BMW.SMART=BMW|EUR|STK|SMART|IBIS
BMW=BMW|USD|STK|SMART|IBIS||||0|
ENR.IBIS=ENR|EUR|STK|IBIS|IBIS
ENR.SMART=ENR|EUR|STK|SMART|IBIS
EXS2.IBIS=EXS2|EUR|STK|IBIS|IBIS
EXS2.SMART=EXS2|EUR|STK|SMART|IBIS
The x.IBIS are placed direct at IBIS. x.SMART works also.
Other direct placements don't work.

furthermore I used symbol mapping for ENR (without that, the ENR.SMART got the name of the US Stock ENR).
ENR.SMART = ENR
ENR.IBIS = ENR

But now I found, that the intraday bars, have very strange timestamps (I requested 60min bars):



BMW.SMART should have bars between 8:00 and 22:00 CET
BMW.IBIS should have bars between 9:00 and 17:30 CET
Is the bar timestamp the end of the bar? Then it could be correct for BMW.IBIS

Thanks for your help.
0
Cone8
 ( 6.07% )
- ago
#14
Intraday timestamps are always adjusted (if required) to end of bar for WealthLab.

Re: Symbol Mapping
It sounds to me like you're entering the wrong symbol then.
IBContracts.txt probably already has this record:
ENR=ENR|USD|STK|SMART|NYSE|ENR|||0|
So if you enter ENR in a chart it will sync to the NYSE contract.

You should define the IBIS contract something like this -
ENR.IBIS=ENR|EUR|STK|SMART|IBIS|ENR|||0|

In a chart or DataSet, you should enter ENR.IBIS (not ENR).
... although I can see from the image, you're doing that.

Make sure to restart WealthLab after making changes to IBContracts.txt. For now, that's the only time it's refreshed for the session.
0
- ago
#15
Concerning the bars. Please have a look into the screenshot.

For all x.smart (every German stock symbol, which I defined as described above and according to your advice) I receive strange bar-data for hourly quotes.

E.g. Open 3:30 !! and close 12:30!! - correct would be 8am-22am Central European Time incl. pre/post-trading or 9:00 - 17:30 CET for regular trading hours.

Or in other words: Depending on the routed exchange I receive correct (IBIS routed) or wrong (SMART routed) intraday timestamps.

I wrote a small C# strategy to write all bar timestamps to log: Confirmed the behavior shown in the screenshot.

Concering the symbol mapping: I did exactly as you discribed (= add ENR.SMART to the chart). Without additional symbol mapping I get the wrong stock name from the US-Stock ENR.
But this isn't a real problem...
0
Cone8
 ( 6.07% )
- ago
#16
Open a chart for BMW.SMART and look at the Market below the chart.
If it's US Stocks (or somewhere other than Frankfurt), you'll need to do one or both of the following:

1. check the record(s) for accuracy in IBContracts.txt. Restart if you had to change it.
2. once the market appears correctly below the chart, right click the chart and Reload the data.
0
- ago
#17
You are right: There seems to be the problem.
I closed WealthLab, edited IBcontracts.txt and reopened it several times.

In the Chart AND in the Order Manager, I had the following results:
BMW.IBIS=BMW|EUR|STK|IBIS|IBIS|BMW|||0|
-> correct exchange ("Frankfurt..."), quotes accessibel with correct bar-time
BMW.SMART=BMW|EUR|STK|SMART|IBIS|BMW|||0|
-> wrong exchange ("USstock"), quotes accessibel but with wrong bar-time
BMW.SMART2=BMW|EUR|STK|SMART|SMART|BMW|||0|
-> wrong exchange ("USstock"), quotes accessibel but with wrong bar-time
BMW.SMART3=BMW|EUR|STK|IBIS|SMART|BMW|||0|
-> wrong exchange ("USstock"); no quotes
BMW.SMART4=BMW|EUR|STK|SMART
-> wrong exchange ("USstock"); no quotes

What can I do ?
0
Cone8
 ( 6.07% )
- ago
#18
Currently, the IBProvider will automatically identify "Frankfurt" only for IBIS and FWB.

For SMART and others, you'll have to create the entry in Markets & Symbols. In other words, create records in Symbols for BMW.SMART (and others like it) and choose Frankfurt for the Market. After you set it up, you'll need to Reload your charts change the cached bars of data. (No need to restart WealthLab for this.)



Probably we need another way to define default markets for the IBProviders instead of defaulting to US Stocks for SMART. We could do it by currency, so if you mostly trade Frankfurt, we could have a defaults like USD=US Stocks; EUR=Frankfurt; CHF=Swiss Exchange. I'm open to ideas.
0
Cone8
 ( 6.07% )
- ago
#19
When SMART is identified as the "Exchange" (or the Exchange alone can't identify the Market) we should be working with the "Primary Market" field, which is IBIS in the cases above. We were doing that, but there was a bug that was just returning the "IBIS" as the market instead of converting it to

I'll fix this for the next IBProvider Build 39.

Meanwhile, instead of creating Symbol records, just "Make a Copy" of the Frankfurt market and make its Market Name: IBIS. This will have the effect you're looking for.

This will work for a record like this:
BMW.SMART=BMW|EUR|STK|SMART|IBIS|BMW|||0|

1
- ago
#20
Using the Primary Exchange for SMART contracts seems to be the best solution.

Furthermore it seems, that per/post-trading hours can't be defined or changed in the market and symbols editor.
For "Frankfurt" it should be 8-22:00 local time. My copied IBIS market (based on locked Frankfurt) has no pre/post trading hours in the bars.
But it works with the symbol/market edit described above for Frankfurt.

Considering the pre-hours data can be very useful in live trading, to prevent trading in extreme situations after regular opening of market.

@Cone: Thank you very much for your support. I will subcribe for an WL annual plan in the next days.
0
Cone8
 ( 6.07% )
- ago
#21
Awesome! Re: pre/post data and trading...

For Strategy testing, just uncheck "Filter Pre/Post Market Data" in the Strategy Settings.

For charts, uncheck "Filter" at the bottom.

To enable trading Pre/Post, see Preferences (F12) > Trading > Miscellaneous > Enable Pre/Post Market Trading
0

Reply

Bookmark

Sort