Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport security lookup #215
Comments
|
Can you submit a patch for this. It seems pretty straightforward. |
|
I'm having issues with building from source on Windows that look related to #164 (comment). If I can resolve them, then I'll give this a shot. |
|
If you are having |
|
I suggest you build on Linux. Good luck. |
Add support for security lookup (resolves #215)
|
I implemented a similar function to do security lookup (sorry I could not share it as I cannot push to GH). One additional thing I found useful was to run regex on the |
|
As in R> res <- lookupSecurity("IBM", "mtge")
R> base::sub(pattern="^(.+)<(.)(.+)>$", "\\1 \\U\\2\\E\\3", perl=TRUE, res$security)
[1] "IBM Mtge" "IBMMT Mtge"
R> That's nice. Now we have of course "a published API" so we ought be careful about changes. Maybe add as a new third column? |
|
Yes, that's right (and I tidied up my initial comment on this to make the intent clearer). I would agree it is better to add a column in this case. |
|
Oh, and as for
that is normal -- only the three of us can. GitHub works by you "forking", making the change in what is now your version and then submitting a so-called "pull request" back to us in order to get the change merged. Works well, millions of tutorials out there. Try it next time. |
|
I didn't mean I would try to push directly to Rblp/Rblpapi. I meant I
cannot push to my forks on GitHub from where I would test locally (or
anywhere I can actually push to from there). This is why I just made the
suggestion in this way, because it is a small change which I thought might
be useful.
…On Tue, Apr 25, 2017 at 21:06 Dirk Eddelbuettel ***@***.***> wrote:
Oh, and as for
sorry I could not share it as I cannot push to GH
that is normal -- only the three of us can. GitHub works by you "forking",
making the change in what is now your version and then submitting a
so-called "pull request" back to us in order to get the change merged.
Works well, millions of tutorials out there. Try it next time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#215 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMuTuuc_jGCrysa68U-7r87vk-3SorWsks5rzeG8gaJpZM4L-ShM>
.
|
|
In a fuller example now at work: R> res <- lookupSecurity("SNAP")
R> res
security description
1 SNAP US<equity> Snap Inc (U.S.)
2 SNAP UN<equity> Snap Inc (New York)
3 SNA US<equity> Snap-on Inc (U.S.)
4 SNAP US 01/19/18 P15<equity> January 18 Puts on SNAP US Strike 15
5 SNAP US 07/21/17 P20<equity> July 17 Puts on SNAP US Strike 20
6 SNAP US 01/18/19 C30<equity> January 19 Calls on SNAP US Strike 30
7 SNAP US 05/19/17 P20<equity> May 17 Puts on SNAP US Strike 20
8 SNAP US 05/19/17 C23<equity> May 17 Calls on SNAP US Strike 23
9 SNAP SW<equity> Snap Inc (Switzerland)
10 SNAP US 01/19/18 P13<equity> January 18 Puts on SNAP US Strike 13
11 SNAP US 01/19/18 C25<equity> January 18 Calls on SNAP US Strike 25
12 SNAP US 01/18/19 P15<equity> January 19 Puts on SNAP US Strike 15
13 SNAP US 07/21/17 P18<equity> July 17 Puts on SNAP US Strike 18
14 SNAP US 01/19/18 P20<equity> January 18 Puts on SNAP US Strike 20
15 SNAP US 07/21/17 P15<equity> July 17 Puts on SNAP US Strike 15
16 SNAP US 01/19/18 P18<equity> January 18 Puts on SNAP US Strike 18
17 SNAP US 10/20/17 P15<equity> October 17 Puts on SNAP US Strike 15
18 SNAP US 04/28/17 P21<equity> April 17 Puts on SNAP US Strike 21
19 SNAP US 05/19/17 C22<equity> May 17 Calls on SNAP US Strike 22
20 SNAP US 05/19/17 P19<equity> May 17 Puts on SNAP US Strike 19
R> res[, "symbol"] <- sub(pattern="^(.+)<(.)(.+)>$", "\\1 \\U\\2\\E\\3", perl=TRUE, res[, "security"])
R> res
security description symbol
1 SNAP US<equity> Snap Inc (U.S.) SNAP US Equity
2 SNAP UN<equity> Snap Inc (New York) SNAP UN Equity
3 SNA US<equity> Snap-on Inc (U.S.) SNA US Equity
4 SNAP US 01/19/18 P15<equity> January 18 Puts on SNAP US Strike 15 SNAP US 01/19/18 P15 Equity
5 SNAP US 07/21/17 P20<equity> July 17 Puts on SNAP US Strike 20 SNAP US 07/21/17 P20 Equity
6 SNAP US 01/18/19 C30<equity> January 19 Calls on SNAP US Strike 30 SNAP US 01/18/19 C30 Equity
7 SNAP US 05/19/17 P20<equity> May 17 Puts on SNAP US Strike 20 SNAP US 05/19/17 P20 Equity
8 SNAP US 05/19/17 C23<equity> May 17 Calls on SNAP US Strike 23 SNAP US 05/19/17 C23 Equity
9 SNAP SW<equity> Snap Inc (Switzerland) SNAP SW Equity
10 SNAP US 01/19/18 P13<equity> January 18 Puts on SNAP US Strike 13 SNAP US 01/19/18 P13 Equity
11 SNAP US 01/19/18 C25<equity> January 18 Calls on SNAP US Strike 25 SNAP US 01/19/18 C25 Equity
12 SNAP US 01/18/19 P15<equity> January 19 Puts on SNAP US Strike 15 SNAP US 01/18/19 P15 Equity
13 SNAP US 07/21/17 P18<equity> July 17 Puts on SNAP US Strike 18 SNAP US 07/21/17 P18 Equity
14 SNAP US 01/19/18 P20<equity> January 18 Puts on SNAP US Strike 20 SNAP US 01/19/18 P20 Equity
15 SNAP US 07/21/17 P15<equity> July 17 Puts on SNAP US Strike 15 SNAP US 07/21/17 P15 Equity
16 SNAP US 01/19/18 P18<equity> January 18 Puts on SNAP US Strike 18 SNAP US 01/19/18 P18 Equity
17 SNAP US 10/20/17 P15<equity> October 17 Puts on SNAP US Strike 15 SNAP US 10/20/17 P15 Equity
18 SNAP US 04/28/17 P21<equity> April 17 Puts on SNAP US Strike 21 SNAP US 04/28/17 P21 Equity
19 SNAP US 05/19/17 C22<equity> May 17 Calls on SNAP US Strike 22 SNAP US 05/19/17 C22 Equity
20 SNAP US 05/19/17 P19<equity> May 17 Puts on SNAP US Strike 19 SNAP US 05/19/17 P19 Equity
R> So @armstrtw @johnlaing : how do we feel about this? Worth it? Or just tuck into the examples section of the help page? |
|
This is clearly useful. At a minimum we could provide a little utility function implementing this regex. I'm less enthusiastic about tacking on unsolicited modifications/enhancements to returned data. I tend to like leaving the bbg output alone as much as possible, just on principle. |
|
I think I agree on both counts. May just stick it into the example section. |
Something equivalent to the MATLAB lookup() function would be nice. Basically I would like to automate the task of typing the TK or SECF command into Bloomberg Terminal. According to the Bloomberg API Developer Guide section 7.10.1, it looks like the C code would look like: