$ show algobulls/pyalgotrading
pyalgotrading is a Python library that provides an interface to the AlgoBulls algorithmic trading platform. It enables users to create, upload, and execute trading strategies for backtesting, paper trading, and live trading. The library includes abstractions for strategies, orders, and technical indicators, along with an API client for communicating with the AlgoBulls platform. Users define strategy classes that inherit from StrategyBase, implement required methods, and then use the AlgoBullsConnection class to deploy and manage their strategies on the platform. The library supports multiple order types, technical indicators via TA-Lib, and various candlestick chart formats.
The LLM identified 2 files worth highlighting for reuse:
A self-contained implementation of the Heikin Ashi candlestick calculation algorithm. Takes a pandas DataFrame with standard OHLC data and returns a new DataFrame with Heikin Ashi values. Demonstrates clean financial engineering practices with proper data handling, zero dependencies beyond pandas, and clear documentation. Could be easily extracted and used in any financial analysis or trading system.
Contains self-contained functions for calculating slippage and brokerage adjustments in trading P&L data. The calculate_slippage() and calculate_brokerage() functions process P&L DataFrames to adjust for real-world trading costs. These are isolated utilities with minimal dependencies (primarily pandas) that could be reused in any backtesting or trading analysis system. Shows good encapsulation of domain-specific financial calculations.