{"id":18005599,"url":"https://github.com/areed1192/python-trading-robot","last_synced_at":"2025-04-12T09:25:34.372Z","repository":{"id":38788156,"uuid":"249618904","full_name":"areed1192/python-trading-robot","owner":"areed1192","description":"A trading robot, that can submit basic orders in an automated fashion using the TD API.","archived":false,"fork":false,"pushed_at":"2022-06-22T03:13:57.000Z","size":100,"stargazers_count":559,"open_issues_count":22,"forks_count":321,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-04-03T09:09:52.375Z","etag":null,"topics":["finance","portfolio","python","stocks","tdameritrade-api","trading-robot","trading-robots"],"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/areed1192.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["areed1192"],"patreon":"sigmacoding","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-03-24T05:14:23.000Z","updated_at":"2025-03-20T16:17:06.000Z","dependencies_parsed_at":"2022-07-28T23:18:46.235Z","dependency_job_id":null,"html_url":"https://github.com/areed1192/python-trading-robot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fpython-trading-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fpython-trading-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fpython-trading-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fpython-trading-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areed1192","download_url":"https://codeload.github.com/areed1192/python-trading-robot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248545203,"owners_count":21122096,"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":["finance","portfolio","python","stocks","tdameritrade-api","trading-robot","trading-robots"],"created_at":"2024-10-30T00:20:45.584Z","updated_at":"2025-04-12T09:25:34.343Z","avatar_url":"https://github.com/areed1192.png","language":"Python","readme":"# Python Trading Robot\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Support These Projects](#support-these-projects)\n\n## Overview\n\nCurrent Version: **0.1.1**\n\nA trading robot written in Python that can run automated strategies using a technical analysis.\nThe robot is designed to mimic a few common scenarios:\n\n1. Maintaining a portfolio of multiple instruments. The `Portfolio` object will be able\n   to calculate common risk metrics related to a portfolio and give real-time feedback\n   as you trade.\n\n2. Define an order that can be used to trade a financial instrument. With the `Trade` object,\n   you can define simple or even complex orders using Python. These orders will also help similify\n   common scenarios like defining both a take profit and stop loss at the same time.\n\n3. A real-time data table that includes both historical and real-time prices as they change. The\n   `StockFrame` will make the process of storing your data easy and quick. Additionally, it will be\n   setup so that way you can easily select your financial data as it comes in and do further analysis\n   if needed.\n\n4. Define and calculate indicators using both historical and real-time prices. The `Indicator` object\n   will help you easily define the input of your indicators, calculate them, and then update their values\n   as new prices come.\n\n## Setup\n\n**Setup - Local Install:**\n\nIf you are planning to make modifications to this project or you would like to access it\nbefore it has been indexed on `PyPi`. I would recommend you either install this project\nin `editable` mode or do a `local install`. For those of you, who want to make modifications\nto this project. I would recommend you install the library in `editable` mode.\n\nIf you want to install the library in `editable` mode, make sure to run the `setup.py`\nfile, so you can install any dependencies you may need. To run the `setup.py` file,\nrun the following command in your terminal.\n\n```console\npip install -e .\n```\n\nIf you don't plan to make any modifications to the project but still want to use it across\nyour different projects, then do a local install.\n\n```console\npip install .\n```\n\nThis will install all the dependencies listed in the `setup.py` file. Once done\nyou can use the library wherever you want.\n\n**Setup - PyPi Install:**\n\nThe project can be found at PyPI, if you'd like to view the project please use this\n[link](https://pypi.org/project/python-trading-robot/). To **install** the library,\nrun the following command from the terminal.\n\n```bash\npip install python-trading-robot\n```\n\n**Setup - PyPi Upgrade:**\n\nTo **upgrade** the library, run the following command from the terminal.\n\n```bash\npip install --upgrade python-trading-robot\n```\n\n## Usage\n\nTo run the robot, you will need to provide a few pieces of information from your TD Ameritrade Developer account.\nThe following items are need for authentication:\n\n- Client ID: Also, called your consumer key, this was provided when you registered an app with the TD Ameritrade\n  Developer platform. An example of a client ID could look like the following `MMMMYYYYYA6444VXXXXBBJC3DOOOO`.\n\n- Redirect URI: Also called the callbakc URL or redirect URL, this was specified by you when you regiestered your app with\n  the TD Ameritrade Developer platform. Here is an example of a redirect URI \u003chttps://localhost/mycallback\u003e\n\n- Credentials Path: This is a file path that will point to a JSON file where your state info will be saved. Keep in mind\n  that it is okay if it points to a non-existing file as once you run the script the file will be auto generated. For example,\n  if I want my state info to be saved to my desktop, then it would look like the following: `C:\\Users\\Desktop\\ts_state.json`\n\nOnce you've identfied those pieces of info, you can run the robot. Here is a simple example that will create a new instance\nof it:\n\n```python\nfrom pyrobot.robot import PyRobot\n\n# Initialize the robot\ntrading_robot = PyRobot(\n    client_id='XXXXXX111111YYYY22',\n    redirect_uri='https://localhost/mycallback',\n    credentials_path='path/to/td_state.json'\n)\n```\n\nFor more detailed examples, go to the `trading_robot.py` file to see an example of how to use the library along with all\nthe different objects inside.\n\n## Support these Projects\n\n**Patreon:**\nHelp support this project and future projects by donating to my [Patreon Page](https://www.patreon.com/sigmacoding). I'm always\nlooking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.\n\n**YouTube:**\nIf you'd like to watch more of my content, feel free to visit my YouTube channel [Sigma Coding](https://www.youtube.com/c/SigmaCoding).\n\n\u003c!-- **Hire Me:**\nIf you have a project, you think I can help you with feel free to reach out at [coding.sigma@gmail.com](mailto:coding.sigma@gmail.com?subject=[GitHub]%20Project%20Proposal) or fill out the [contract request form](https://forms.office.com/Pages/ResponsePage.aspx?id=ZwOBErInsUGliXx0Yo2VfcCSWZSwW25Es3vPV2veU0pUMUs5MUc2STkzSzVQMFNDVlI5NjJVNjREUi4u) --\u003e\n","funding_links":["https://github.com/sponsors/areed1192","https://patreon.com/sigmacoding","https://www.patreon.com/sigmacoding"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Fpython-trading-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareed1192%2Fpython-trading-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Fpython-trading-robot/lists"}