Skip to main content

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

Release files for TradeGates 0.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TradeGates 0.3.9
File Size Uploaded
TradeGates-0.3.9.tar.gz 102.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TradeGates 0.3.9
File Interpreter ABI Platform
TradeGates-0.3.9-py3-none-any.whl Python 3 none any Details

Total release size: 232.7 kB

Release files / TradeGates-0.3.9.tar.gz

Download URL TradeGates-0.3.9.tar.gz
Size 102.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1c0242417e667832cfda6bf5fe5a1a5d7bd4e3f67c0614a267b0593bab1aa20d
BLAKE2b-256 checksum
How to use checksums
06b2df9fff6b79d277ecf07f2ef6c3f79857cab79fe3904efe7a37c2d8cac9cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release files / TradeGates-0.3.9-py3-none-any.whl

Download URL TradeGates-0.3.9-py3-none-any.whl
Size 130.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1ab49d8ead7efce67d2b4ab7682be7acab8a2ddbc87d610379742543d19667f
BLAKE2b-256 checksum
How to use checksums
23242506f8ba8be93287abe451ea5776e82727179f05f4172cad144e801aa87d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.3.9 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page