Tradeनीति is an AI-powered backtesting platform for NEPSE retail traders. Users describe strategies in plain language, and Tradeनीति converts them into executable Python code to run secure, sandboxed backtests on NEPSE historical OHLCV data.
hackathon.final.demo.1.mp4
- 📝 Plain-language strategy input — no coding required
- 🤖 LLM-driven Python strategy generation and parsing
- 🐳 Secure sandboxed execution using Docker (network-disabled, resource-limited)
- 📊 NEPSE-specific cleaned OHLCV historical data
- 📈 Standard performance metrics: Total Return, Sharpe Ratio, Max Drawdown, Equity Curve
Retail traders often rely on intuition for strategy evaluation. Tradeनीति replaces guesswork with data-driven validation, providing:
- An accessible frontend for strategy description
- AI-generated, executable trading logic
- Safe, NEPSE-tailored backtesting
High-level flow:
- Frontend: user inputs a plain-language strategy.
- Backend: sends the prompt to an LLM/graph workflow to generate Python code.
- Executor: AI-generated code runs inside an isolated Docker container with strict resource and network restrictions.
- Backtest: Backtrader (with Pandas) executes the strategy on cleaned NEPSE CSV data.
- Results: metrics and equity curve are returned to the frontend.
- Backend entry:
backend/app/main.py - AI & executor endpoints:
backend/app/routers/ai_services.py - Prompts & generation helpers:
backend/app/routers/prompts.py - Executor Docker image:
backend/Dockerfile.executor - Build scripts:
build_executor.sh,build_executor.bat - NEPSE data:
data/cleaned_data/ - Frontend entry:
frontend/src/main.jsx - UI components:
frontend/src/App.jsx,ChatAssistant.jsx,CodeTab.jsx,ResultsTab.jsx
- All AI-generated code runs inside Docker containers, never on host.
- Containers are network-disabled and resource-limited.
- Processes run as non-root, with read-only mounts where possible.
- No access to host environment variables.
This ensures safe and auditable experimentation.
- Python 3.10+
- Docker
- Node.js (LTS)
- Git
git clone https://github.com/Uknowme-h/TradeSight
cd tradeSightpython -m venv .venv
source .venv/bin/activatepip install -r backend/requirements.txt
Run FastAPI (development)uvicorn app.main:app --reload --app-dir backend/app
API docs: http://127.0.0.1:8000/docs./build_executor.sh # Linux/macOS
build_executor.bat # Windowscd frontend
npm install
npm run devOpen the dev server URL printed by Vite (usually http://localhost:5173).
Tradeनीति: Converts the text into Python strategy code → Runs sandboxed backtest → Returns metrics + equity curve.
Total Return — net portfolio growth over backtest
Sharpe Ratio — risk-adjusted performance
Maximum Drawdown — largest peak-to-trough loss
Equity Curve — portfolio value over time
Plain-language → executable code conversion (AI workflow)
Safe, sandboxed execution
NEPSE-tailored dataset usage
Interactive UI for strategy refinement
Parameter optimization & grid search
Walk-forward analysis & paper trading
Portfolio-level backtesting & multi-asset strategies
Visual strategy builder
Live market integration
This repository is a hackathon project....