Symbol conversion

Dear All,

I want my system to use Norgate as the end-of-day data provider and send orders to IB, but Norgate’s symbology is not the same as IB’s. For example Norgate uses AAPL, whereas IB uses AAPL-SMART-STK-USD.

So when I select the Norgate database as the market data source and my symbols list contains the Norgate symbols, how do I translate this to IB symbology? When sending orders using the IB controller, the symbol has to be in the format required by IB.

Do I need to write code for that, ie something like below?

norgateSymbol = NAME();
ibSymbol = norgateSymbol + "-SMART-STK-USD"

Or is there a way to translate between symbologies from one provider to the other automatically?

Did you read the documentation http://www.amibroker.com/guide/h_ib.html ? I guess not.
If you did you would know that you don’t need to add -SMART-STK-USD because these are DEFAULT values that are used if they are NOT specified at all, so AAPL just works.

1 Like

Your link explains how to use TWS as a market data source. In my case:

  • market data source = Norgate
  • order destination = TWS/IB using IB controller

My problem:

  • Norgate symbol = AAPL, or ESZ7
  • IB controller symbol = AAPL-SMART-STK-USD, or ESZ7-GLOBEX-FUT-USD.
    ==> Norgate symbol != IB controller symbol.

I am speaking about BOTH. IBController uses same defaults as data plugin. So the link applies to IBController too.

For symbols that don’t use defaults, like futures, you can use Alias field. It is designed for that purpose.
Really Google is your friend. Google “Alias +site:amibroker.com” and you will find everything.

Do the same, i.e use GOOGLE with +site:amibroker.com and you will see the answer to ALL your future questions immediately.

Hello,

Attached is an example of how I defined the alias for the Copper futures.
image

However, when a signal is generated and IB controller places an order, I still see that HG2_CCB is used as the symbol instead of the IB symbol, as shown in the below API log file snippet generated by TWS:

21:21:05:676 <- 3-25-16-HG2__CCB-STK--0---SMART--USD--Sell-17-STP-0-312.4-GTC--DU638802-O-0--0-15-0-0-0-0-0-0--0-------0--0---0---0-0--0------0-----0--------0-
21:21:05:677 -> 3-6-15-ApiPending-0-17--0-0--0--3-6-16-ApiPending-0-17--0-15--0--
21:21:06:044 -> 4-2-15-200-No security definition has been found for the request-

As a result, the request is rejected with the "No security definition has been found for the request" error.
Could anybody tell me what I am doing wrong?
Thanks!

Look for GetFnData function in help and try using GetFnData(“Alias”)

3 Likes