Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand DownloaderDataProvider To Handle Canonical Symbols #8236

Open
4 tasks done
Martin-Molinero opened this issue Jul 31, 2024 · 0 comments
Open
4 tasks done

Expand DownloaderDataProvider To Handle Canonical Symbols #8236

Martin-Molinero opened this issue Jul 31, 2024 · 0 comments

Comments

@Martin-Molinero
Copy link
Member

Expected Behavior

  • The DownloaderDataProvider launcher program can handle canonical symbols, using a lookup symbols call if supported

Actual Behavior

N/A

Potential Solution

            if (symbol.IsCanonical())
            {
                try
                {
                      if (_providerInstance is IDataQueueUniverseProvider universeProvider)
                      {
                          symbols = _brokerage.LookupSymbols(symbol, true);
                      }
                      else if (symbol.SecurityType.IsOption())
                      {
                          // we can try with the live option chain provider
                          var chainProvider = new LiveOptionChainProvider();
                          chainProvider.GetOptionContractList(symbol);
                          etc
                }
                }
                catch(ex)
                {
                       Log.Error(ex)
                }

                if (symbols.IsNullOrEmpty())
                {
                    // log trade warning, we can pass the canonical to the provider, maybe it handles it, Polygon for example does,
                    // polygon should be covered by the first `if` in the try catch though, meaning we can clean it up a bit
                }
            }

Reproducing the Problem

N/A

System Information

N/A

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant