{"id":26917810,"url":"https://github.com/smpotts/day-trades-analysis","last_synced_at":"2025-04-14T02:44:31.062Z","repository":{"id":223153732,"uuid":"758961550","full_name":"smpotts/day-trades-analysis","owner":"smpotts","description":"Examines trade data and finds the day trades that occurred within a given time period in a Jupyter Notebook hosted on a Docker container.","archived":false,"fork":false,"pushed_at":"2024-02-27T02:03:44.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T20:51:26.812Z","etag":null,"topics":["docker-compose","financial-analysis","jupyter-notebook","postgresql","trading-data"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smpotts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-17T15:31:11.000Z","updated_at":"2025-03-19T16:38:34.000Z","dependencies_parsed_at":"2024-02-23T14:29:27.640Z","dependency_job_id":"4bd1f113-ab4d-45c7-9aa0-8763f648401e","html_url":"https://github.com/smpotts/day-trades-analysis","commit_stats":null,"previous_names":["smpotts/notebook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smpotts%2Fday-trades-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smpotts%2Fday-trades-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smpotts%2Fday-trades-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smpotts%2Fday-trades-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smpotts","download_url":"https://codeload.github.com/smpotts/day-trades-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812769,"owners_count":21165476,"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","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":["docker-compose","financial-analysis","jupyter-notebook","postgresql","trading-data"],"created_at":"2025-04-01T20:50:39.163Z","updated_at":"2025-04-14T02:44:31.057Z","avatar_url":"https://github.com/smpotts.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Day Trades Notebook\n\n## Overview\nThis project analyzes day trading data in a Jupyter Notebook hosted on a Docker container. It imports a file with trade data called `trades.csv`, where the input data are in this format:\n\n| account_id | symbol | side | qty | timestamp |\n| ---- | ---- | ---- | ---- | ---- |\n| 77658 | GOOG | sell | 493 | 2023-09-04 09:30:00 |\n| 19191 | NVDA | sell | 216 | 2023-09-04 09:30:03 |\n\nThese source data are loaded into a table called `public.trades` on Postgres instance hosted on a Docker container when the container starts up. The Docker configuration also starts a Jupyter notebook, which queries the `public.trades` table name puts the source data into a DataFrame.\n\nThe Jupyter notebook analyzes the trading data and looks for the number of day-trades the occurred per account within a given time period. The program outputs a file with day trades in the `/work` directory.\n\n## How to run\n### Starting Docker\nThe program runs on Docker and can be started with a `docker compose up -d --build` command.\nThere are two containers: one for the Postgresql instance and another for Jupyter Notebooks, verify they are running with a `docker ps` command.\n\n### Starting Jupyter Notebooks \nOnce both containers are up, and they are healthy, open a browser and go to 'http://localhost:8888/'. This will launch the Jupyter notebook which contains the trading analysis. \n\nNavigate inside the `work/` directory and open the `trades_notebook.ipynb` file. Run each block of code within the notebook. The final statement contains a method call where you can input a `start_time` and an `end_time` for the date range to analyze day trades by account. Running the final code block will run the `find_day_trades()` and the `write_output_file()` method will create a `.csv` file with the count of day trades per account over the given time window. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmpotts%2Fday-trades-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmpotts%2Fday-trades-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmpotts%2Fday-trades-analysis/lists"}