Git Product home page Git Product logo

ibfetch's Introduction

ibfetch

A tool for fetching historical data from Interactive Brokers.

Requirements

You can install both together either via package manager or installer.

Installation

git clone https://github.com/heqian/ibfetch.git
cd ibfetch/
npm install

Usage

  • node index.js combo [symbol]
  • node index.js forex [symbol]
  • node index.js future [symbol] [expiry <YYYYMM|YYYYMMDD>]
  • node index.js option [symbol] [expiry <YYYYMM|YYYYMMDD>] [strike] [right <CALL|PUT|C|P>]
  • node index.js stock [symbol]

Examples

  • node index.js combo FIT
  • node index.js forex EUR
  • node index.js future FIT 201604
  • node index.js option FIT 20160401 20.0 CALL
  • node index.js stock FIT

Step by Step

  1. Launch IB Trader Workstation or IB Gateway;
  2. Open terminal and enter the directory of ibfetch;
  3. Execute any command demostrated in Usage section;
  4. Press Ctrl+C when you think ibfetch has fetched enough data;
  5. A file with name [SYMBOL]_[SECURITY TYPE].csv (e.g., "FIT_OPT.csv") will be generated.

Advanced Configuration

Edit the config.js file

{
	ib: {
		host: "127.0.0.1",	// the IP address of machine running IB Trader Workstation (TWS) or IB Gateway (IBG) 
		clientId: 200,		// any number
		port: 7496			// port number, 7496 (default for TWS) or 4002 (default for IBG)
	},
	what: "MIDPOINT",		// "TRADES", "BID", "ASK", "MIDPOINT"
	size: "1 min"			// bar size of each entry in the .CSV file
	// "1 sec", "5 secs", "15 secs", "30 secs", "1 min", "2 mins", "3 mins", "5 mins", "15 mins", "30 mins", "1 hour", "1 day"
}

ibfetch's People

Contributors

heqian 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.