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

TradeGate-0.3.9.1.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

TradeGate-0.3.9.1-py3-none-any.whl (130.8 kB view details)

Uploaded Python 3

File details

Details for the file TradeGate-0.3.9.1.tar.gz.

File metadata

  • Download URL: TradeGate-0.3.9.1.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 TradeGate-0.3.9.1.tar.gz
Algorithm Hash digest
SHA256 6364c0b08e54a7dcfd16bb32db9d21dc86fd446fff3346f4ee1d239dcb5808f8
MD5 c73fa91debfbd6b9ed8404c1b4ccc981
BLAKE2b-256 9db09a2b046faf1544146d546939f139fc8fe9c36641e237ff780049109d92c3

See more details on using hashes here.

File details

Details for the file TradeGate-0.3.9.1-py3-none-any.whl.

File metadata

  • Download URL: TradeGate-0.3.9.1-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 TradeGate-0.3.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 999a6e2b4481171e75d1fcec7afe98d45d3241bfbdfc3167afb5f0fc10f92818
MD5 95f8aad58f929eecb0fd4fb5907cbac0
BLAKE2b-256 db8a906a878f198ec6817dd219a0ef1cab840ce16be59121408100a34960bf47

See more details on using hashes here.

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