{"id":13744520,"url":"https://github.com/dylanrichardson/trading-system","last_synced_at":"2025-05-09T03:32:09.757Z","repository":{"id":126741934,"uuid":"118686584","full_name":"dylanrichardson/trading-system","owner":"dylanrichardson","description":"Automatic trading system using machine learning","archived":true,"fork":false,"pushed_at":"2020-02-09T02:48:34.000Z","size":75,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T16:40:39.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/dylanrichardson.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}},"created_at":"2018-01-24T00:00:02.000Z","updated_at":"2024-06-09T17:22:45.000Z","dependencies_parsed_at":"2023-06-17T21:32:19.651Z","dependency_job_id":null,"html_url":"https://github.com/dylanrichardson/trading-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanrichardson%2Ftrading-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanrichardson%2Ftrading-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanrichardson%2Ftrading-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanrichardson%2Ftrading-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylanrichardson","download_url":"https://codeload.github.com/dylanrichardson/trading-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253183194,"owners_count":21867375,"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":[],"created_at":"2024-08-03T05:01:11.080Z","updated_at":"2025-05-09T03:32:09.457Z","avatar_url":"https://github.com/dylanrichardson.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# trading-system\n\nAutomatic trading system using machine learning\n\n## Setup\n\n### Clone\n\n```\ngit clone git@github.com:drich14/trading-system.git\n```\n\n### Secrets\n\n```\nexport alphavantage_key=\u003cAPI_KEY\u003e\nexport intrinio_username=\u003cUSERNAME\u003e\nexport intrinio_password=\u003cPASSWORD\u003e\n```\n\n### PyEnv (optional)\n\nActivate\n\n```\npyenv activate venv\n```\n\nDeactivate\n\n```\npyenv deactivate\n```\n\n### Install dependencies\n\n```\npip install -r requirements.txt\n```\n\n### Save new dependencies\n\n```\npip freeze \u003e requirements.txt\n```\n\n### Run tests\n\n```\npython tests.py\n```\n\n## Programs\n\n### graph.py\n\n```\nusage: graph.py [-h] [-s SYMBOLS [SYMBOLS ...]] [-y SCREENER]\n                [--percentages PERCENTAGES [PERCENTAGES ...]]\n                [--training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]]\n                [--training_screener TRAINING_SCREENER]\n                [--validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]]\n                [--validation_screener VALIDATION_SCREENER]\n                [--evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]]\n                [--evaluation_screener EVALUATION_SCREENER] [-l LIMIT]\n                [--start START] [--end END] -o OPTIONS [OPTIONS ...]\n                [-t TOLERANCE] [-d DAYS] [-e EPOCHS] [-n NODES] [-a {tanh}]\n                [--loss {mean_squared_error}] [-p] [-v] [--path]\n                {data,optimal,neural}\n\nLoad a graph.\n\npositional arguments:\n  {data,optimal,neural}\n                        data to graph\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]\n                        symbol(s)\n  -y SCREENER, --screener SCREENER\n                        name of Yahoo screener\n  --percentages PERCENTAGES [PERCENTAGES ...]\n                        relative size of each data part\n  --training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]\n                        symbol(s) to train with\n  --training_screener TRAINING_SCREENER\n                        name of Yahoo screener to train with\n  --validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]\n                        symbol(s) to validate with\n  --validation_screener VALIDATION_SCREENER\n                        name of Yahoo screener to validate with\n  --evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]\n                        symbol(s) to evaluate with\n  --evaluation_screener EVALUATION_SCREENER\n                        name of Yahoo screener to evaluate with\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  --start START         start date of data\n  --end END             end date of data\n  -o OPTIONS [OPTIONS ...], --options OPTIONS [OPTIONS ...]\n                        indices of data_options in params.py to use\n  -t TOLERANCE, --tolerance TOLERANCE\n                        tolerance to use in optimal trades algorithm\n  -d DAYS, --days DAYS  number of prior days of data to use as input per day\n  -e EPOCHS, --epochs EPOCHS\n                        number of epochs to train for\n  -n NODES, --nodes NODES\n                        number of nodes per layer\n  -a {tanh}, --activation {tanh}\n                        type of activation layer\n  --loss {mean_squared_error}\n                        type of loss function\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\nExample\n\n```\npython graph.py data -s AAPL -o sma --start 2018-01-01 --end 2018-02-01 -p\n```\n\n### neural.py\n\n```\nusage: neural.py [-h] [-s SYMBOLS [SYMBOLS ...]] [-y SCREENER]\n                 [--percentages PERCENTAGES [PERCENTAGES ...]]\n                 [--training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]]\n                 [--training_screener TRAINING_SCREENER]\n                 [--validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]]\n                 [--validation_screener VALIDATION_SCREENER]\n                 [--evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]]\n                 [--evaluation_screener EVALUATION_SCREENER] [-l LIMIT]\n                 [--start START] [--end END] -o OPTIONS [OPTIONS ...]\n                 [-t TOLERANCE] [-d DAYS] [-e EPOCHS] [-n NODES] [-a {tanh}]\n                 [--loss {mean_squared_error}] [-p] [-v] [--path]\n\nCreate a neural network.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]\n                        symbol(s)\n  -y SCREENER, --screener SCREENER\n                        name of Yahoo screener\n  --percentages PERCENTAGES [PERCENTAGES ...]\n                        relative size of each data part\n  --training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]\n                        symbol(s) to train with\n  --training_screener TRAINING_SCREENER\n                        name of Yahoo screener to train with\n  --validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]\n                        symbol(s) to validate with\n  --validation_screener VALIDATION_SCREENER\n                        name of Yahoo screener to validate with\n  --evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]\n                        symbol(s) to evaluate with\n  --evaluation_screener EVALUATION_SCREENER\n                        name of Yahoo screener to evaluate with\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  --start START         start date of data\n  --end END             end date of data\n  -o OPTIONS [OPTIONS ...], --options OPTIONS [OPTIONS ...]\n                        indices of data_options in params.py to use\n  -t TOLERANCE, --tolerance TOLERANCE\n                        tolerance to use in optimal trades algorithm\n  -d DAYS, --days DAYS  number of prior days of data to use as input per day\n  -e EPOCHS, --epochs EPOCHS\n                        number of epochs to train for\n  -n NODES, --nodes NODES\n                        number of nodes per layer\n  -a {tanh}, --activation {tanh}\n                        type of activation layer\n  --loss {mean_squared_error}\n                        type of loss function\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\nExample\n\n```\npython neural.py -s AAPL -o sma --start 2018-01-01 --end 2018-02-01\n```\n\n### optimal.py\n\n```\nusage: optimal.py [-h] [-s SYMBOLS [SYMBOLS ...]] [-y SCREENER] [-l LIMIT]\n                  [--start START] [--end END] [-t TOLERANCE] [-p] [-v]\n                  [--path]\n\nLoad optimal trades.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]\n                        symbol(s)\n  -y SCREENER, --screener SCREENER\n                        name of Yahoo screener\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  --start START         start date of data\n  --end END             end date of data\n  -t TOLERANCE, --tolerance TOLERANCE\n                        tolerance to use in algorithm\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\nExample\n\n```\npython optimal.py -s AAPL\n```\n\n### preprocess.py\n\nUsage\n\n```\nusage: preprocess.py [-h] [-s SYMBOLS [SYMBOLS ...]] [-y SCREENER]\n                     [--percentages PERCENTAGES [PERCENTAGES ...]]\n                     [--training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]]\n                     [--training_screener TRAINING_SCREENER]\n                     [--validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]]\n                     [--validation_screener VALIDATION_SCREENER]\n                     [--evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]]\n                     [--evaluation_screener EVALUATION_SCREENER] [-l LIMIT]\n                     [--start START] [--end END] -o OPTIONS [OPTIONS ...]\n                     [-t TOLERANCE] [-d DAYS] [-p] [-v] [--path]\n\nPreprocess neural network data.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]\n                        symbol(s)\n  -y SCREENER, --screener SCREENER\n                        name of Yahoo screener\n  --percentages PERCENTAGES [PERCENTAGES ...]\n                        relative size of each data part\n  --training_symbols TRAINING_SYMBOLS [TRAINING_SYMBOLS ...]\n                        symbol(s) to train with\n  --training_screener TRAINING_SCREENER\n                        name of Yahoo screener to train with\n  --validation_symbols VALIDATION_SYMBOLS [VALIDATION_SYMBOLS ...]\n                        symbol(s) to validate with\n  --validation_screener VALIDATION_SCREENER\n                        name of Yahoo screener to validate with\n  --evaluation_symbols EVALUATION_SYMBOLS [EVALUATION_SYMBOLS ...]\n                        symbol(s) to evaluate with\n  --evaluation_screener EVALUATION_SCREENER\n                        name of Yahoo screener to evaluate with\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  --start START         start date of data\n  --end END             end date of data\n  -o OPTIONS [OPTIONS ...], --options OPTIONS [OPTIONS ...]\n                        indices of data_options in params.py to use\n  -t TOLERANCE, --tolerance TOLERANCE\n                        tolerance to use in optimal trades algorithm\n  -d DAYS, --days DAYS  number of prior days of data to use as input per day\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\nExample\n\n```\npython preprocess.py -s AAPL -o sma --start 2018-01-01 --end 2018-02-01\n```\n\n### screener.py\n\nUsage\n\n```\nusage: screener.py [-h] [-l LIMIT] [-p] [-v] [--path] screener\n\nScreen for symbols.\n\npositional arguments:\n  screener              name of Yahoo screener\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\nExample\n\n```\npython screener.py -l 10\n```\n\n### symbol.py\n\nUsage\n\n```\nusage: symbol.py [-h] [-s SYMBOLS [SYMBOLS ...]] [-y SCREENER] [-l LIMIT]\n                 [--start START] [--end END] -o OPTIONS [OPTIONS ...] [-r]\n                 [-p] [-v] [--path]\n\nLoad symbol data.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]\n                        symbol(s)\n  -y SCREENER, --screener SCREENER\n                        name of Yahoo screener\n  -l LIMIT, --limit LIMIT\n                        take the first l symbols\n  --start START         start date of data\n  --end END             end date of data\n  -o OPTIONS [OPTIONS ...], --options OPTIONS [OPTIONS ...]\n                        indices of data_options in params.py\n  -r, --refresh         refresh the data\n  -p, --print           print the data\n  -v, --verbose         enable logging\n  --path                print the data path\n```\n\n| Indicators                                     |\n| ---------------------------------------------- |\n| daily()                                        |\n| daily_adj()                                    |\n| sma(period=30)                                 |\n| ema(period=20)                                 |\n| macd(fast=12, slow=26, signal=9)               |\n| stoch(fastk=5, slowk=3, slowd=3, kma=0, dma=0) |\n| rsi(period=14)                                 |\n| adx(period=14)                                 |\n| cci(period=14)                                 |\n| aroon(period=14)                               |\n| bbands(period=14, ndev=2, ma=0)                |\n| ad()                                           |\n| obv()                                          |\n\nExample\n\n```\npython symbol.py -s AAPL -o sma\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanrichardson%2Ftrading-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanrichardson%2Ftrading-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanrichardson%2Ftrading-system/lists"}