Skip to main content

A Trading Gateway

Project description

Trade Gate

PyPI PyPI - Downloads PyPI - Python Version GitHub

An algorithmic trading library to use as a gateway to different exchanges.

Documentations and examples

Documentations are available on read the docs, but currently it's not complete. Examples for each exchange will be added soon, until then, there are good examples in the Test folder.

How to install

Use this Github repository by running python setup.py install, or using pip:

pip install TradeGate

How to use

Use with a config file in JSON format. Your config file should look like this:

{
  "Binance": {
    "exchangeName": "Binance",
    "credentials": {
      "main": {
        "futures": {
          "key": "API-KEY",
          "secret": "API-SECRET"
        },
        "spot": {
          "key": "API-KEY",
          "secret": "API-SECRET"
        }
      },
      "test": {
        "futures": {
          "key": "API-KEY",
          "secret": "API-SECRET"
        },
        "spot": {
          "key": "API-KEY",
          "secret": "API-SECRET"
        }
      }
    }
  }
}

You should read this config file as JSON and give the desired exchange information to the main class initializer. Use sandbox argument to connect to the testnets of exchanges (if it exists). This is shown below:

from TradeGate import TradeGate
import json

with open('/path/to/config/file.json') as f:
    config = json.load(f)

gate = TradeGate(config['Binance'], sandbox=True)

print(gate.get_symbol_ticker_price('BTCUSDT'))

Current Supported Exchanges

  • Binance
  • ByBit
  • KuCoin

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. The best way to contribute right now is to implement as many exchanges as possible. Make sure all test cases are passing.

License

MIT

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

TradeGates-0.3.9.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

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

TradeGates-0.3.9-py3-none-any.whl (130.8 kB view details)

Uploaded Python 3

File details

Details for the file TradeGates-0.3.9.tar.gz.

File metadata

  • Download URL: TradeGates-0.3.9.tar.gz
  • Upload date:
  • Size: 102.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for TradeGates-0.3.9.tar.gz
Algorithm Hash digest
SHA256 1c0242417e667832cfda6bf5fe5a1a5d7bd4e3f67c0614a267b0593bab1aa20d
MD5 4ee96e64c25fa98e39d97a4f4a8760f2
BLAKE2b-256 06b2df9fff6b79d277ecf07f2ef6c3f79857cab79fe3904efe7a37c2d8cac9cf

See more details on using hashes here.

File details

Details for the file TradeGates-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: TradeGates-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 130.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for TradeGates-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ab49d8ead7efce67d2b4ab7682be7acab8a2ddbc87d610379742543d19667f
MD5 5095fd873c4040f04a6ce42da6e75174
BLAKE2b-256 23242506f8ba8be93287abe451ea5776e82727179f05f4172cad144e801aa87d

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