Skip to content

nekrasovp/ibtwsbot

Repository files navigation

ibtwsbot

Example IB_insync bot for Trader Workstation API with Hydra

Installation

Ensure you have git2.2 and python3.8 and higher installed.

Clone the repository.

Activate virtual environments and install requirements.

Edit config.yaml file.

Usage

Example use case

Iterate on each timeframe:

+----------------------------+  +----------------------------+  +----------------------------+
| Scan For Stock In Scanner  |  | Check Open Orders          |  | Check Positions            |
|                            |  |                            |  |                            |
+-------------+--------------+  +-------------+--------------+  +-------------+--------------+
              |                               |                               |
              v                               v                               v
+-------------+--------------+  +-------------+--------------+  +-------------+--------------+
| Check If Stock Not In Open |  | If Order Not Good (Terms)  |  | If New Terms Close         |
| Orders Or In Positions     |  | Cancel It                  |  |                            |
+-------------+--------------+  +----------------------------+  +----------------------------+
              |
              v
+-------------+--------------+
| Check Terms For Each Stock |
|                            |
+--^----------+--------------+
   |          |
   |          v
   |      +---+---+   Yes  +--------------------+
   +------+ Terms +------->+ Transmit New Order |
          +-------+        +--------------------+

Live example

Example

Tests

You can run tests by running python -m unittest discover test. Code coverage is enabled by default.

About

Interactive Broker TWS bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published