[R-SIG-Finance] Syntax - symbol problem
Christian Lear
cl1 at infomaniak.ch
Wed Mar 1 22:26:52 CET 2017
Thank you, Enrico, for your suggestion.
It does not seem to get the data from IB on the currency contracts. Looking at the database / list closer, the second page defining the moving averages has a default USD input. So I do have 4 attributes, which may be the reason I am getting data for metals and energies. If anyone out there is using IB successfully on currency futures contracts, grains and options on all of the above, thanks for letting me know outside of the mailing list to avoid clogging it.
Cheers,
Christian
> On Mar 1, 2017, at 11:13 AM, Enrico Schumann <es at enricoschumann.net> wrote:
>
> On Wed, 01 Mar 2017, Christian Lear writes:
>
>> Hi,
>>
>> I’m using Interactive Brokers (IB) data feed running through R code (R
>> studio) with moving average filters on futures contracts.
>>
>> I have listed the contracts in an excel sheet. The sheet has 4
>> columns, contract (or ticker) i.e. “CLJ7" for April 2007 Crude Oil,
>> Security Type “Future”, Exchange “NYMEX” and Use 1 or 0 to activate
>> the excel line (contract) or not.
>>
>> My program works perfectly for Nymex energy contracts (CL, NG, RB,
>> HO), Nymex metals (GC, SI, etc.), Globex mini S&P (ES). However, the
>> program stops working and has an error when running Globex Euro FX
>> (6E), Japanese Yen (6J) and the other currencies. Note that the
>> currency contracts have the same syntax as the Nymex Energy, and Nymex
>> metals, namely “TickerMonthYear" (6EM7, CLJ7, GCJ7 etc.)
>>
>> 1. Does anyone know why the program fails to
>> recognize the currency futures contracts? Any
>> suggestions?
>>
>> Grains are also a problem. IB uses a different symbol structure,
>> namely Ticker MONth YEar “ZS MONabbrev YEar” (ZS JUL 17).
>>
>> 2. How would you solve for one code to read both the
>> CL contracts and the Grains ticker, knowing that the
>> symbol structure is different? Any ideas?
>>
>> I can send a short code and excel sheet test list to better
>> demonstrate the issue.
>>
>> Thanks for your help.
>>
>> Christian
>>
>
> 1) In my experience, you need four attributes to
> reliably specify a contract: the local symbol, the
> exchange, the currency and the security type. For
> 6E futures, that would mean
>
> symbol = 6EH7
> exchange = GLOBEX
> currency = USD
> type = FUT
>
> 2) An easy and _safe_ way is to keep a list/database of
> contracts with the four mentioned attributes, and
> then refer to this list when contract information is
> needed.
>
>
> --
> Enrico Schumann
> Lucerne, Switzerland
> http://enricoschumann.net
>
More information about the R-SIG-Finance
mailing list