Adding a New Exchange
Directory Structure
custom_modules/exchanges/<name of your exchange>/
Implementing a Custom Exchange
from ats.exchanges.base_exchange import BaseExchange class Exchange(BaseExchange): def validate_config(self) -> None: # Add your custom configuration validation logic here pass def connect(self) -> None: # Add logic to establish a connection with the exchange pass def disconnect(self) -> None: # Add logic to disconnect from the exchange pass def submit_order(self, order: Order) -> None: # Logic to submit an order pass def cancel_order(self, order: Order) -> None: # Logic to cancel an order pass def get_order(self, order_id) -> Union[Order, None]: # Retrieve an order based on its ID pass def get_wallet_balance(self) -> Dict[str, AssetBalance]: # Get wallet balances as a dictionary of AssetBalance objects pass def get_fees(self) -> Tuple[float, float]: # Retrieve maker and taker fees pass def is_back_trading(self) -> bool: # Return True if the exchange is used for backtrading, otherwise False pass
Configuration Validation
Notes on Plotting Data
Last updated