Integrated OLS Residuals into Backtrader Strategies

  • Day: 2024-01-18
  • Time: 13:10 to 14:30
  • Project: Dev
  • Workspace: WP 2: Operational
  • Status: In Progress
  • Priority: MEDIUM
  • Assignee: Matías Nehuen Iglesias
  • Tags: Backtrader, OLS, Residuals, Python, Algorithmic Trading

Description

Session Goal

The session aimed to integrate Ordinary Least Squares (OLS) residuals into Backtrader strategies, enhancing algorithmic trading models with data-driven insights.

Key Activities

  • Data Preparation: Calculated rolling OLS residuals for stock prices using Python, Pandas, and Statsmodels, providing a foundation for strategy integration.
  • Optimization: Developed a Python function to optimize residual calculation by selecting every nth data point, improving computational efficiency.
  • Strategy Implementation: Modified a Backtrader strategy to incorporate residual data feeds, detailing class structure and methods for decision-making based on residuals.

Achievements

  • Successfully integrated OLS residuals into Backtrader strategies, enhancing decision-making processes with refined data analysis.
  • Optimized residual calculation for better performance and efficiency.

Pending Tasks

  • Further test and validate the modified trading strategies using historical data to ensure robustness and reliability.
  • Explore additional optimization techniques for residual calculation and strategy performance.

Evidence

  • source_file=2024-01-18.sessions.jsonl, line_number=0, event_count=0, session_id=4e459752a260150572e4a8adbdf556411ad1ba4cddfe9f014f36a13e99c941af
  • event_ids: []