Contributing Guide
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Stolgo project is a Price Action Trading Analysis Library designed to automate price action rules and facilitate backtesting for strategies involving support/resistance, candlestick patterns, and trends. Contributions to the project are encouraged through pull requests to expand its capabilities in financial data analysis and algorithmic trading.
Developers contributing to Stolgo are expected to adhere to specific coding standards and testing requirements to maintain the library's stability and reliability for technical analysis.
Sources: README.md:1-12, README.md:58-60
Development Standards
Contributors must follow the PEP 8 Coding Style guidelines for all Python code submissions. This ensures consistency across the library's modules, which include data fetching (Nasdaq, Samco), technical analysis (Trend, Breakout, CandleStick), and utility helpers.
Sources: README.md:62-63
Dependency Management
The project utilizes several core libraries for data processing and web communication. New features should respect the existing dependency stack:
- pandas: For data manipulation and OHLC structures.
- requests: For API interactions.
- beautifulsoup4 / lxml: For data scraping.
- openpyxl: For Excel integrations.
Sources: setup.py:21-28
Contributing Workflow
The contribution process follows a standard GitHub flow. For major changes, contributors are required to open an issue first to discuss the proposed modifications.
The diagram illustrates the standard lifecycle of a contribution to the Stolgo repository.
Sources: README.md:60-65
Testing Requirements
Updating tests is a critical requirement for any contribution. Contributors should ensure that new analysis logic (e.g., new candlestick patterns or trend indicators) is validated against historical data formats.
Current Test Structure
While the project has a Todo to add more unit tests, current examples include testing NSE option chain functionality.
Sources: README.md:54, README.md:65, tests/test_nse_option_chain.py:3-8
Technical Architecture for Contributors
Understanding the internal structure is essential for implementing new features or data providers.
Data Request Architecture
Data providers (like Nasdaq or Samco) use a centralized request system to handle timeouts and retries. Contributors adding new data sources should utilize the RequestUrl or Curl classes.
The relationship between the request handling classes used for fetching financial data.
Sources: lib/stolgo/request.py:12-25, lib/stolgo/request.py:65-80
Module Responsibilities
Contributors should place new logic in the appropriate module based on its function:
| Module | Responsibility | Key Classes |
|---|---|---|
candlestick.py | Recognition of OHLC patterns | CandleStick |
trend.py | Trend direction analysis | Trend |
breakout.py | Consolidation and breakout detection | Breakout |
helper.py | Date formatting and resampling | N/A (Functional) |
nasdaq.py / samco.py | Broker/Exchange data fetching | Nasdaq, Samco |
Sources: lib/stolgo/candlestick.py:3, lib/stolgo/trend.py:5, lib/stolgo/breakout.py:4, lib/stolgo/nasdaq.py:27, lib/stolgo/samco.py:65
Roadmap for Future Contributions
Contributors looking for tasks are encouraged to check the Todo section in the project documentation:
- Expansion of unit tests across all modules.
- Implementation of Support and Resistance features.
- Momentum indicators.
- Development of an Event-Driven Backtester.
Sources: README.md:54-57
Conclusion
Contributing to Stolgo involves adhering to PEP 8 standards, ensuring proper test coverage, and integrating with the existing data request and analysis architecture. By following these guidelines, contributors help build a robust toolset for price action traders.