How bbfamily/abu works
Main Components
• Core Trading Engine – Based on the “abupy” directory that hosts many submodules (CoreBu, MarketBu, TradeBu, etc.).
• Strategy Modules – Several modules (AlphaBu, BetaBu, FactorBuyBu, FactorSellBu, PickStockBu, etc.) that encapsulate different trading strategies, signal generation, and decision logic.
• Risk and Position Management – Modules such as TradeBu, SlippageBu, and UmpBu manage order execution, risk/commission computations, and “裁判” (ump) style decision-making.
• Data Handling and Market Data – MarketBu and RomDataBu provide data fetching, caching, and parsing capabilities.
• Machine Learning & AI Components – The MLBu module and extensions (in ExtBu) manage machine learning pipelines to optimize and validate strategies.
• Technical Indicators and Analysis – IndicatorBu, MetricsBu, and SimilarBu modules are dedicated to technical indicator calculations, performance scoring, similarity analyses, and statistical validations.
• User Interface Components – abupy_ui provides the non-programmatic front-end and even has notebooks with interactive demos.
• Learning and Documentation – abupy_lecture and ipython directories serve as educational components and example workflows (also demonstrating integration with external resources).
Relationships and Interactions
• The Core Trading Engine (CoreBu) is at the heart, instantiating shared utilities and environment settings.
• Pricing and market data management (MarketBu, RomDataBu) feed into the strategy modules.
• Strategy modules (AlphaBu, BetaBu, FactorBuyBu, FactorSellBu, etc.) process data and generate trading signals, often using helper modules (UtilBu) for common functionalities.
• Advanced analysis and machine learning (MLBu, ExtBu) interact with both the strategy modules and risk management modules to refine predictions and optimize parameter selection.
• Execution and risk modules (TradeBu, SlippageBu, UmpBu) interface with the trading simulation/execution system, ensuring capital management and trade orders are dispatched appropriately.
• UI modules (abupy_ui) provide front-end dashboards and visualizations that reflect outputs from the trading engine and analysis modules.
• Finally, the abupy_lecture and ipython directories illustrate sample workflows and serve as documentation/tutorials that tie everything together.
Architectural Patterns and Design Principles
• Modular and Layered Design: The code is broken into distinct namespaces (e.g., Core, Market, Strategy, ML, UI), promoting separation of concerns.
• Reusability and Extensibility: Common utilities and base classes (found in directories like UtilBu and ExtBu) support custom extensions.
• Parallel Processing: Modules like CoreBu (with ABuParallel) hint at parallelized computations for backtesting and parameter search.
• Data Abstraction: The strict separation between data ingestion (MarketBu, RomDataBu) and analysis enables swapping data sources.
• Integration of AI and Traditional Technical Analysis: By combining multiple models and strategies (from traditional factors to AI-driven models), the system emphasizes blending diverse quantitative techniques.
Relevant Technologies/Frameworks
• Python fundamentals with extensive use of structured modules and package initialization.
• Machine learning pipelines (via ABuML and associated grid search/parameter tuning).
• Notebook interfaces for interactive demonstration (Jupyter/IPython notebooks in abupy_lecture, ipython).
• Deployment and environment configuration – typical deployment with Anaconda as recommended in the README.
• Support for different data sources (stock, futures, digital currencies).