Skip to main content

Cryptocurrencies.AI client library for trading

Project description

Cryptocurrencies.AI API python client

How to generate api key and keyId?

Go to your profile api page: https://app.cryptocurrencies.ai/profile/api
Click on "GENERATE API KEY"
How to copy KeyId:
Go to your profile accounts page: https://app.cryptocurrencies.ai/profile/accounts
Click on copy icon -> your key token will be copied in clipboard

Reference

Some methods require 'params' dict

param = {
    "strategyId": "5ded5307240b81f3012372de"
}
status = client.get_order_status(params=param)

get_order_status

Args: ('params' dict)
  strategyId (str): order id

Returns:
  string: order status [Waiting, Canceled]

create_order

Args:
  marketType (int): 0 for spot, 1 for futures market
  pair (str): currency pair with underscore, e.g. "BTC_USDT"
  stopLoss (float): stop loss percent, e.g. 10.0
  stopLossType (str): stop loss type [limit, market]
  leverage (int): leverage [1 - 125]
  entryOrder (dict):
  side (str): [buy, sell]
  orderType (str): [limit, market]
  type (int): not using yet, just place 0
  amount (float): coin amount, e.g. 0.01
  exitLevels (dict array): one or more exit levels {
    type (int): 1 - amount and price is in percentage, 0 - in absolute values [0, 1]
    price (float): percent of profit, e.g. 15, or absolute price (depending of type)
    amount (int): percent of entry, e.g. 70, or absolute amount (depending of type)
    orderType (string): order type, e.g. "limit"
  }

Returns:
  dict: order info

cancel_order

Args: ('params' dict)
  strategyId (str): order id

Returns:
  string: order state

get_active_smart_orders

Args:
  marketType (int): 0 for spot, 1 for futures market

Returns:
  dict array: array of active smart orders

get_active_smart_orders_ids

Convenient wrapper for get_active_smart_orders which returns only smart order ids
Args:
  marketType (int): 0 for spot, 1 for futures market

Returns:
  string array: array of active smart orders ids

get_balances

Args:
  none

Returns:
  dict array: balances for all assets
  example: [{'assetType': 0, 'locked': 0, 'free': 31.86915117, 'asset': {'symbol': 'USDT', 'priceUSD': 1}}]

get_futures_free_balance

Convenient wrapper for get_balances.
Args:
  symbol (str): coin symbol, e.g. USDT

Returns:
  float: coin balance on futures wallet

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

ccai-client-0.0.5.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

ccai_client-0.0.5-py3-none-any.whl (22.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