29 - Ngrok Configuration
Overview
Architecture Diagram
┌──────────────────────────────────────────────────────────────────────────────┐
│ Ngrok Tunnel Architecture │
└──────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ External Services │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ TradingView │ │ Chartink │ │ GoCharting │ │
│ │ Webhooks │ │ Webhooks │ │ Webhooks │ │
│ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │
│ │ │ │ │
│ └────────────────────┼────────────────────┘ │
│ │ │
│ ▼ │
│ https://your-domain.ngrok.io │
└─────────────────────────────────────────────────────────────────────────────┘
│
│ Secure Tunnel
│
┌─────────────────────────────────────────────────────────────────────────────┐
│ Ngrok Client │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ ngrok http 5000 │ │
│ │ │ │
│ │ - Encrypted tunnel │ │
│ │ - HTTPS termination │ │
│ │ - Request inspection │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ OpenAlgo (localhost:5000) │
│ │
│ POST /api/v1/placeorder │
│ POST /api/v1/webhook/{strategy_id} │
└─────────────────────────────────────────────────────────────────────────────┘Configuration
Environment Variables
Setup Steps
1. Create Ngrok Account
2. Configure OpenAlgo
3. Start OpenAlgo
Custom Domain (Paid Feature)
Configuration
Benefits
Implementation
Manager Class
Cleanup Handling
Webhook Configuration
TradingView Webhook URL
Webhook Payload
Troubleshooting
Common Issues
Issue
Solution
Debug Mode
Security Considerations
HTTPS Only
API Key Validation
IP Filtering (Optional)
Platform Support
Windows
macOS/Linux
Key Files Reference
File
Purpose
Last updated