IbkrApi.Support.HTTPStubs.MarketDataStub (ibkr_api v1.0.3)

View Source

Stub module for IbkrApi.ClientPortal.MarketData HTTP requests.

Summary

Functions

Stubs the get_historical_data endpoint.

Stubs the live_market_data_snapshots endpoint.

Functions

stub_get_historical_data(response_fn \\ nil)

Stubs the get_historical_data endpoint.

Examples

MarketDataStub.stub_get_historical_data()
# Or with custom response:
MarketDataStub.stub_get_historical_data(fn -> HTTPMock.success(%{"data" => [...custom bars...]}) end)

stub_live_market_data_snapshots(response_fn \\ nil)

Stubs the live_market_data_snapshots endpoint.

Examples

MarketDataStub.stub_live_market_data_snapshots()
# Or with custom response:
MarketDataStub.stub_live_market_data_snapshots(HTTPMock.success([...custom market data...]))