Code Monkey home page Code Monkey logo

ib-camping's Introduction

ib-camping

Simple Portfolio-Monitor for FA-Accounts on InteractiveBrokers

The monitor is realized with 470 lines of code using ib-ruby and camping. You can select any detected Account. In addition to basic information, such as the NetLiquidation, the used Margin and available Cash, all portfolio-positions are displayed. A simple form to place an emergency-order is provided, too.

Install Ruby 2.2 (via rvm) Initialize with 'bundle install' following with 'bundle update'

Start a TWS or a Gateway with multible Accounts (A Demo-Account is prefered)

Edit the script and change the :host-Entry in line 12 to the host running the TWS/Gateway (eg. 'localhost'). If a connection is made with the Gateway, specify the port, too, eg 'localhost:4001'

Run the camping-Server

camping simple_monitor.rb -p 3333

Open a Browser-Window at http://localhost:3333

enjoy

If an ascii-Browser like elinks is used, the following output is generated

TWS-Host: localhost: 7496  Status: Connected  Depot: [DUXXXXX] [Select Account] Refresh Disconnect  
DU167348  FirstUser                                                 Last Update: 17.04. 20:56:13
NetLiquidation:	877,430 EUR         RegTMargin:	133,902 EUR          TotalCashValue: 634,718 EUR
Cash    634,718 BASE  -78,028 AUD	4,884 EUR   -735,022 JPY	746,852 USD
Stocks	242,781 BASE   92,448 AUD     142,703 EUR     36,121 USD
Portfolio Positions   Size  Price (Entry)  Price (Market) Value (Market)  pnl  
Stock: BLUE EUR	      720   22.643         25.950         18,684          2,381
Stock: CBA AUD	      1004  79.363         92.080         92,448          12,767
Stock: CIEN USD	      812   23.675         21.425         17,397          -1,827
Stock: CSCO USD	      49    21.450         27.905         1,367           316
Stock: DBA USD	      1365  25.321         22.275         30,405          -4,158
Stock: GE USD         -500  24.961         27.015        -13,508          ( realized ) -204.93
Stock: LHA EUR	     10124  15.394         12.250         124,019         -31,827
Stock: NEU USD	     1      276.990        458.230        458             181

                               Pending-Orders
DU167348       Open  Stock CSCO USD sell 5  @ 4.500            Presubmitted         cancel
               Order:                       LMT GTC
                               Contract-Mask
Selected Account:    DU167348
Predefined Contracts:	 [list of Contratcs]
Symbol	             CSCO                   (if empty predefined Contract will be used)
Currency             USD                    con-id: 268084
Exchange             SMART                  CISCO SYSTEMS INC
Expiry	             201506                 Communications
Strike	             30.0                   Telecommunications
Right                p
Multiply             100                    
Type                 [option]                [verify]

            (x) Buy           ( ) Sell       [X] Whatif          [X] Transmit
Size        __________        (Limit) Price  ______________      (Aux) Price ____________________
OrderType   [Limit]           Validity       [GTC]               [submit] 

ib-camping's People

Contributors

topofocus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.