Integrations¶
Connect sigc with external tools, languages, and services.
Overview¶
sigc integrates with:
| Category | Integrations |
|---|---|
| Languages | Python |
| IDEs | VSCode |
| Brokers | Alpaca |
| Data | Yahoo Finance |
| Streaming | Real-time data |
Python Integration¶
Use sigc from Python for:
- Jupyter notebooks
- Custom analysis
- Integration with pandas/numpy
- Machine learning pipelines
Python
import pysigc
# Run a strategy
results = pysigc.run("strategy.sig")
print(f"Sharpe: {results.sharpe_ratio:.2f}")
# Access weights
weights = results.weights # pandas DataFrame
VSCode Extension¶
Full IDE support:
- Syntax highlighting
- Code completion
- Error diagnostics
- Hover documentation
Alpaca Trading¶
Execute trades through Alpaca:
YAML
output:
type: alpaca
alpaca:
api_key: ${ALPACA_API_KEY}
api_secret: ${ALPACA_API_SECRET}
paper: true # Paper trading
Yahoo Finance¶
Free market data:
Real-Time Streaming¶
Stream live data:
Integration Architecture¶
Text Only
┌─────────────────────────────────────────────────────────────┐
│ sigc Core │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Parser │ │ Runtime │ │ Output │ │
│ │ (DSL) │ │ (Compute) │ │ (Execute) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
└─────────┼──────────────────┼──────────────────┼────────────┘
│ │ │
┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐
│ VSCode │ │ Python │ │ Alpaca │
│ Extension │ │ (pysigc) │ │ Broker │
└───────────┘ └───────────┘ └───────────┘
Adding Custom Integrations¶
Data Provider¶
Rust
// Implement DataProvider trait
impl DataProvider for MyProvider {
fn fetch(&self, symbols: &[String], range: DateRange) -> DataFrame;
}
Execution Provider¶
Rust
// Implement ExecutionProvider trait
impl ExecutionProvider for MyBroker {
fn submit_order(&self, order: Order) -> OrderResult;
fn get_positions(&self) -> Vec<Position>;
}
Best Practices¶
1. Use Paper Trading First¶
2. Handle Rate Limits¶
3. Cache External Data¶
4. Error Handling¶
Python
try:
results = pysigc.run("strategy.sig")
except pysigc.DataError as e:
print(f"Data issue: {e}")
except pysigc.ExecutionError as e:
print(f"Execution issue: {e}")