Extending PolyBot¶
PolyBot is designed for extensibility. Add your own strategies, venues, or AI models.
Extension Points¶
Custom Strategies¶
Build trading strategies by inheriting from BaseStrategy:
class MyStrategy(BaseStrategy):
async def scan(self, update) -> list[Signal]:
...
async def should_exit(self, position, update) -> bool:
...
Custom Venues¶
Add new trading venues by inheriting from BaseVenue:
AI Plugins¶
Integrate AI models by inheriting from AIModelPlugin:
Architecture¶
┌─────────────────┐
│ BaseStrategy │◄── Your custom strategies
├─────────────────┤
│ BaseVenue │◄── Your custom venues
├─────────────────┤
│ AIModelPlugin │◄── Your AI models
└─────────────────┘
Quick Start¶
- Choose what to extend
- Create a new file in the appropriate directory
- Inherit from the base class
- Implement required methods
- Register your extension
- Test in shadow mode
Best Practices¶
- Start with shadow mode
- Write comprehensive tests
- Handle errors gracefully
- Log important events
- Document your code