Skip to main content

Get crypto coin informations & calculate the custom or constant indicators. (WITH BINANCE API)

Project description

binance-ema

Simplified & Professional Binance API.

  • Get crypto coin information in an easy way.

  • Get account information (balance,quantity etc.)

  • Buy / Sell / Limit / Stop Loss --> Orders any way.

  • Calculate SMA, EMA, MACD etc. functions (custom indicators)

  • https://pypi.org/project/binance-ema/

         pip install binance-ema
    

Nots

  • This python library has been written to calculate SMA, EMA, MACD etc. functions with Binance API.
  • Complex functions in the Binance API, has been facilitate for developers.
  • After installing the libary, don't forget reading the funcions content !
  • We are not responsible the your code mistake

Usage

Firstly, for the use this library you have to create an API via Binance. This documentation will help you for create an safe API.

  1. Visit the Binance web site and log in: https://www.binance.com/

  2. After, click to your profile photo. Select api management from the menu that appears.

  3. Third, you can create an API now. After the API creatation, move the API List and click the edit button your API.

  • After the API creatation, save your "API KEY" & "SECRET KEY".

  • Page looks like;

  • Enable Reading was default active. This settings give you authority for reading the coins information. (Red circle in the image)
  • Enable Spot-Marign Trading was default passive. !! IF YOU DON'T SPOT-MARGİN TRADİNG, YOU MUST DON'T ACTİVE THİS SETTİNG FOR YOUR SECURİTY. (Green circle in the image)
  • Trusted IP default null. You must add your ip adress here for your security. Other ip adress cannot read coins information or trade.

Binance Connector

Example connect to API & Info Functions

# Example connect to API & Info Functions

from binance.spot import Spot
from binancema.coininfo import *

KEY         = "XXXXXXXXXXXXXXXXXXXXXX"
SECRET      = "XXXXXXXXXXXXXXXXXXXXXX"

Client = Spot(KEY,SECRET)  # connect binance api

symbol = "OXT"
market = "OXTUSDT"

# use libary binancema functions
print(f"Your USDT ($) Balance:                  {balance_usdt(Client)} $\n")              #float

print(f"OXT Quantity (Free):                    {quantity_free(Client,symbol)} OXT\n")     #float

print(f"OXT Quantity (locked):                  {quantity_locked(Client,symbol)} OXT\n")   #float

print(f"OXT Quantity (all):                     {quantity_all(Client,symbol)} OXT\n")      #float

print(f"OXT Balance ($) (free):                 {balance_free(Client,symbol)} $\n")        #float

print(f"OXT Balance ($) (locked):               {balance_locked(Client,symbol)} $\n")      #float

print(f"OXT Balance ($) (all):                  {balance_all(Client,symbol)} $\n")         #float

print(f"OXT/USDT Price (now):                   {price(Client,market)}\n")             #float

print(f"OXT/USDT Price (before 24hr):           {price_before_24hr(Client,market)}\n") #float

print(f"OXT/USDT Price Change Value (24hr):     {price_change24(Client,market)}\n")    #float     

print(f"OXT/USDT Price Change (%) (24hr):       % {price_change_percent24(Client,market)}\n")  #float

print(f"OXT/USDT Price High Value (24hr):       {price_high24(Client,market)}\n")       #float

print(f"OXT/USDT Price Low Value (24hr):        {price_low24(Client,market)}\n")        #float

Example Trade Functions

from binance.spot import Spot
from binancema.coininfo import *

KEY         = "XXXXXXXXXXXXXXXXXXXXXX"
SECRET      = "XXXXXXXXXXXXXXXXXXXXXX"

Client = Spot(KEY,SECRET)  # connect binance api

symbol = "OXT"
market = "OXTUSDT"

# TRADE with binance-ema
print(market_buy_with_price(Client, market,30))  # buy 30 $ BTC (market price)

print(market_buy_with_quantity(Client, market,0.01233)) # buy 0.01233 BTC (market price)

# default binance-connector functions
print(f"All Open Orders (LIMIT): {Client.get_open_orders()}\n") #list

print(f"OXT Open Orders (LIMIT): {Client.get_open_orders(market)}\n") #list

print(f"Get only 1 order:{Client.get_order(market,orderId = 55555)} \n") # dict (inpur order id gettin to get_open_orders)

Contributors


Emre MENTEŞE (Owner)


Ozan Mutlu

License

MIT License | Copyright (c) 2022 Emre MENTEŞE

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

binance_ema-1.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binance_ema-1.0.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file binance_ema-1.0.1.tar.gz.

File metadata

  • Download URL: binance_ema-1.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.10.16 Linux/6.8.0-1017-azure

File hashes

Hashes for binance_ema-1.0.1.tar.gz
Algorithm Hash digest
SHA256 596d625177c0b6e87e74700241b7d25d4f4833a27a3113eb21d7554cf84f8b37
MD5 dd72a99603ee23fa754479f238af4914
BLAKE2b-256 d3b8f2c24bfdf9aaf7d5dd6e6731a3b86a8b11bbee943a0c235a57046796f98c

See more details on using hashes here.

File details

Details for the file binance_ema-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: binance_ema-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.10.16 Linux/6.8.0-1017-azure

File hashes

Hashes for binance_ema-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6d405ca3bd64a0f8562b4affe05168df1a953b470a72a7d8359628ab991a764
MD5 cef34ba1c5f320668de4c99b8c9f8e44
BLAKE2b-256 c0d819a7788c0d65fbe83ef949b029fa4d79f3335d9f8faf7bea95fc434ceaa2

See more details on using hashes here.

Supported by

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