{"id":18005628,"url":"https://github.com/areed1192/trading-system","last_synced_at":"2025-03-26T10:32:13.529Z","repository":{"id":40955697,"uuid":"383873639","full_name":"areed1192/trading-system","owner":"areed1192","description":"A python application that leverages Microsoft Azure to build a fully functional trading system.","archived":false,"fork":false,"pushed_at":"2023-05-23T01:26:38.000Z","size":103,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T15:42:16.182Z","etag":null,"topics":["azure","azure-blob-storage","azure-data-factory","azure-key-vault","azure-rbac","azure-sql","iex-api","python","td-ameritrade-api"],"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"}},"created_at":"2021-07-07T17:18:26.000Z","updated_at":"2025-01-05T10:13:00.000Z","dependencies_parsed_at":"2022-09-20T18:20:24.883Z","dependency_job_id":null,"html_url":"https://github.com/areed1192/trading-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"areed1192/sigma-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftrading-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftrading-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftrading-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftrading-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areed1192","download_url":"https://codeload.github.com/areed1192/trading-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245637214,"owners_count":20648110,"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":["azure","azure-blob-storage","azure-data-factory","azure-key-vault","azure-rbac","azure-sql","iex-api","python","td-ameritrade-api"],"created_at":"2024-10-30T00:20:53.200Z","updated_at":"2025-03-26T10:32:13.172Z","avatar_url":"https://github.com/areed1192.png","language":"Python","funding_links":["https://github.com/sponsors/areed1192","https://patreon.com/sigmacoding","https://www.patreon.com/sigmacoding"],"categories":[],"sub_categories":[],"readme":"# Python Trading System\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\nIn this project, you can use python to help develop your own trading system which you can use\nto help place and manage trades using the Azure Ecosystem. Not only will this project help setup\nyour azure services like a data factory, key vault, and sql databases but it will also help get you\nstarted with a few piplines and tables that you can use to store and transform your data.\n\nAlong with leveraging Azure Data services, it also helps you leverage Azure Machine learning services where\nyou can develop machine learning models to help generate signals that can be used for trading purposes.\n\n## Requirements\n\n1. A Microsoft Azure Subscription.\n2. The Azure CLI installed on your system.\n3. A IEX API Key.\n4. A TD Ameritrade Account.\n\n## Setup\n\n**Setup - Requirements Install:**\n\nFor this particular project, you only need to install the dependencies, to use the project. The dependencies\nare listed in the `requirements.txt` file and can be installed by running the following command:\n\n```console\npip install -r requirements.txt\n```\n\nAfter running that command, the dependencies should be installed.\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## Usage\n\nHere is a simple example of using the `tradesys` library to create `RoleBasedAccessControl` object.\n\n```python\nimport pathlib\nfrom tradesys.rbac.client import RoleBasedAccessControl\n\n# Grab your subscription ID, before running this script.\nsubscription_id = '\u003cYOUR_AZURE_SUBSCRIPTION_ID\u003e'\n\n# Initialize the Client.\nrbac_client = RoleBasedAccessControl(subscription_id=subscription_id)\n\n# If we have access to the CLI continue.\nif rbac_client.check_for_azure_cli():\n\n    # Then create a new RBAC object.\n    print(rbac_client.create_rbac(rbac_name='myTestRbac'))\n\n    # Create our new config file.\n    config_location = pathlib.Path(\"config/my_new_config.ini\")\n    rbac_client.generate_config_files(file_name=config_location)\n\n    # Create our new command file.\n    script_location = pathlib.Path(\"config/my_new_script.cmd\")\n    rbac_client.generate_batch_script(file_name=script_location)\n\n```\n\nHere we can see how to create a SQL Server using some of the templates provided:\n\n```python\nfrom tradesys.client import TradingSystem\n\n# Initialize the Trading System Client.\ntrade_sys_client = TradingSystem()\n\n# Access the SQL Management Client.\nsql_mgmt_client = trade_sys_client.sql_mgmt_client\n\n# Set some constants.\nCREATE_SERVER = True\nCREATE_DATABASE = True\nCREATE_FIREWALL_RULE = True\n\n# Set some constants for resource creation.\nSQL_SERVER_USERNAME = 'SOME_USERNAME'\nSQL_SERVER_PASSWORD = 'SOME_STRONG_PASSWORD'\nAZURE_RESOURCE_GROUP = 'YOUR_AZURE_RESOURCE_GROUP'\n\n# Step 1: Load our `SqlServer` resource template.\nsql_server_resource_template = trade_sys_client.templates_client.load_template(\n    'server'\n)\n\n# Step 2: Load our `SqlServerDatabase` resource template.\nsql_database_resource_template = trade_sys_client.templates_client.load_template(\n    'database'\n)\n\n# Step 3: Create the `SqlServer` resource.\nif CREATE_SERVER:\n\n    # Set the username and password.\n    sql_server_resource_template['properties']['administratorLogin'] = SQL_SERVER_USERNAME\n    sql_server_resource_template['properties']['administratorLoginPassword'] = SQL_SERVER_PASSWORD\n\n    # Run the `CreateOrUpdate` operation.\n    create_server_operation = sql_mgmt_client.servers.create_or_update(\n        resource_group_name=AZURE_RESOURCE_GROUP,\n        server_name='trading-system-sql-server',\n        parameters=sql_server_resource_template\n    )\n\n# Step 4: Create the `SqlServerDatabase` resource.\nif CREATE_DATABASE:\n\n    # Run the `CreateOrUpdate` operation.\n    create_database_operation = sql_mgmt_client.databases.create_or_update(\n        resource_group_name=AZURE_RESOURCE_GROUP,\n        server_name='trading-system-sql-server',\n        database_name='trading-system',\n        parameters=sql_database_resource_template\n    )\n\n# Step 5: Set the `FirewallRules` so that other Azure Resources (Data Factory) can access this database.\nif CREATE_FIREWALL_RULE:\n\n    # Run the `CreateOrUpdate` operation.\n    create_firewall_operation = sql_mgmt_client.firewall_rules.create_or_update(\n        resource_group_name=AZURE_RESOURCE_GROUP,\n        server_name='trading-system-sql-server',\n        firewall_rule_name='AllowAllWindowsAzureIps',\n        parameters={\n            \"startIpAddress\": \"0.0.0.0\",\n            \"endIpAddress\": \"0.0.0.0\"\n        }\n    )\n```\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\nalways looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to\npay 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Ftrading-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareed1192%2Ftrading-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Ftrading-system/lists"}