joshuaulrich / IBrokers

R API to Interactive Brokers Trader Workstation
65 stars 54 forks source link

Added function reqMatchingSymbols that searches all available symbols… #36

Closed Wesseldr closed 1 year ago

Wesseldr commented 1 year ago

Implemented the reqMatchingSymbols call. It returns a dataframe with the matched symbols. The search matches tickers and names. IB will only return a maximum of 16 matches. see https://interactivebrokers.github.io/tws-api/matching_symbols.html If no symbols are found, it returns an empty dataframe.

joshuaulrich commented 1 year ago

@Wesseldr Thanks again for this contribution! I just noticed that you used glue::trim(). IBrokers doesn't use glue and I don't want to add a dependency for one line of code. Can you tell me why we need glue::trim() here?

It would be nice if you could provide the output of dput(derivativeSecTypes) before and after the call to glue::trim(). That will help me understand why it's needed and find a solution using available packages.

Wesseldr commented 1 year ago

it trims away the white spaces. but perhaps native R works there as well..

Wessel "No matter where you go, there you are" from Buckaroo Banzai

On Wed, Nov 9, 2022 at 6:35 PM Joshua Ulrich @.***> wrote:

@Wesseldr https://github.com/Wesseldr Thanks again for this contribution! I just noticed that you used glue::trim(). IBrokers doesn't use glue and I don't want to add a dependency for one line of code. Can you tell me why we need glue::trim() here?

It would be nice if you could provide the output of dput(derivativeSecTypes) before and after the call to glue::trim(). That will help me understand why it's needed and find a solution using available packages.

— Reply to this email directly, view it on GitHub https://github.com/joshuaulrich/IBrokers/pull/36#issuecomment-1309104601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6TWCOVTGO6BXT36XUWFHLWHPOGDANCNFSM6AAAAAAQRGX54A . You are receiving this because you were mentioned.Message ID: @.***>

joshuaulrich commented 1 year ago

There's base::trimws() to strip leading/trailing whitespace. I'm not sure what glue::trim() does. The documentation is not helpful at all.

This trims a character vector according to the trimming rules used by glue.

But doesn't say or reference what those trimming rules are. And the 'Examples' section does not give examples of the trim() function.

Wesseldr commented 1 year ago

Ws more of a courtesy to the client that it doesn't get the mess that IB sends over with CSV strings that end on a , etc... at least I think its taht part of the code. But will do fine without it I think, the user has to deal with additional spaces at the beginning of a string and the end of a string..

"No matter where you go, there you are" from Buckaroo Banzai

On Wed, Nov 9, 2022 at 8:54 PM Joshua Ulrich @.***> wrote:

There's base::trimws() to strip leading/trailing whitespace. I'm not sure what glue::trim() does. The documentation is not helpful at all.

This trims a character vector according to the trimming rules used by glue.

But doesn't say or reference what those trimming rules are. And the 'Examples' section does not give examples of the trim() function.

— Reply to this email directly, view it on GitHub https://github.com/joshuaulrich/IBrokers/pull/36#issuecomment-1309282509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6TWCOTAF2ZMDTSBLGOTLTWHP6PBANCNFSM6AAAAAAQRGX54A . You are receiving this because you were mentioned.Message ID: @.***>

Wesseldr commented 1 year ago

(but I get that you try to minimize the dependence as much as possible :-) "No matter where you go, there you are" from Buckaroo Banzai

On Wed, Nov 9, 2022 at 9:03 PM J.W. de Roode @.***> wrote:

Ws more of a courtesy to the client that it doesn't get the mess that IB sends over with CSV strings that end on a , etc... at least I think its taht part of the code. But will do fine without it I think, the user has to deal with additional spaces at the beginning of a string and the end of a string..

"No matter where you go, there you are" from Buckaroo Banzai

On Wed, Nov 9, 2022 at 8:54 PM Joshua Ulrich @.***> wrote:

There's base::trimws() to strip leading/trailing whitespace. I'm not sure what glue::trim() does. The documentation is not helpful at all.

This trims a character vector according to the trimming rules used by glue.

But doesn't say or reference what those trimming rules are. And the 'Examples' section does not give examples of the trim() function.

— Reply to this email directly, view it on GitHub https://github.com/joshuaulrich/IBrokers/pull/36#issuecomment-1309282509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6TWCOTAF2ZMDTSBLGOTLTWHP6PBANCNFSM6AAAAAAQRGX54A . You are receiving this because you were mentioned.Message ID: @.***>