All Projects → paduel → fhub

paduel / fhub

Licence: Apache-2.0 license
Python client for Finnhub API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to fhub

Stocksharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Stars: ✭ 4,601 (+14741.94%)
Mutual labels:  finance, forex, quantitative-finance
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-32.26%)
Mutual labels:  finance, stock-market, quantitative-finance
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+1348.39%)
Mutual labels:  finance, stock-market, quantitative-finance
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (+6906.45%)
Mutual labels:  finance, stock-market, quantitative-finance
Pandas Datareader
Extract data from a wide range of Internet sources into a pandas DataFrame.
Stars: ✭ 2,183 (+6941.94%)
Mutual labels:  finance, financial-data, economic-data
Akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 4,334 (+13880.65%)
Mutual labels:  finance, financial-data, economic-data
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+26367.74%)
Mutual labels:  finance, quantitative-finance, financial-data
okama
Investment portfolio and stocks analyzing tools for Python with free historical data
Stars: ✭ 87 (+180.65%)
Mutual labels:  finance, quantitative-finance, financial-data
Sec Edgar Downloader
Download SEC filings from the EDGAR database using Python
Stars: ✭ 146 (+370.97%)
Mutual labels:  finance, stock-market, financial-data
Bulbea
🐗 🐻 Deep Learning based Python Library for Stock Market Prediction and Modelling
Stars: ✭ 1,585 (+5012.9%)
Mutual labels:  finance, stock-market, quantitative-finance
Stock Bot
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.
Stars: ✭ 240 (+674.19%)
Mutual labels:  finance, stock-market, quantitative-finance
Finance
Here you can find all the quantitative finance algorithms that I've worked on and refined over the past year!
Stars: ✭ 194 (+525.81%)
Mutual labels:  finance, stock-market, quantitative-finance
IEX CPP API
Unofficial C++ Lib for the IEXtrading API
Stars: ✭ 34 (+9.68%)
Mutual labels:  finance, financial-data, financial-markets
Finance Go
📊 Financial markets data library implemented in go.
Stars: ✭ 392 (+1164.52%)
Mutual labels:  finance, stock-market, financial-data
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+632.26%)
Mutual labels:  finance, forex, quantitative-finance
Go Finance
⚠️ Deprecrated in favor of https://github.com/piquette/finance-go
Stars: ✭ 536 (+1629.03%)
Mutual labels:  finance, quantitative-finance, financial-data
akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 5,155 (+16529.03%)
Mutual labels:  finance, financial-data, economic-data
dados-financeiros
Repositório de Fontes de Dados Financeiros do Brasil
Stars: ✭ 119 (+283.87%)
Mutual labels:  finance, stock-market, financial-data
Algobot
A C++ stock market algorithmic trading bot
Stars: ✭ 78 (+151.61%)
Mutual labels:  finance, stock-market, financial-data
Alpha Mind
quantitative security portfolio analysis. The analysis pipeline including data storage abstraction, alpha calculation, ML based alpha combining and portfolio calculation.
Stars: ✭ 171 (+451.61%)
Mutual labels:  finance, stock-market, quantitative-finance

Fhub

Python client for Finnhub API

Python version PyPi version License Apache 2.0 Status contributions welcome

A pythonic way to use the Finnhub data API.

This package is still in a very early stage of development, so it is still incomplete and may contain bugs. It should only be used to test its functionality.

Installation

pip install fhub

Quick start

You need a Finnhub API Key, you can get free one, at https://finnhub.io. For some data a premium account is necessary.

from fhub import Session
hub = Session("your_finnhub_api_key_here")

# Download prices time serie of Tesla.
tsla = hub.candle('TSLA')

# Download prices for several tickers from a date.
data = hub.candle(['AMZN', 'NFLX', 'DIS'], start="2018-01-01")

# Download prices and bollinger bands indicator for several tickers.
data = hub.indicator(['AAPL', 'MSFT'], start='2019-01-01', indicator='bbands',
                 indicator_fields={'timeperiod': 10})

Real-time subscription via Finnhub's websocket is easy using fhub, even using custom functions for each tick received.

from fhub import Subscription
from time import sleep

def price_monitor(ticker):
    # Callback function receive a ticker object
    # calculate the average of the last 30 ticks using the ticker history
    average = ticker.history.price.tail(30).mean().round(2)
    # display the price and the calculated average
    print (f'{ticker.symbol}. Price: {ticker.price} Average(30) : {average}')
    # show a message if price is over its average
    if ticker.price > average:
        print(f'{ticker.symbol} is over its average price')
    return

# Create a subscription and connect
subs = Subscription("your_finnhub_api_key_here")
# A list of the symbols to which to subscribe is passed
# Created function  is assigned as a callback when a new tick is received
subs.connect(["BINANCE:BTCUSDT", "IC MARKETS:1", "AAPL"],
             on_tick=price_monitor
            )

# Subscription is maintained for 20 seconds and then closed.
for f in range(20):
    sleep(1)
subs.close()

See more examples of use at quick_start notebook

Documentation

Official documentation of the API REST of Finnhub:

https://finnhub.io/docs/api

Most of the functions available in the REST API have been implemented.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].