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

Metadata

Release files for TradeGate 0.3.9.1

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

Source distribution (sdist)

Source distribution for TradeGate 0.3.9.1
File Size Uploaded
TradeGate-0.3.9.1.tar.gz 102.0 kB Details

Built distribution (wheel)

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

Total release size: 232.7 kB

Release files / TradeGate-0.3.9.1.tar.gz

Download URL TradeGate-0.3.9.1.tar.gz
Size 102.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6364c0b08e54a7dcfd16bb32db9d21dc86fd446fff3346f4ee1d239dcb5808f8
BLAKE2b-256 checksum
How to use checksums
9db09a2b046faf1544146d546939f139fc8fe9c36641e237ff780049109d92c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release files / TradeGate-0.3.9.1-py3-none-any.whl

Download URL TradeGate-0.3.9.1-py3-none-any.whl
Size 130.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
999a6e2b4481171e75d1fcec7afe98d45d3241bfbdfc3167afb5f0fc10f92818
BLAKE2b-256 checksum
How to use checksums
db8a906a878f198ec6817dd219a0ef1cab840ce16be59121408100a34960bf47
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.1 This release

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

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