Skip to main content

A Trading Gateway

Project description

Trade Gate

GitHub Workflow Status PyPI PyPI - Downloads PyPI - Python Version GitHub

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

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.getSymbolTickerPrice('BTCUSDT'))

Current Supported Exchanges

  • Binance
  • ByBit

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-Beta-0.2.1b22.tar.gz (83.9 kB view details)

Uploaded Source

Built Distribution

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

TradeGate_Beta-0.2.1b22-py3-none-any.whl (115.9 kB view details)

Uploaded Python 3

File details

Details for the file TradeGate-Beta-0.2.1b22.tar.gz.

File metadata

  • Download URL: TradeGate-Beta-0.2.1b22.tar.gz
  • Upload date:
  • Size: 83.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for TradeGate-Beta-0.2.1b22.tar.gz
Algorithm Hash digest
SHA256 fb7c7e7399221b478206fe4a0ba0e01d04716ead645bf2c4d2bc255138c4b324
MD5 982c860acc513f79d938abebe97a406d
BLAKE2b-256 13e03009372e5bba301cac513e2f5457104ad5e81cf721b0f38618403da61854

See more details on using hashes here.

File details

Details for the file TradeGate_Beta-0.2.1b22-py3-none-any.whl.

File metadata

  • Download URL: TradeGate_Beta-0.2.1b22-py3-none-any.whl
  • Upload date:
  • Size: 115.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for TradeGate_Beta-0.2.1b22-py3-none-any.whl
Algorithm Hash digest
SHA256 6ca1ec5176579372e3f70c6f3b771d38a65f88bac36af70031170d235143ded8
MD5 e53982c1ac29af5c4ebb26c242a56d29
BLAKE2b-256 1be8d58ef49c1b831979d436881ee286dcbbd73ffeaaf93e6761e3a24fa46da8

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