Coder Social home page Coder Social logo

polygon_api's Introduction

Getting Stock Pricing Data from Polygon.io's API using Python

Pulling and creating clean stock pricing data is the first step in developing and modeling any trading algorithms. This code will pull stock pricing history in the format of daily bars including OHLCV (Open, High, Low, Close, Volume) data. The bars will be adjusted for stock splits using the stock split data and a specifically developed function. Dividend data will also be appended to the dataset for a complete view of returns.

You can sign up for an API key at Polygon.io.

Alternatively, you can use your Alpaca Trading API key to get free access to Polygon data. Note, in my code I save my API Key as an environmental variable (so on my MacOS I included it in my .bach_profile file as export ALPACA_API_KEY="YOURKEYHERE")

Requirements

Download and install Anaconda

Create a new virtual environment

$ conda create --name polyenv python=3.8

Activate the new virtual environment

$ conda activate polyenv

Install packages

$ pip install -r requirements.txt

Alternatively, you can take a look at the requirements.txt file and install what you need.

Note, I'm using VS Code with the ipykernel (Jupyter Notebook) capability to run in a notebook like experience. You can certainly also run this without this.

polygon_api's People

Contributors

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