How algotrade-research/searchingta works
Project’s Main Components
• Data Collection & Ingestion: Represented by the Downloader class in the “utils” folder, which fetches tick and bid/ask data from an external algotrade database. This component is responsible for ingesting large amounts of tick data and preparing it for analysis.
• Data Processing & Resampling: Also in “utils” (processor.py) along with visualization utilities, this part converts raw tick data into resampled OHLC and technical indicator enriched data.
• Signal Generation / Trading Strategy: Located in the “strategy” folder, these components include functions (e.g., the RSI strategy) which generate trading signals (buy/sell/hold) based on technical indicators.
• Backtesting Engine: Found under the “backtest/backtesting” module along with configuration and portfolio management (“backtest/portfolio”), this engine applies the generated signals to historical data, simulating trade execution. It implements risk and position management rules.
• Optimization Engine: In the “optimize” folder, this component leverages Optuna to fine-tune indicator parameters (including TP, SL, interval, etc.) to optimize performance metrics such as winrate, Sharpe ratio, and maximum drawdown.
• Configuration & Deployment: Files such as “long.py” and “short.py” serve as entry points for running long/short strategy simulations. The project also contains devcontainer configurations and CSV data used to support initial testing.
Relationships and Interactions
• Data flows from external sources into the Downloader, then passes through the data processing component.
• The processed data is fed into the Backtesting Engine where strategies (from the Strategy module) are applied.
• Results of the backtests—including performance metrics like winrate and PnL distribution—are stored or visualized.
• The Optimization Engine (using Optuna) interacts with the backtesting module by repeatedly calling it with different hyperparameters based on trial results.
• Finally, a Testing module leverages the best parameters to perform out-of-sample validation, with results visualized and compared via reporting tools.
Architectural Patterns and Design Principles
• Model–View Separation: Backtesting and optimization logic are separated from the data ingestion and visualization components, allowing independent updates and testing.
• Modularity: Each module (backtest, optimize, strategy, utils) is encapsulated so that each process (data download, signal generation, simulation, optimization) can be developed and maintained independently.