{"id":13504347,"url":"https://github.com/Draichi/T-1000","last_synced_at":"2025-03-29T21:30:32.674Z","repository":{"id":56198674,"uuid":"140492149","full_name":"Draichi/T-1000","owner":"Draichi","description":":zap: :zap: 𝘋𝘦𝘦𝘱 𝘙𝘓 𝘈𝘭𝘨𝘰𝘵𝘳𝘢𝘥𝘪𝘯𝘨 𝘸𝘪𝘵𝘩 𝘙𝘢𝘺 𝘈𝘗𝘐","archived":false,"fork":false,"pushed_at":"2023-11-09T16:42:43.000Z","size":22792,"stargazers_count":172,"open_issues_count":1,"forks_count":43,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-11T08:01:41.071Z","etag":null,"topics":["algotrading","bot","ray","reinforcement-learning-bot","rl","rllib","trading","trading-bot"],"latest_commit_sha":null,"homepage":"https://ray.readthedocs.io/en/latest/index.html","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/Draichi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://etherscan.io/address/0x60215911b9cdcc25834efa09026d05a7a95a8e42"]}},"created_at":"2018-07-10T22:09:37.000Z","updated_at":"2024-08-11T08:01:41.072Z","dependencies_parsed_at":"2023-11-09T17:48:49.369Z","dependency_job_id":null,"html_url":"https://github.com/Draichi/T-1000","commit_stats":null,"previous_names":["draichi/cryptocurrency_prediction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Draichi%2FT-1000","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Draichi%2FT-1000/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Draichi%2FT-1000/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Draichi%2FT-1000/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Draichi","download_url":"https://codeload.github.com/Draichi/T-1000/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246249110,"owners_count":20747164,"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":["algotrading","bot","ray","reinforcement-learning-bot","rl","rllib","trading","trading-bot"],"created_at":"2024-08-01T00:00:32.772Z","updated_at":"2025-03-29T21:30:31.887Z","avatar_url":"https://github.com/Draichi.png","language":"Python","funding_links":["https://etherscan.io/address/0x60215911b9cdcc25834efa09026d05a7a95a8e42"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# T-1000 Advanced Prototype\n\n![ubuntu](https://img.shields.io/badge/ubuntu-supported-000.svg?colorA=00cc25\u0026longCache=true\u0026style=for-the-badge \"ubuntu\")\n\n![ubuntu](https://img.shields.io/badge/tested_on-ubuntu-000.svg?colorA=00cc25\u0026longCache=true\u0026style=for-the-badge \"ubuntu\")\n\n![OS](https://img.shields.io/badge/OS-unkown-000.svg?colorA=\u0026longCache=true\u0026style=for-the-badge \"OS\")\n\n![windows](https://img.shields.io/badge/windows-not_supported-000.svg?colorA=d11431\u0026longCache=true\u0026style=for-the-badge \"windows\")\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ebdf89dcba744a3c8aafdda210d3aeb6)](https://app.codacy.com/app/Draichi/cryptocurrency_prediction?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=Draichi/cryptocurrency_prediction\u0026utm_campaign=Badge_Grade_Dashboard)\n\n![gif](assets/t-1000.gif)\n\nDeep reinforcement learning multi-agent algorithmic trading framework that learns to trade from experience and then evaluate with brand new data\n\n\n* * *\n\n## Prerequisites\n\n-   [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html) or Anaconda\n\nAn API Key on [CryptoCompare](https://min-api.cryptocompare.com/)\n\n* * *\n\n## Setup\n\n### Ubuntu\n\n```sh\n# paste your API Key on .env\ncp .env.example .env\n# make sure you have these installed\nsudo apt-get install gcc g++ build-essential python-dev python3-dev -y\n# create env\nconda env create -f t-1000.yml\n# activate it\nconda activate t-1000\n```\n\n* * *\n\n## Usage\n\n### On command line\n\n```sh\n# to see all arguments available\n# $ python main.py --help\n\n# to train\npython main.py -a btc eth bnb -c usd\n\n# to test\npython main.py /\n    --checkpoint_path results/t-1000/model-hash/checkpoint_750/checkpoint-750\n```\n\n### On your own file\n\n```py\n# instatiate the environment\nT_1000 = CreateEnv(assets=['OMG','BTC','ETH'],\n                  currency='USDT',\n                  granularity='day',\n                  datapoints=600)\n\n# define the hyperparams to train\nT_1000.train(timesteps=5e4,\n              checkpoint_freq=10,\n              lr_schedule=[\n                  [\n                      [0, 7e-5],  # [timestep, lr]\n                      [100, 7e-6],\n                  ],\n                  [\n                      [0, 6e-5],\n                      [100, 6e-6],\n                  ]\n              ],\n              algo='PPO')\n\n```\n\nOnce you have a sattisfatory reward_mean benchmark you can see how it performs with never seen data\n\n```py\n# same environment\nT_1000 = CreateEnv(assets=['OMG','BTC','ETH'],\n                  currency='USDT',\n                  granularity='day',\n                  datapoints=600)\n\n# checkpoint are saved in /results\n# it will automatically use a different time period from trainnig to backtest\nT_1000.backtest(checkpoint_path='path/to/checkpoint_file/checkpoint-400')\n```\n\n* * *\n\n## Features\n\u003cimg src=\"assets/t-1000.png\" align=\"right\"\n     title=\"T-1000 from terminator\" width=\"100\"\u003e\n\n-   state of the art [agents](https://ray.readthedocs.io/en/latest/rllib-algorithms.html)\n-   hyperparam grid search\n-   multi agent parallelization\n-   learning rate schedule\n-   result [analysis](https://ray.readthedocs.io/en/latest/tune-package-ref.html#ray.tune.Analysis)\n\n\u003e \"It just needs to touch something to mimic it.\" - [Sarah Connor, about the T-1000](https://terminator.fandom.com/wiki/T-1000)\n\n* * *\n\n## Monitoring\n\nSome nice tools to keep an eye while your agent train are (of course) `tensorboard`, `gpustat` and `htop`\n\n```sh\n# from the project home folder\n$ tensorboard --logdir=models\n\n# show how your gpu is going\n$ gpustat -i\n\n# show how your cpu and ram are going\n$ htop\n```\n* * *\n\n## Credits\n\n-   [Papers](https://github.com/Draichi/Portfolio-Management-list/blob/master/README.md)\n-   [Analyzing cryptocurrency markets using python](https://blog.patricktriest.com/analyzing-cryptocurrencies-python/)\n-   [Q-trader](https://github.com/edwardhdlu/q-trader)\n-   [Trading-Gym](https://github.com/thedimlebowski/Trading-Gym)\n-   [Tensor Trade](https://github.com/notadamking/tensortrade)\n\n* * *\n\n## To do\n\n-   [ ] Bind the agent's output with an exchange place order API\n\n\u003cdiv style=\"text-align:center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/fork_it,_fix_it-open_pull_request-101947.svg?colorA=104047\u0026longCache=true\u0026style=for-the-badge\"/\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDraichi%2FT-1000","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDraichi%2FT-1000","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDraichi%2FT-1000/lists"}