Portfolio-Monitor (not only) for FA-Accounts on InteractiveBrokers
Base Szenario: Some trading approach is performed on a remote system. There is at least a reverse-ssh tunnel enabling basic administrative operations. One can establish a remote tmux-session, one window is starting the simple_monitor, one runs an elinks-session displaying the output.
The monitor is realized using IB-Ruby and the camping micro-web-framework. It generates pure HTML and uses CSS, thus providing an overview on every browser, including text-based ones, like elinks. Avoids JavaScript.
First an overview of any Portfolio-Position in every Account is displayed (only F&F-Accounts). You can select all Accounts. Basic information, such as NetLiquidation, the used Margin and Available Cash are shown. All Portfolio-Positions (Contracts) are displayed.
A Simple Form to place an emergency-order (i.e. a "Close-Position"-Feature) is provided, too. New Positions can be established through their basic properties (see below). In practice, one would use the Watchlist feature to provide additional Contracts.
-
Setup your environment through IB-Container.
or
-
Install Ruby 2.6+ (via rvm), tmux and elinks.
-
clone this repository (
git clone https://guthub.com/ib-ruby/simple-monitor.git) -
change to the simple-monitor directory (
cd simple-monitor) -
Initialize with
bundle installfollowing withbundle update( get bundler viagem install bundleif its not present) -
Start a TWS or a Gateway (TWS must fullfil the requirements of ›› IB-RUBY ‹‹).
-
Edit
config.ymland change the:host-Entry to the host running the TWS/Gateway (eg.localhost:7496). If a connection is made with the Gateway, specify that port, too, eglocalhost:4001. If no Account-Alias is set in Account-Management, local Aliases can be specified in the yaml-dataset. -
Copy the provided elinks-configuration to the home-directory (
cp elinks.conf ~/.elinks/) -
Run the provided tmux-startup-script (
./start-simple-monitor) or -
Run the camping-Server manually
camping simple_monitor.rb -p 3333
and open a browser window at http://localhost:3333 enjoy
If an ascii-Browser like elinks is used, the following output is generated

If a User is selected or only one User is present, a detail-page is displayed

First edit ./start-simple-monitor and check if the provided pathes fit your environment.
