API docs

Release 0.3.2.

Algo

class aqtlib.algo.Algo(instruments, *args, **kwargs)[source]

Algo class initilizer.

Parameters
  • instruments – list List of IB contract tuples.

  • resolution – str Desired bar resolution (using pandas resolution: 1T, 1H, etc). Default is 1T (1min)

  • bars_window – int Length of bars lookback window to keep. Defaults to 120

  • timezone – str Convert IB timestamps to this timezone (eg. US/Central). Defaults to UTC

  • backtest – bool Whether to operate in Backtest mode (default: False)

  • start – str Backtest start date (YYYY-MM-DD [HH:MM:SS[.MS]). Default is None

  • end – str Backtest end date (YYYY-MM-DD [HH:MM:SS[.MS]). Default is None

  • data – str Path to the directory with AQTLib-compatible CSV files (Backtest)

  • output – str Path to save the recorded data (default: None)

Broker

class aqtlib.broker.Broker(instruments, *args, **kwargs)[source]

Porter

class aqtlib.porter.Porter(*args, **kwargs)[source]

Porter class initilizer

Parameters
  • symbols – str IB contracts CSV database (default: ./symbols.csv)

  • ib_port – int TWS/GW Port to use (default: 4002)

  • ib_client – int TWS/GW Client ID (default: 100)

  • ib_server – str IB TWS/GW Server hostname (default: localhost)

  • db_host – str PostgreSQL server hostname (default: localhost)

  • db_port – str PostgreSQL server port (default: 3306)

  • db_name – str PostgreSQL server database (default: aqtlib_db)

  • db_user – str PostgreSQL server username (default: aqtlib_user)

  • db_pass – str PostgreSQL server password (default: aqtlib_pass)

  • db_skip – str Skip PostgreSQL logging (default: False)

Instrument

class aqtlib.instrument.Instrument[source]

A string subclass that provides easy access to misc symbol-related methods and information.