- Introduced a comprehensive framework for incremental trading strategies, including modules for strategy execution, backtesting, and data processing. - Added key components such as `IncTrader`, `IncBacktester`, and various trading strategies (e.g., `MetaTrendStrategy`, `BBRSStrategy`, `RandomStrategy`) to facilitate real-time trading and backtesting. - Implemented a robust backtesting framework with configuration management, parallel execution, and result analysis capabilities. - Developed an incremental indicators framework to support real-time data processing with constant memory usage. - Enhanced documentation to provide clear usage examples and architecture overview, ensuring maintainability and ease of understanding for future development. - Ensured compatibility with existing strategies and maintained a focus on performance and scalability throughout the implementation.
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""
|
|
Incremental Trading Execution
|
|
|
|
This module provides trading execution and position management for incremental strategies.
|
|
It handles real-time trade execution, risk management, and performance tracking.
|
|
|
|
Components:
|
|
- IncTrader: Main trader class for strategy execution
|
|
- PositionManager: Position state and trade execution management
|
|
- TradeRecord: Data structure for completed trades
|
|
- MarketFees: Fee calculation utilities
|
|
|
|
Example:
|
|
from IncrementalTrader.trader import IncTrader, PositionManager
|
|
from IncrementalTrader.strategies import MetaTrendStrategy
|
|
|
|
strategy = MetaTrendStrategy("metatrend")
|
|
trader = IncTrader(strategy, initial_usd=10000)
|
|
|
|
# Process data stream
|
|
for timestamp, ohlcv in data_stream:
|
|
trader.process_data_point(timestamp, ohlcv)
|
|
|
|
results = trader.get_results()
|
|
"""
|
|
|
|
from .trader import IncTrader
|
|
from .position import PositionManager, TradeRecord, MarketFees
|
|
|
|
__all__ = [
|
|
"IncTrader",
|
|
"PositionManager",
|
|
"TradeRecord",
|
|
"MarketFees",
|
|
] |