Giter VIP home page Giter VIP logo

stock_options_scraper's Introduction

options_scraper

As I became interested in options trading and algorithmic trading, I realized that unlike historical stock data, historical option chain data is not readily available to the public. This made me curious about how I could collect and store option chain data for my own use. After researching different options, I decided to write a scraping script using TD Ameritrade's API that would collect and store the data in an SQLite database for backtesting and development of algorithmic strategies.

Requirements

To use this script, you will need:

A TD Ameritrade API key, which can be obtained by registering for a TD Ameritrade Developer account.

Configuration

To configure the script, you will need to:

  • Enter your TD Ameritrade API key in the script where indicated.
  • Add the list of tickers for which you want to collect option chain data in the ticker_list variable.
  • Set the interval (in minutes) at which you want to collect option chain data in the scraping_interval variable.

Usage

To use the script, simply run it from your command line or preferred Python IDE. The script will continuously scrape option chain data for the specified list of tickers at the defined interval, storing the data in an SQLite database. The script will also check whether the stock market is open and sleep until it opens if it is not.

The options_data table in the SQLite database will contain the following columns:

date_time: the date and time of the data collection. ticker_symbol: the ticker symbol of the stock for which the option chain data was collected. options_chain: a JSON string containing the option chain data.

stock_options_scraper's People

Contributors

hansen-han avatar

Watchers

Kostas Georgiou 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.