Architecture
Directory Structure
High-Level Directory Structure
Core Application: ats/
ats/
The ats
folder contains the core application code, organized into multiple subdirectories for modularity and maintainability.
Key Folders
apis/
Handles API endpoints, requests to external APIs, and response processing logic.database/
Manages database interactions, including models, schemas, connections, and CRUD operations.exceptions/
Custom exception classes for handling specific errors throughout the application.exchanges/
Connectors and integrations for interacting with various financial or crypto exchanges. Each built-in exchange resides inexchanges/exchanges/<exchange_name>
and implements anExchange
class extending theBaseExchange
class.indicators/
Implementations of technical indicators used in trading strategies, such as Moving Averages, RSI, or MACD. Each indicator must extend theBaseIndicator
class.logs/
Contains application logs for debugging and monitoring performance.saved_states/
Stores serialized states or checkpoint data to maintain consistency across runs or allow resuming processes.state/
Serializable classes extending theSimpleState
class for managing and persisting application states.static/
Static assets like CSS, JavaScript, and images for the trading UI.strategies/
Built-in trading strategies, each implemented as a class that extends theBaseStrategy
class. Strategies should reside instrategies/<strategy_name>
and must define aStrategy
class in astrategy.py
file.templates/
Template files (e.g., HTML files) for rendering dynamic content in the trading UI.tests/
Unit tests, integration tests, and other test-related files to verify application correctness.trading_job/
Core logic and classes for managing and executing trading jobs.utils/
Utility functions and helper modules for reusable functionalities like file operations, data transformations, and logging.
Custom Modules: custom_modules/
custom_modules/
The custom_modules
directory is dedicated to user-defined customizations. It allows users to add their own exchange connectors, strategies, indicators, and fee models. These modules override the core ones in the ats
folder if there is a naming conflict.
Key Folders
exchanges/
Custom exchange implementations. Each exchange must:Be placed in
custom_modules/exchanges/<exchange_name>.py
.Implement an
Exchange
class extending theBaseExchange
class.
fees/
Custom fee models for defining unique fee structures. Each fee model must:Be placed in
custom_modules/fees/<fee_model_name>.py
.Implement a class extending the
BaseFees
class.
indicators/
Custom technical indicators. Each indicator must:Be placed in
custom_modules/indicators/<indicator_name>.py
.Implement a class extending the
BaseIndicator
class.
strategies/
Custom trading strategies. Each strategy must:Be placed in
custom_modules/strategies/<strategy_name>/strategy.py
.Implement a
Strategy
class extending theBaseStrategy
class.
Root-Level Files
.env
Contains environment-specific variables, such as API keys and configurations.environment.yml
Specifies dependencies for setting up the project environment with Conda.requirements.txt
Python dependencies for the application, used withpip
.setup.sh
A shell script for initializing and configuring the application environment.start.sh
A shell script for starting the application.
Last updated