Datasets

FactSet

Introduction

Instead of using the data from QuantConnect or your brokerage, you can use data from FactSet if you have the authetication JSON file.

To view the implementation of the FactSet integration, see the Lean.DataSource.FactSet repository.

Setup

To access FactSet data, create the authetication configuration JSON file. You will provide the path to its location using the --factset-auth-config-file option. This file has the following format.

{
    "clientId": "abcde123",
    "clientAuthType": "Confidential",
    "jwk": {
        "kty": "RSA",
        "use": "sig",
        "alg": "RS256",
        "kid": "34n2j4n23j42m34kn234",
        "d": "42r34t345k3m45-34t3k45k-345v",
        "n": "42r34t345k3m45-34t3k45k-345v",
        "e": "42r34t345k3m45-34t3k45k-345v",
        "p": "42r34t345k3m45-34t3k45k-345v",
        "q": "42r34t345k3m45-34t3k45k-345v",
        "dp": "42r34t345k3m45-34t3k45k-345v",
        "dq": "42r34t345k3m45-34t3k45k-345v",
        "qi": "42r34t345k3m45-34t3k45k-345v"
    },
    "wellKnownUri": "https://auth.factset.com/.well-known/openid-configuration"
}

To get this file, contact FactSet Support.

Supported Datasets

Our FactSet integration supports US Index Options securities.

Alternative Data

If you have licensed alternative data with QuantConnect, it works as expected with the FactSet data provider for research and backtesting.

Research

To access FactSet data from the local Research Environment, open a terminal in your organization workspace and then run lean research <projectName> --data-provider-historical=factset --factset-auth-config-file=<auth.json>.

$ lean research "My Project" --data-provider-historical=factset --factset-auth-config-file=auth.json

If you provide any of the preceding options, your Lean configuration file saves them so that you only need to run lean research <projectName> to open the Research Environment with the same options.

Backtesting

To run a local backtest with FactSet data, open a terminal in your organization workspace and then run lean backtest <projectName> --data-provider-historical=factset --factset-auth-config-file=<auth.json>.

$ lean backtest "My Project" --data-provider-historical=factset --factset-auth-config-file=auth.json

If you provide any of the preceding options, your Lean configuration file saves them so that you only need to run lean backtest <projectName> to run another backtest with the same options.

Optimization

Follow these steps to run a local optimization job with FactSet data:

  1. Add some parameters to your project.
  2. Open a terminal in your organization workspace.
  3. Run lean optimize <projectName> --data-provider-historical=factset --factset-auth-config-file=<auth.json>.
  4. $ lean optimize "My Project" --data-provider-historical=factset --factset-auth-config-file=auth.json
  5. Follow the steps in the interactive wizard to configure your optimization job settings.

The lean optimize command also accepts additional options so that you can select Polgyon and run the command in non-interactive mode. If you provide any of the preceding options, your Lean configuration file saves them so that you only need to run lean optimize <projectName> to run another optimization job with the same options.

Live Trading

Our implementation of the FactSet integration does not include a live data provider.

Depending on the brokerage you select, you may need to provide some required brokerage options. To use a FactSet historical data, include the --data-provider-historical and --factset-auth-config-file options.

$ lean live deploy "My Project" --data-provider-historical=factset --factset-auth-config-file=auth.json --brokerage "Paper Trading"

If you provide any of the preceding options, your Lean configuration file saves them so that you only need to run lean live deploy <projectName> --brokerage <brokerageName> to deploy another live algorithm with the same options.

Pricing

To learn more about FactSet data solutions and pricing, see the Data Solutions page on the FactSet website.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: