Skip to main content

Coin Algorithm Python Client

This is the codetotrade.app Python client, which provides tools and functionalities to interact with the codetotrade.app platform.

Installation

To install the client, you can use pip:

pip install coin-algorithm==1.2

Usage

Create your bot

Create new python file (ex : bot/my_test_bot.py) and Implement the BaseBot class

from typing import Dict
from coin_algorithm.domain.base_bot import BaseBot
from coin_algorithm.domain.trade_metadata import TradeMetadata
class MyTestBot(BaseBot):
    def init(self, config: Dict[str, str]) -> None:
        pass

    def is_buy(self, idx: int) -> bool:
        pass

    def is_sell(self, idx: int) -> bool:
        pass

    def buy(self, idx: int) -> TradeMetadata:
        pass

    def sell(self, idx: int) -> TradeMetadata:
        pass

    def is_close_current_position(self, idx: int) -> bool:
        pass

Run your bot

There are 2 Params to indicate where your bot is located.

  • bot_module : The path to the bot file without the extension (ex : bot.my_test_bot)
  • bot_class : The class name of the bot (ex : MyTestBot)

Run back test for your bot

import os, sys

dir_path = os.path.dirname(os.path.realpath(__file__))
parent_dir_path = os.path.abspath(os.path.join(dir_path, os.pardir))
sys.path.insert(0, parent_dir_path)
from coin_algorithm.server import back_test_server
import logging

if __name__ == "__main__":
    logging.basicConfig(level = logging.INFO)
    back_test_server.serve(port='8888', bot_module='bot.my_test_bot', bot_class='MyTestBot')

Run exchange trade for your bot

import os, sys

dir_path = os.path.dirname(os.path.realpath(__file__))
parent_dir_path = os.path.abspath(os.path.join(dir_path, os.pardir))
sys.path.insert(0, parent_dir_path)

import logging

from coin_algorithm.server import binance_server

if __name__ == "__main__":
    logging.basicConfig(level = logging.INFO)
    binance_server.serve(port='8888', bot_module='bot.my_test_bot', bot_class='MyTestBot',
                         api_key='',
                         secret_key='',
                         is_test_net=True)

Metadata

Release files for coin-algorithm 1.4

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

Source distribution (sdist)

Source distribution for coin-algorithm 1.4
File Size Uploaded Provenance Actions
coin_algorithm-1.4.tar.gz 22.3 kB Without provenance Details for coin_algorithm-1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for coin-algorithm 1.4
File Interpreter ABI Platform Actions
coin_algorithm-1.4-py3-none-any.whl Python 3 none any Details for coin_algorithm-1.4-py3-none-any.whl

Total release size: 55.0 kB

Release files / coin_algorithm-1.4.tar.gz

Download URL coin_algorithm-1.4.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a1e5e0a90a89737816c2e585fb7e81dc28cf12e9d836f1d2944275aa39d226a1
BLAKE2b-256 checksum
How to use checksums
9ac386e650a972c07fed0cddfdd6396d9181d4ab0d7f8cce555f9a407a0a2984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release files / coin_algorithm-1.4-py3-none-any.whl

Download URL coin_algorithm-1.4-py3-none-any.whl
Size 32.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2904d2ab6d192aad60c14a6fec9dfd11801064a3993de8d9b40a9c5b5e1d7dc1
BLAKE2b-256 checksum
How to use checksums
a9f96d8eedc09aa275801e9dc456a0e21b332c736bd75e8214942f6471f0f147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Security for coin-algorithm 1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.4 This release

2 release files No provenance

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