Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marketcalls/openterminal
OpenSource - Trading Terminal for Indian Traders
https://github.com/marketcalls/openterminal
daisyui flask monitor-trades placeorder python redis sqlite-database trading-terminal voice-orders
Last synced: about 1 month ago
JSON representation
OpenSource - Trading Terminal for Indian Traders
- Host: GitHub
- URL: https://github.com/marketcalls/openterminal
- Owner: marketcalls
- License: other
- Created: 2024-10-07T14:52:44.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-11-23T06:38:51.000Z (about 2 months ago)
- Last Synced: 2024-11-23T07:26:00.679Z (about 2 months ago)
- Topics: daisyui, flask, monitor-trades, placeorder, python, redis, sqlite-database, trading-terminal, voice-orders
- Language: Python
- Homepage: https://marketcalls.in
- Size: 235 KB
- Stars: 4
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Terminal - Trading Dashboard
Open Terminal is a Flask-based application for traders that provides a secure login system using AngelOne API, registration, and a protected dashboard. The app utilizes SQLite for database management, Flask-SQLAlchemy for ORM, and Redis for caching.
## Features
### Core Features
- **User Registration**: Users can register by providing their username, client ID, and API key
- **Login Authentication**: Secure login using AngelOne's API, with session management and access token storage
- **Protected Dashboard**: Accessible only to authenticated users### Trading Features
- **Watchlists**: Create, update, and delete watchlists (up to 5 per user)
- **Watchlist Items**: Add, remove, and manage items in watchlists
- **Real-time Data**: Display of real-time market data for watchlist items
- **Market Depth**: Level 2 order book display
- **Search Functionality**: Search for symbols to add to watchlists
- **Market Indices**: Display of NIFTY and SENSEX indices### User Experience
- **Customizable Settings**: Users can customize their watchlist display settings
- **Secure Logout**: Removes the access token from the database and logs the user out
- **Modern UI**: Uses Tailwind CSS and DaisyUI for a consistent, modern interface## Technology Stack
### Backend
- **Framework**: Flask, Flask-SQLAlchemy, Flask-Login, Flask-WTF
- **Database**: SQLite
- **Caching**: Redis
- **API Integration**: AngelOne API for user authentication and market data
- **Task Scheduling**: APScheduler
- **Timezone**: pytz for timezone handling### Frontend
- **CSS Framework**: Tailwind CSS
- **UI Components**: DaisyUI
- **JavaScript**: Modern ES6+ with modular architecture
- **Real-time Updates**: WebSocket integration## Project Structure
```bash
openterminal/
├── app.py # Application entry point
├── config.py # Flask configuration
├── extensions.py # Database and extensions
├── master_contract.py # Market data handling
├── models.py # Database models
├── triggerdb.py # Database triggers
├── README.md # Project documentation
├── requirements.txt # Dependencies
├── vercel.json # Vercel deployment configuration
├── instance/ # Instance-specific data
├── routes/
│ ├── __init__.py
│ ├── auth.py # Authentication routes
│ ├── funds.py # Funds routes
│ ├── home.py # Home routes
│ ├── orders.py # Order management
│ └── dashboard/
│ ├── __init__.py
│ ├── market_data_service.py
│ ├── routes.py
│ ├── settings_service.py
│ ├── utils.py
│ └── watchlist_service.py
├── static/
│ └── js/
│ ├── dashboard.js # Main dashboard logic
│ └── modules/
│ ├── marketDataDecoder.js # Real-time Websocket decoder
│ ├── marketDataUpdater.js # Real-time updates
│ ├── watchlistCore.js # Core watchlist functionality
│ ├── watchlistEvents.js # Watchlist event handlers
│ ├── watchlistManager.js # Watchlist management
│ ├── watchlistOperations.js # Watchlist operations
│ └── templates/
│ ├── emptyWatchlist.html
│ ├── marketDepth.html
│ └── symbolListItem.html
└── templates/ # HTML templates
├── about.html
├── dashboard.html
├── funds.html
├── holdings.html
├── index.html
├── layout.html
├── login.html
├── orderbook.html
├── positions.html
├── register.html
└── tradebook.html
```## Installation
### Prerequisites
- Python 3.9+
- Redis Server
- Git### Setup Steps
1. **Clone the repository:**
```bash
git clone https://github.com/marketcalls/OpenTerminal.git
cd OpenTerminal
```2. **Create virtual environment:**
```bash
python -m venv venv
```3. **Activate virtual environment:**
```bash
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
```4. **Install dependencies:**
```bash
pip install -r requirements.txt
```5. **Configure Redis:**
- Install Redis on your system if not already installed
- Ensure Redis server is running6. **Run application:**
```bash
python app.py
```7. Access at `http://127.0.0.1:5000`
Note: The SQLite database will be created automatically when you first run the application.
## Environment Variables
Create a `.env` file with:
```env
SECRET_KEY=your-secret-key
SQLALCHEMY_DATABASE_URI=sqlite:///open_terminal.db
REDIS_URL=redis://localhost:6379/0
```## Usage Guide
1. **Registration**
- Visit `/register`
- Provide required credentials2. **Login**
- Use client ID, PIN, and TOTP
- Access granted to dashboard3. **Dashboard Features**
- Manage watchlists (up to 5)
- Add/remove symbols
- View real-time data
- Customize settings
- Monitor market indices4. **Additional Features**
- Access funds information
- View holdings
- Check order book
- Monitor positions
- Review trade book5. **Logout**
- Secure session termination
- Token cleanup## Development Status
Open Terminal is under active development with regular updates and improvements. Users should expect ongoing enhancements and potential changes as the platform evolves.
## Future Features
- Comprehensive trading functionality
- Advanced charting capabilities
- Multi-broker integration
- Backtesting tools
- Strategy building features## Contributing
We welcome contributions! For major changes:
1. Fork the repository
2. Create a feature branch
3. Submit a pull request
4. Open an issue for discussion## License
GNU Affero General Public License v3.0 (AGPL-3.0)
Key requirements:
- Source code availability for modifications
- Network use considered as distribution
- Modifications must maintain AGPL-3.0 license
- See [LICENSE](LICENSE) file for complete terms---
Developed with passion for the trading community