All Projects → lolokraus → Degiroapi

lolokraus / Degiroapi

Licence: mit
An unofficial API for the trading platform Degiro, with the ability to get real time data and historical data

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Degiroapi

Iex Api
The IEX API provides any individual or academic, public or private institution looking to develop applications that require stock market data to access near real-time quote and trade data for all stocks trading on IEX.
Stars: ✭ 683 (+499.12%)
Mutual labels:  api, finance, real-time
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+100.88%)
Mutual labels:  api, finance, real-time
Yahooquery
Python wrapper for an unofficial Yahoo Finance API
Stars: ✭ 288 (+152.63%)
Mutual labels:  api, finance
Openscoring
REST web service for the true real-time scoring (<1 ms) of Scikit-Learn, R and Apache Spark models
Stars: ✭ 536 (+370.18%)
Mutual labels:  api, real-time
Python Poloniex
Poloniex API wrapper for Python 2.7 & 3
Stars: ✭ 557 (+388.6%)
Mutual labels:  api, trading-api
Order-Book-Matching-Engine
Order Book Matching Engine for Stock Exchanges (1us latency for matching)
Stars: ✭ 112 (-1.75%)
Mutual labels:  finance, trading-api
korbit-python
Korbit API wrapper for Python
Stars: ✭ 17 (-85.09%)
Mutual labels:  finance, trading-api
Example Hftish
Example Order Book Imbalance Algorithm
Stars: ✭ 355 (+211.4%)
Mutual labels:  finance, real-time
Realtime Newsapi
Financial News Aggregator - Real Time & Query API for Financial News
Stars: ✭ 34 (-70.18%)
Mutual labels:  api, real-time
Cve Api
Unofficial api for cve.mitre.org
Stars: ✭ 36 (-68.42%)
Mutual labels:  api, real-time
Ynab Sdk Ruby
YNAB API Ruby Library
Stars: ✭ 54 (-52.63%)
Mutual labels:  api, finance
trading sim
📈📆 Backtest trading strategies concurrently using historical chart data from various financial exchanges.
Stars: ✭ 21 (-81.58%)
Mutual labels:  finance, real-time
rRofex
R library to connect to Matba Rofex's Trading API. Functionality includes accessing account data and current holdings, retrieving investment quotes, placing and canceling orders, and getting reference data for instruments.
Stars: ✭ 21 (-81.58%)
Mutual labels:  finance, trading-api
Realtime object detection
Plug and Play Real-Time Object Detection App with Tensorflow and OpenCV. No Bugs No Worries. Enjoy!
Stars: ✭ 260 (+128.07%)
Mutual labels:  api, real-time
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+108.77%)
Mutual labels:  api, trading-api
Horaires Ratp Api
Webservice pour les horaires et trafic RATP en temps réel
Stars: ✭ 232 (+103.51%)
Mutual labels:  api, real-time
Python Fints
Pure-python FinTS (formerly known as HBCI) implementation
Stars: ✭ 227 (+99.12%)
Mutual labels:  api, finance
Rtapi
Real time API latency analyzer - Create a PDF report and HDR histogram of your APIs
Stars: ✭ 106 (-7.02%)
Mutual labels:  api, real-time
Intrinio Realtime Node Sdk
Intrinio NodeJS SDK for Real-Time Stock & Crypto Prices
Stars: ✭ 30 (-73.68%)
Mutual labels:  finance, real-time
Gophergameserver
🏆 Feature packed, easy-to-use game server API for Go back-ends and Javascript clients. Tutorials and examples included!
Stars: ✭ 61 (-46.49%)
Mutual labels:  api, real-time

DegiroAPI

An unofficial API for the trading platform Degiro written in Python with the ability to get real time data and historical data for products.

Getting Started

Installing

pip install degiroapi

Dependecies

pip install requests

Imports

import degiroapi
from degiroapi.product import Product
from degiroapi.order import Order
from degiroapi.utils import pretty_json

Logging into your account

degiro = degiroapi.DeGiro()
degiro.login("username", "password")

Logging out

degiro.logout()

Available Functions

  • login
  • logout
  • getdata
  • search_products
  • product_info
  • transactions
  • orders
  • delete_order
  • real_time_price
  • get_stock_list
  • buyorder
  • sellorder

getdata

Printing your current cach funds:

cashfunds = degiro.getdata(degiroapi.Data.Type.CASHFUNDS)
for data in cashfunds:
    print(data)

Printing your current portfolio, argument True to filter out products with a size of 0, False or no Argument to show all:

portfolio = degiro.getdata(degiroapi.Data.Type.PORTFOLIO, True)
for data in portfolio:
    print(data)

search_products

Searching for a product:

products = degiro.search_products('Pfizer')
print(Product(products[0]).id)

product_info

Printing info for a specified product ID:

info = degiro.product_info(331823)
print(info["id"], info["name"], info["currency"], info["closePrice"])

transactions

Printing your transactions in a given time interval:

from datetime import datetime, timedelta

transactions = degiro.transactions(datetime(2019, 1, 1), datetime.now())
print(pretty_json(transactions))

orders

Printing your order history(the maximum timespan is 90 days) With argument True, this function only returns open orders

from datetime import datetime, timedelta

orders = degiro.orders(datetime.now() - timedelta(days=90), datetime.now())
print(pretty_json(orders))

orders = degiro.orders(datetime.now() - timedelta(days=90), datetime.now(), True)
print(pretty_json(orders))

delete_order

Deleting an open order with the orderId

orders = degiro.orders(datetime.now() - timedelta(days=1), datetime.now(), True)
degiro.delete_order(orders[0]['orderId'])
degiro.delete_order("f278d56f-eaa0-4dc7-b067-45c6b4b3d74f")

real_time_price

Get the real time price and the historical data of a stock:

products = degiro.search_products('nrz')
# Interval can be set to One_Day, One_Week, One_Month, Three_Months, Six_Months, One_Year, Three_Years, Five_Years, Max
realprice = degiro.real_time_price(Product(products[0]).id, degiroapi.Interval.Type.One_Day)

# getting the real time price
print(realprice[0]['data']['lastPrice'])
print(pretty_json(realprice[0]['data']))

# getting historical data
print(realprice[1]['data'])

get_stock_list

Get the symbols of the S&P500 stocks:

sp5symbols = []
products = degiro.get_stock_list(14, 846)
for product in products:
    sp5symbols.append(Product(product).symbol)

Get the symbols of the german30 stocks:

daxsymbols = []
products = degiro.get_stock_list(6, 906)
for product in products:
    daxsymbols.append(Product(product).symbol)

buyorder

Placing a buy order is dependent on the order Type:

Limit order

You have to set a limit order price to which the order gets executed. arguments: order type, product id, execution time type (either 1 for "valid on a daily basis", or 3 for unlimited, size, limit(the limit price)

degiro.buyorder(Order.Type.LIMIT, Product(products[0]).id, 3, 1, 30)

StopLimit order

Sets a limit order when the stoploss price is reached (not bought for more than the limit at the stop loss price): arguments: order type, product id, execution time type (either 1 for "valid on a daily basis", or 3 for "unlimited"), size, limit(the limit price), stop_loss(stop loss price)

degiro.buyorder(Order.Type.STOPLIMIT, Product(products[0]).id, 3, 1, 38, 38)

Market order

Bought at the market price: arguments: order type, product id, execution time type (either 1 for "valid on a daily basis", or 3 for "unlimited"), size

degiro.buyorder(Order.Type.MARKET, Product(products[0]).id, 3, 1)

StopLoss order

The stop loss price has to be higher than the current price, when current price reaches the stoploss price the order is placed: arguments: order type, product id, execution time type (either 1 for "valid on a daily basis", or 3 for "unlimited"), size

degiro.buyorder(Order.Type.STOPLOSS, Product(products[0]).id, 3, 1, None, 38)

sellorder

Placing a sell order is dependent on the order Type: Equivalent to the buy orders:

degiro.sellorder(Order.Type.LIMIT, Product(products[0]).id, 3, 1, 40)
degiro.sellorder(Order.Type.STOPLIMIT, Product(products[0]).id, 3, 1, 37, 38)
degiro.sellorder(Order.Type.MARKET, Product(products[0]).id, 3, 1)
degiro.sellorder(Order.Type.STOPLOSS, Product(products[0]).id, 3, 1, None, 38)

Usage

For documented examples see examples.py

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