{"id":50615274,"url":"https://github.com/marketcalls/sector-rotation-map","last_synced_at":"2026-06-06T07:30:56.070Z","repository":{"id":354955302,"uuid":"1175465540","full_name":"marketcalls/sector-rotation-map","owner":"marketcalls","description":"Interactive RRG dashboard for NSE sector indices powered by OpenAlgo","archived":false,"fork":false,"pushed_at":"2026-03-07T18:48:34.000Z","size":532,"stargazers_count":14,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-01T06:40:27.030Z","etag":null,"topics":["fast-api","openalgo","python","relative-momentum","rrg-charts","sector-rotation"],"latest_commit_sha":null,"homepage":"https://docs.openalgo.in","language":"JavaScript","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/marketcalls.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-07T18:46:11.000Z","updated_at":"2026-04-23T04:28:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marketcalls/sector-rotation-map","commit_stats":null,"previous_names":["marketcalls/sector-rotation-map"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/marketcalls/sector-rotation-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marketcalls%2Fsector-rotation-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marketcalls%2Fsector-rotation-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marketcalls%2Fsector-rotation-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marketcalls%2Fsector-rotation-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marketcalls","download_url":"https://codeload.github.com/marketcalls/sector-rotation-map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marketcalls%2Fsector-rotation-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33973868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"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":["fast-api","openalgo","python","relative-momentum","rrg-charts","sector-rotation"],"created_at":"2026-06-06T07:30:54.523Z","updated_at":"2026-06-06T07:30:56.057Z","avatar_url":"https://github.com/marketcalls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sector Rotation Map\n\nAn interactive Relative Rotation Graph (RRG) dashboard for NSE sector indices, powered by [OpenAlgo](https://openalgo.in).\n\nInspired by [@traderprad's tweet](https://x.com/traderprad/status/2029818798472053237/photo/1) on sector rotation analysis for the Indian market.\n\n![Sector Rotation Map](image/sectorrotation.png)\n\n## What is an RRG?\n\nA Relative Rotation Graph plots securities on a four-quadrant chart based on their relative strength (RS-Ratio) and momentum (RS-Momentum) against a benchmark index. Securities rotate through four quadrants:\n\n- **Leading** (top-right) — Strong relative strength, strong momentum\n- **Weakening** (bottom-right) — Strong relative strength, fading momentum\n- **Lagging** (bottom-left) — Weak relative strength, weak momentum\n- **Improving** (top-left) — Weak relative strength, gaining momentum\n\nThe tail trail shows the historical path of each sector, revealing rotation patterns and trend direction.\n\n## Sectors Tracked\n\n| Symbol | Sector |\n|--------|--------|\n| NIFTYIT | IT |\n| NIFTYAUTO | Auto |\n| NIFTYPHARMA | Pharma |\n| NIFTYENERGY | Energy |\n| NIFTYFMCG | FMCG |\n| NIFTYMETAL | Metal |\n| NIFTYREALTY | Realty |\n| NIFTYPVTBANK | Pvt Bank |\n| NIFTYPSUBANK | PSU Bank |\n| NIFTYMEDIA | Media |\n| NIFTYINFRA | Infra |\n| NIFTYCOMMODITIES | Commodities |\n\n## Benchmarks\n\nNIFTY, BANKNIFTY, NIFTY500, NIFTYNXT50, MIDCPNIFTY, FINNIFTY\n\n## Tech Stack\n\n- **Backend** — Python, FastAPI, OpenAlgo SDK\n- **Frontend** — Vanilla JS, D3.js\n- **Data** — OpenAlgo historical data API (daily, resampled to weekly)\n\n## Prerequisites\n\n- Python 3.10+\n- [uv](https://docs.astral.sh/uv/) package manager\n- [OpenAlgo](https://openalgo.in) running locally with a valid API key and broker logged in\n\n## Setup \u0026 Run\n\n```bash\n# Clone the repository\ngit clone https://github.com/marketcalls/sector-rotation-map.git\ncd sector-rotation-map\n\n# Copy the sample env file and add your OpenAlgo API key\ncp .env.sample .env\n# Edit .env with your OPENALGO_API_KEY\n\n# Install dependencies\nuv sync\n\n# Run the server\nuv run python api_server.py\n```\n\nOpen [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser.\n\n## Configuration\n\nConfigure via the `.env` file (copy from `.env.sample`):\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `OPENALGO_API_KEY` | — | Your OpenAlgo API key |\n| `OPENALGO_HOST` | `http://127.0.0.1:5000` | OpenAlgo server URL |\n\n## Features\n\n- Real-time RRG computation for 12 NSE sector indices\n- Switchable benchmarks (Nifty 50, Bank Nifty, etc.)\n- Adjustable tail lengths (6, 8, 12, 16, 20 weeks)\n- Drill down into sector constituents\n- Add custom symbols and create portfolios\n- Interactive D3 scatter chart with tails, tooltips, and highlighting\n\n## License\n\n[MIT](LICENSE)\n\n## Credits\n\n- Inspired by [@traderprad](https://x.com/traderprad/status/2029818798472053237/photo/1)\n- Data powered by [OpenAlgo](https://openalgo.in)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarketcalls%2Fsector-rotation-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarketcalls%2Fsector-rotation-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarketcalls%2Fsector-rotation-map/lists"}