This update reorganizes the WinstonAI project into a proper Python library structure with clear separation of concerns and easy-to-use APIs.
-
Created
winston_ai/Package Structure- Organized code into logical submodules
- Added proper
__init__.pyfiles for each module - Implemented clean import system
-
Modular Architecture
winston_ai/ ├── models/ # Neural network architectures ├── training/ # Training utilities and agents ├── trading/ # Live trading interface ├── indicators/ # Technical analysis └── utils/ # Helper functions -
Example Scripts
examples/quickstart.py- Quick start guideexamples/train_model.py- Full training exampleexamples/use_model.py- Inference example
-
Reorganized Files
- Config files moved to
data/configs/ - Model checkpoints go to
models/(gitignored) - Legacy scripts remain in
src/for reference
- Config files moved to
pip install -e .from winston_ai import Trainer, Config
import pandas as pd
# Load your data
data = pd.read_csv('market_data.csv')
# Train model
config = Config()
trainer = Trainer(data=data, config=config)
metrics = trainer.train(episodes=1000)from winston_ai import LiveTrader
trader = LiveTrader('models/winston_ai_final.pth')
prediction = trader.predict(recent_data)
print(f"Action: {prediction['action_name']}")WinstonAI- Standard DQN model with LSTMAdvancedWinstonAI- Large GPU-optimized model with attentionMultiHeadAttention- Transformer attention mechanism
Trainer- High-level training orchestrationDQNAgent- Deep Q-Network agent with experience replayBinaryOptionsEnvironment- Trading simulation environment
LiveTrader- Interface for using trained models in production
TechnicalIndicators- 50+ technical indicators calculator
Config- Configuration managementget_device(),setup_gpu()- GPU utilitiessave_checkpoint(),load_checkpoint()- Model persistence
- Better Organization - Clear separation of concerns
- Easy to Use - Simple, intuitive API
- Reusable - Import only what you need
- Maintainable - Modular structure makes updates easier
- Extensible - Easy to add new features
- Documented - Examples and documentation included
- Original scripts in
src/still work - Can be used alongside the new library
- Gradual migration path available
Library has been tested and verified:
- ✅ All imports work correctly
- ✅ Configuration system functional
- ✅ Training pipeline operational
- ✅ Model architectures validated
- Train models using the new API
- Integrate with your trading platform
- Extend with custom strategies
- Add more technical indicators
- Implement backtesting framework
- See
examples/README.mdfor detailed usage - Check
README.mdfor updated documentation - Original scripts remain in
src/for reference