{"id":19537357,"url":"https://github.com/banhao/coinbasepro-trading-simulator","last_synced_at":"2025-09-25T09:50:08.559Z","repository":{"id":164594448,"uuid":"329800703","full_name":"banhao/CoinBasePro-Trading-Simulator","owner":"banhao","description":"You can define your own trade conditions and by running CoinBasePro Trading Simulator to verify the conditions.","archived":false,"fork":false,"pushed_at":"2024-01-26T15:04:06.000Z","size":1351,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T14:43:54.886Z","etag":null,"topics":["coinbase-pro","coinbasepro-api","cryptocurrency","cryptocurrency-trading-simulator","matplotlib","mplfinance","plot","python3","regress-history-days","simulate-history-days","trading-algorithms","trading-condition","trading-simulator","trading-strategies"],"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/banhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-01-15T03:39:55.000Z","updated_at":"2024-12-03T14:50:35.000Z","dependencies_parsed_at":"2024-01-26T16:25:50.279Z","dependency_job_id":"1167ed64-4f26-42c4-9c49-17c9aea3c830","html_url":"https://github.com/banhao/CoinBasePro-Trading-Simulator","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/banhao%2FCoinBasePro-Trading-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banhao%2FCoinBasePro-Trading-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banhao%2FCoinBasePro-Trading-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banhao%2FCoinBasePro-Trading-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banhao","download_url":"https://codeload.github.com/banhao/CoinBasePro-Trading-Simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251002095,"owners_count":21521108,"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":["coinbase-pro","coinbasepro-api","cryptocurrency","cryptocurrency-trading-simulator","matplotlib","mplfinance","plot","python3","regress-history-days","simulate-history-days","trading-algorithms","trading-condition","trading-simulator","trading-strategies"],"created_at":"2024-11-11T02:27:31.510Z","updated_at":"2025-09-25T09:50:03.516Z","avatar_url":"https://github.com/banhao.png","language":"Python","funding_links":["https://www.buymeacoffee.com/haoban","https://paypal.me/HAOBAN99?locale.x=en_US"],"categories":[],"sub_categories":[],"readme":"# **WARNING! This software will not be maintained any more. So please be very careful if you want to use it on CoinBase or CoinBase Pro.**\n=========================================================================\n\u003c!--\n# CryptoCurrency Trading Simulator\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n\ncryptocurrency_trading_simulator.py is used to simulate the cryptocurrency trading indicators.\n\nCurrently it support 'MACD','RSI','ARRON','SMA','EMA','WMA','BOLLINGER','CCI' indicators.\n\nYou need have CoinBase Pro API first, but if you have the other data soruce I think it also can support. If you have more data source please share it with me.\n\nBecause I'm not a expert of stock trading so I'm not familiar with these indicators. And you also can define your own trading condition and use this tool to simulate.\n\n\nHere I'll give you an example and explain it.\n\nThe first plot will show you the max/min price by blue down/up arrow in the predefined period. And also use red/green arrows to show you all matched opportunities that predefine in parameter \"profit_rate\", here it's 10%.\n\nAnd the tool will also output the data of the match point.\n\n\u003cimg src=\"/screenshot/screenshot_01.jpg\"\u003e\n\n```\nREN-BTC\n                         High          MACD     MACD_DIFF   MACD_SIGNAL      RSI7      RSI14  ARRON_DOWN  ARRON_UP      ARRON  BOLLINGER_HBAND  \\\nDate\n2021-01-15 03:15:00  0.000015  2.785402e-07  1.147812e-07  1.637591e-07  87.63128  77.310638   21.428571     100.0  78.571429         0.000013\n\n                     BOLLINGER_HBAND_INDICATOR  BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND\nDate\n2021-01-15 03:15:00                        1.0         0.000011                        0.0        0.000012         1.461119        10.885924\n                         Low          MACD     MACD_DIFF   MACD_SIGNAL       RSI7      RSI14  ARRON_DOWN   ARRON_UP      ARRON  BOLLINGER_HBAND  \\\nDate\n2021-01-13 21:45:00  0.00001 -9.675435e-08 -8.245229e-08 -1.430206e-08  14.151404  28.135547       100.0  28.571429 -71.428571         0.000012\n\n                     BOLLINGER_HBAND_INDICATOR  BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND\nDate\n2021-01-13 21:45:00                        0.0         0.000011                        0.0        0.000011         0.115376        11.892132\n------------------------------------------------------------------------------------------------------\nMatch profit_rate Buy Opportunity 4\nMatch profit_rate Sell Opportunity 4\n                          Low      High      Open     Close  Volume          MACD     MACD_DIFF   MACD_SIGNAL       RSI7      RSI14  ARRON_DOWN  \\\nDate\n2021-01-12 04:30:00  0.000011  0.000011  0.000011  0.000011   21921           NaN           NaN           NaN        NaN        NaN         NaN\n2021-01-12 14:00:00  0.000010  0.000011  0.000011  0.000010    5815 -4.599820e-08 -3.391777e-09 -4.260643e-08  26.343895  36.467209       100.0\n2021-01-13 22:45:00  0.000011  0.000011  0.000011  0.000011   23689 -1.778982e-07 -8.113621e-08 -9.676197e-08  21.542520  30.235613       100.0\n2021-01-14 21:00:00  0.000012  0.000012  0.000012  0.000012   35545 -5.476099e-08 -3.931264e-08 -1.544835e-08  27.923919  37.738088       100.0\n\n                      ARRON_UP      ARRON      SMA5     SMA10     SMA60       EMA       WMA  BOLLINGER_HBAND  BOLLINGER_HBAND_INDICATOR  \\\nDate\n2021-01-12 04:30:00        NaN        NaN       NaN       NaN       NaN       NaN       NaN              NaN                        0.0\n2021-01-12 14:00:00  50.000000 -50.000000  0.000011  0.000011       NaN  0.000011  0.000011              NaN                        0.0\n2021-01-13 22:45:00  21.428571 -78.571429  0.000011  0.000011  0.000011  0.000011  0.000011         0.000012                        0.0\n2021-01-14 21:00:00   7.142857 -92.857143  0.000012  0.000012  0.000012  0.000012  0.000012         0.000012                        0.0\n\n                     BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND        CCI  Min_signal_Price  \\\nDate\n2021-01-12 04:30:00              NaN                        0.0             NaN              NaN              NaN        NaN               NaN\n2021-01-12 14:00:00              NaN                        0.0             NaN              NaN              NaN        NaN               NaN\n2021-01-13 22:45:00         0.000011                        0.0        0.000012         0.037007        11.197577 -26.077075               NaN\n2021-01-14 21:00:00         0.000011                        0.0        0.000012         0.124860         8.305822   9.335825               NaN\n\n                     Max_Signal_price  Buy_signal_Price  Sell_Signal_price\nDate\n2021-01-12 04:30:00               NaN          0.000011                NaN\n2021-01-12 14:00:00               NaN          0.000010                NaN\n2021-01-13 22:45:00               NaN          0.000011                NaN\n2021-01-14 21:00:00               NaN          0.000012                NaN\n                          Low      High      Open     Close  Volume          MACD     MACD_DIFF   MACD_SIGNAL       RSI7      RSI14  ARRON_DOWN  \\\nDate\n2021-01-12 05:15:00  0.000011  0.000012  0.000011  0.000012   22024           NaN           NaN           NaN  95.310707        NaN         NaN\n2021-01-13 14:00:00  0.000012  0.000012  0.000012  0.000012   22977  1.619489e-07  2.815063e-08  1.337982e-07  79.580668  71.743623   28.571429\n2021-01-14 11:15:00  0.000012  0.000012  0.000012  0.000012   32035  8.064031e-08  3.320452e-08  4.743579e-08  82.881182  69.146365   57.142857\n2021-01-15 02:45:00  0.000013  0.000013  0.000013  0.000013   45110  1.951036e-07  8.218269e-08  1.129209e-07  80.029781  70.672121   35.714286\n\n                     ARRON_UP      ARRON      SMA5     SMA10     SMA60       EMA       WMA  BOLLINGER_HBAND  BOLLINGER_HBAND_INDICATOR  \\\nDate\n2021-01-12 05:15:00       NaN        NaN  0.000011       NaN       NaN       NaN       NaN              NaN                        0.0\n2021-01-13 14:00:00     100.0  71.428571  0.000011  0.000011  0.000011  0.000011  0.000011         0.000011                        1.0\n2021-01-14 11:15:00     100.0  42.857143  0.000012  0.000012  0.000011  0.000012  0.000012         0.000012                        1.0\n2021-01-15 02:45:00     100.0  64.285714  0.000013  0.000012  0.000012  0.000012  0.000012         0.000013                        1.0\n\n                     BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND         CCI  Min_signal_Price  \\\nDate\n2021-01-12 05:15:00              NaN                        0.0             NaN              NaN              NaN         NaN               NaN\n2021-01-13 14:00:00         0.000010                        0.0        0.000011         1.151103         9.741565         NaN               NaN\n2021-01-14 11:15:00         0.000011                        0.0        0.000011         1.120887         8.622493  130.782797               NaN\n2021-01-15 02:45:00         0.000012                        0.0        0.000012         1.313614         8.495411  222.129176               NaN\n\n                     Max_Signal_price  Buy_signal_Price  Sell_Signal_price\nDate\n2021-01-12 05:15:00               NaN               NaN           0.000012\n2021-01-13 14:00:00               NaN               NaN           0.000012\n2021-01-14 11:15:00               NaN               NaN           0.000012\n2021-01-15 02:45:00               NaN               NaN           0.000013\n------------------------------------------------------------------------------------------------------\n279\nSimulation Buy Opportunity 1\nSimulation Sell Opportunity 1\n                          Low      High      Open     Close  Volume          MACD     MACD_DIFF   MACD_SIGNAL       RSI7     RSI14  ARRON_DOWN  \\\nDate\n2021-01-14 21:15:00  0.000012  0.000012  0.000012  0.000012    5212 -6.494159e-08 -3.909805e-08 -2.584354e-08  34.739297  39.24143   92.857143\n\n                      ARRON_UP      ARRON      SMA5     SMA10     SMA60       EMA       WMA  BOLLINGER_HBAND  BOLLINGER_HBAND_INDICATOR  \\\nDate\n2021-01-14 21:15:00  57.142857 -35.714286  0.000012  0.000012  0.000012  0.000012  0.000012         0.000012                        0.0\n\n                     BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND         CCI  Buy_signal_Price  \\\nDate\n2021-01-14 21:15:00         0.000012                        1.0        0.000012        -0.075968         4.664584 -134.755855          0.000012\n\n                     Sell_Signal_price\nDate\n2021-01-14 21:15:00                NaN\n                          Low      High      Open     Close  Volume          MACD     MACD_DIFF   MACD_SIGNAL       RSI7      RSI14  ARRON_DOWN  \\\nDate\n2021-01-15 02:55:00  0.000013  0.000013  0.000013  0.000013   13875  1.717742e-07  3.410695e-08  1.376673e-07  82.091588  73.814921    7.142857\n\n                     ARRON_UP      ARRON      SMA5     SMA10     SMA60       EMA       WMA  BOLLINGER_HBAND  BOLLINGER_HBAND_INDICATOR  \\\nDate\n2021-01-15 02:55:00     100.0  92.857143  0.000013  0.000013  0.000012  0.000013  0.000013         0.000013                        1.0\n\n                     BOLLINGER_LBAND  BOLLINGER_LBAND_INDICATOR  BOLLINGER_MAVG  BOLLINGER_PBAND  BOLLINGER_WBAND         CCI  Buy_signal_Price  \\\nDate\n2021-01-15 02:55:00         0.000012                        0.0        0.000012         1.185002         8.805261  295.221026               NaN\n\n                     Sell_Signal_price\nDate\n2021-01-15 02:55:00           0.000013\n```\n\nThe second plot will give you all the match point that you defined condition in the tool. \n\nFor example, my buy condition is if the candle is lower than 'BOLLINGER_LBAND' and 'CCI' is less than -100. \n\nMy sell condition is if the candle is higher than 'BOLLINGER_HBAND' and 'CCI' is more than 100 and the profit is more than 10%.    \n\n\u003cimg src=\"/screenshot/screenshot_02.jpg\"\u003e\n\n\u003cb\u003eNote: You can use the different period days and granularity for the first plot and second plot, but remember the number of the data return from API mush be less than 300. Here the first plot \"regress_history_days = 3\" and \"regress_history_days_granularity = 900\", the second plot \"simulate_history_days = 1\" and \"simulate_history_days_granularity = 300\".\u003c/b\u003e\n\nvariable.py is used to load paraments/variables and I also remained some paraments/variables for automatice trading tools to share one variable file (Automatic trading tool is still in testing)\n\n## variable.py\n```\n\n#Initial Parameters\nimport ctypes\nimport os\napi_key = ''\nsecret_key = ''\npassphrase = ''\nif os.name == 'nt':\n    screen_width = ctypes.windll.user32.GetSystemMetrics(0)\n    screen_height = ctypes.windll.user32.GetSystemMetrics(1)\nLong_Term_Indicator_days = 300\nLong_Term_Indicator_days_granularity = 86400 #{60, 300, 900, 3600, 21600, 86400}\nShort_Term_Indicator_days = 1\nShort_Term_Indicator_days_granularity = 300 #{60, 300, 900, 3600, 21600, 86400}\nseconds_UTC2local = -25200\nprofit_rate = 1.10\nseconds_cancel_order = 60\nBTC_lower_limit = 100\nUSDC_lower_limit = 100\nfirst_buy_percent = 0.10\nsecond_buy_percent = 0.20\nthird_buy_percent = 0.30\nexclude_currency = [\"XRP-BTC\",\"DAI-USDC\",\"WBTC-BTC\"] # \"exclude_currency\" and \"include_currency\" only one can have items or both empty\ninclude_currency = [] # \"exclude_currency\" and \"include_currency\" only one can have items or both empty\noutput_data_file = 'output_data.txt'\nclose_plot_second = 0 # \"0\" will not show the plot, just use for generate data\norder_start_date = '2021-02-01'\n\n```\n\n\u003cb\u003e\nNext version I'd like to have a configure file that can define different buy and sell condition for each crypto currency.\n\nIf you have any idea want to add in the tools you can send me an email and let me know.\n\u003c/b\u003e\n\n## Support the Project\nIf this program helped you to earn money from cryptocurrency market, I'll be appreciate if you can use the following link to buy me a cup of coffee, Thanks! \n\n\u003ca href=\"https://www.buymeacoffee.com/haoban\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n[PayPal.Me](https://paypal.me/HAOBAN99?locale.x=en_US)\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanhao%2Fcoinbasepro-trading-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanhao%2Fcoinbasepro-trading-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanhao%2Fcoinbasepro-trading-simulator/lists"}