{"id":25763329,"url":"https://github.com/miteshsharma/tradingai","last_synced_at":"2026-04-17T13:32:23.248Z","repository":{"id":278952765,"uuid":"937265610","full_name":"MiteshSharma/tradingai","owner":"MiteshSharma","description":"📈 TradingAI: An AI-powered trading analysis system combining technical analysis with GPT-4 for smart trading decisions. Features market scoring, trend analysis, and automated signals.","archived":false,"fork":false,"pushed_at":"2025-02-22T18:27:51.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T19:27:07.126Z","etag":null,"topics":["fastapi","llm","python","trading","zerodha"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiteshSharma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T18:15:38.000Z","updated_at":"2025-02-22T18:29:06.000Z","dependencies_parsed_at":"2025-02-22T19:27:13.855Z","dependency_job_id":"535529cc-a8aa-4d5f-834a-8de8dcb74b03","html_url":"https://github.com/MiteshSharma/tradingai","commit_stats":null,"previous_names":["miteshsharma/tradingai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MiteshSharma/tradingai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2Ftradingai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2Ftradingai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2Ftradingai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2Ftradingai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiteshSharma","download_url":"https://codeload.github.com/MiteshSharma/tradingai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2Ftradingai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280965035,"owners_count":26421548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","llm","python","trading","zerodha"],"created_at":"2025-02-26T20:16:20.094Z","updated_at":"2025-10-25T14:06:02.758Z","avatar_url":"https://github.com/MiteshSharma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TradingAI 🤖 📈\n\nAn AI-powered trading analysis system that combines technical analysis with LLM-based decision making. The system analyzes market conditions, technical indicators, and uses GPT-4 to generate trading decisions.\n\n## Overview 🌟\n\nTradingAI helps traders by:\n- Analyzing market conditions using EMA-based scoring\n- Identifying stocks in Stage 2 uptrend\n- Providing AI-powered trading decisions with entry/exit points\n- Automating data collection and analysis\n\n## Features\n\n### Data Management 📊\n- Historical data fetching from Zerodha\n- Daily EOD data updates\n- Data validation and cleaning\n- Efficient PostgreSQL storage\n\n### Technical Analysis 📈\n- Moving Averages (SMA, EMA)\n- MACD Indicator\n- Bollinger Bands\n- Volume Analysis\n- Market Breadth\n\n### AI Analysis 🧠\n- Market Condition Assessment (6-point scoring)\n- Pattern Recognition\n- Trading Signal Generation\n- Risk Assessment\n- Stop Loss Calculation\n\n### API Interface 🔌\n- RESTful API endpoints\n- Real-time analysis\n- Historical data access\n- Batch operations\n\n## Installation 🚀\n\n1. Clone the repository:\n\ngit clone https://github.com/mitesh-sharma/tradingai.git\ncd tradingai\n\n2. Create and activate virtual environment:\npython -m venv venv\nsource venv/bin/activate \n\n3. Install dependencies:\npip install -e \".[dev]\"\n\n4. Set up environment variables:\ncp .env.example .env\n\nEdit .env with your credentials\n\n5. Set up database:\ncreatedb tradingai\n\n## Configuration ⚙️\n\nRequired environment variables in `.env`:\nDatabase\nPOSTGRES_SERVER=localhost\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=your_password\nPOSTGRES_DB=tradingai\nAPI Security\nAPI_KEY=your_api_key\nZerodha\nZERODHA_API_KEY=your_zerodha_api_key\nZERODHA_API_SECRET=your_zerodha_secret\nZERODHA_USER_ID=your_zerodha_user_id\nOpenAI\nOPENAI_API_KEY=your_openai_key\nLLM_MODEL_NAME=gpt-4\n\n## Usage 📡\n\n1. Start the server:\nuvicorn src.tradingai.main:app --reload\n\n2. Fetch historical data:\ncurl -X POST http://localhost:8000/api/v1/stock/stocks/historical \\\n-H \"Content-Type: application/json\" \\\n-H \"X-API-Key: your-secret-key\" \\\n-d '{\n\"symbols\": [\"ZOTA\"],\n\"from_date\": \"2023-02-22\",\n\"to_date\": \"2024-02-22\"\n}'\n\n3. Get analysis with LLM decision:\ncurl http://localhost:8000/api/v1/stock/analyze/ZOTA/with-decision \\\n-H \"X-API-Key: your-secret-key\"\n\n## API Endpoints 🛣️\n- `POST /api/v1/stock/stocks/historical`: Fetch historical data\n- `GET /api/v1/stock/analyze/{symbol}`: Get technical analysis\n- `GET /api/v1/stock/analyze/{symbol}/with-decision`: Get analysis with LLM trading decision\n- `GET /api/v1/stock/symbols`: List all available symbols\n- `POST /api/v1/stock/daily-update`: Trigger daily data update\n\n## Technical Details 🔧\n\n### Market Analysis\n- Uses 6-point EMA scoring system\n- Analyzes market breadth\n- Provides market context and direction\n\n### Stock Analysis\n- 30-week SMA trend analysis\n- MACD confirmation\n- Bollinger Band correction opportunities\n- Volume trend analysis\n\n### LLM Integration\n- Uses GPT-4 for decision making\n- Structured prompts for consistent analysis\n- Includes market context in decisions\n- Provides detailed reasoning\n\n## Contributing 🤝\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Author 👨‍💻\n\n**Mitesh Sharma**\n- GitHub: [@mitesh-sharma](https://github.com/mitesh-sharma)\n\n## Acknowledgments 🙏\n\n- [Zerodha](https://zerodha.com/) for their trading API\n- [OpenAI](https://openai.com/) for GPT-4 API\n- [FastAPI](https://fastapi.tiangolo.com/) for the web framework\n- [SQLAlchemy](https://www.sqlalchemy.org/) for database ORM\n\n  ---\n\n\u003e This project was developed with the assistance of AI language models (Claude and GPT-4) to demonstrate the potential of AI-powered development while maintaining high code quality and security standards.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiteshsharma%2Ftradingai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiteshsharma%2Ftradingai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiteshsharma%2Ftradingai/lists"}