Skip to main content

Defaults

In the defaults section you can define provider defaults, and other parameters, for Python commands, if no argument is explicitly sent when the command runs. For 'provider', there are two formatting options:

  1. Single provider: this provider will be selected by default for the given command.
  2. Priority list: the first provider in the list with all required credentials setup will be used.
{
...
"defaults": {
"commands": {
"/equity/price/historical": {
"provider": "yfinance"
},
"/equity/fundamental/balance": {
"provider": [
"yfinance",
"fmp",
"polygon"
]
},
}
}
}
note
  • If no configuration is specified the command will use the default priority list. This is the list of available providers for the command sorted alphabetically.

Query Parameters

Individual parameters can also be defined in user_settings.json, and the values supplied will applied at runtime. The default will be ignored when the parameter is passed in the function call.

{
...
"defaults": {
"commands": {
"/equity/price/historical": {
"provider": "yfinance",
"chart": true,
"chart_params": {
"heikin_ashi": true,
"indicators": {
"sma": {
"length": [
21,
50
]
},
"ema": {
"length": 150
}
}
}
},
"/economy/cpi": {
"provider": "oecd"
}
}
}
}
important
  • Default parameters are somewhat limited in the FastAPI. Apart from 'provider', they are applicable only where parameters have been defined as Optional, with a default value of None.

  • Command docstrings and descriptions will not change according to items defined here.