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",
|
||
|
|
]
|