This guide walks you through the process of installing, configuring, and starting to use TradeLens.
Before you begin, make sure you have the following:
- Python 3.8 or higher installed
- pip (Python package installer)
- A Perplexity API key (for AI-powered features)
- Your stock transaction data in CSV format
git clone https://github.com/yourusername/tradelens.git
cd tradelenspython -m venv venvOn macOS/Linux:
source venv/bin/activateOn Windows:
venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory with the following content:
PERPLEXITY_API_KEY=your_perplexity_api_key
OPENAI_API_KEY=your_openai_api_key (optional)
Replace your_perplexity_api_key with your actual Perplexity API key.
python init_db.pyThis will create the SQLite database that stores transaction data and other information.
./run_server.shOr on Windows:
python app.pyOpen your web browser and navigate to:
http://localhost:5000
-
Prepare your transaction data in CSV format with the following columns:
- Date (MM/DD/YYYY)
- Time
- Symbol
- Name
- Type
- Side (Buy/Sell)
- AveragePrice
- Qty
- State
- Fees
-
From the TradeLens dashboard, click on the "Upload Transactions" button.
-
Select your CSV file and click "Upload."
-
Once uploaded, your transaction data will be processed and displayed on the dashboard.
-
Navigate to the Settings page by clicking on the gear icon in the navigation bar.
-
Set your preferred AI provider (Perplexity is recommended).
-
Choose your default Perplexity model based on your needs:
- sonar: Fast responses for general queries
- sonar-pro: Enhanced analysis capabilities
- sonar-reasoning: Better reasoning for complex financial questions
- sonar-deep-research: In-depth research and comprehensive analysis
-
Save your settings.
Once you've completed the setup and uploaded your transaction data, you can:
- Explore the dashboard to visualize your portfolio
- Analyze your portfolio composition
- Use AI features to gain investment insights
- Track upcoming earnings for your stocks
- Assess portfolio risks
If you encounter any issues during setup or usage:
- Check the application logs (
app.log) for error messages - Verify that your API keys are correctly set in the
.envfile - Ensure your transaction CSV file is properly formatted
- Make sure all dependencies are installed correctly