Skip to main content

A package to make requests to brokers like binance,kraken

Project description

Python_Brokers_API

This repository hosts the brain api used for my trading algorithms.

Simple functions to use crypto brokers with python 3


Built by Hugo Demenez

Example

import Python_Brokers_API

broker=Python_Brokers_API.binance()

#Public data
print(
    broker.price(symbol="BTCEUR"),
    broker.get_klines_data(symbol="BTCEUR",interval="minute"),
    broker.get_24h_stats("BTCEUR"),
    )

#To create .key file
print(
  broker.create_key_file()
)

#To connect api
print(
    broker.connect_key("binance.key")
)

#To check the connection True = Ok, False = Error
print(
    broker.test_order()
)

#Private data
print(
    broker.account_information(),
    broker.get_open_orders(),
    broker.get_balances(),
    broker.create_market_order(symbol='BTCUSD',side='buy',quantity=1),
    broker.create_limit_order(symbol='BTCUSD',side='buy',quantity=1,price=10000),
    broker.create_take_profit_order(symbol='BTCUSD',side='buy',quantity=1,profitPrice=100000),
    broker.create_stop_loss_order(symbol='BTCUSD',side='buy',quantity=1,stopPrice=1000),
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Python_Brokers_API-3.9.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

Python_Brokers_API-3.9-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page