IbkrApi.Config (ibkr_api v1.0.3)
View SourceConfiguration settings for the IBKR API client.
This module provides functions to access configuration values with sensible defaults. Values can be overridden in your application configuration.
Example Configuration
config :ibkr_api,
host: "https://localhost",
port: "5050",
rate_limits: [
global: [limit: 45, time_window_ms: 1_000],
endpoints: [
iserver_marketdata_snapshot: [limit: 9, time_window_ms: 1_000],
# ... other endpoint-specific limits
]
]
Summary
Functions
Returns the base URL for the IBKR API.
Returns the default rate limit configuration.
Returns the configured host or the default value.
Returns the configured port or the default value.
Returns the rate limiting configuration.
Returns the rate limit configuration for a specific endpoint or global limit.
Validates the rate limit configuration.
Functions
Returns the base URL for the IBKR API.
@spec default_rate_limits() :: keyword()
Returns the default rate limit configuration.
Returns the configured host or the default value.
Returns the configured port or the default value.
@spec rate_limit() :: keyword()
Returns the rate limiting configuration.
Rate limits can be configured via application environment:
config :ibkr_api, :rate_limits,
global: [limit: 50, time_window_ms: 1_000],
endpoints: [
iserver_marketdata_snapshot: [limit: 10, time_window_ms: 1_000],
iserver_scanner_run: [limit: 1, time_window_ms: 1_000]
]If no configuration is provided, defaults are returned.
Returns the rate limit configuration for a specific endpoint or global limit.
Parameters
- key: Atom representing either
:globalor an endpoint name like:iserver_marketdata_snapshot
Returns
- %{limit: integer, time_window_ms: integer} containing rate limit configuration
Validates the rate limit configuration.
Returns {:ok, validated_config} if the configuration is valid,
or {:error, error} if the configuration is invalid.