{"id":23354190,"url":"https://github.com/leo-aa88/BTC-backtesting","last_synced_at":"2025-10-28T22:31:06.421Z","repository":{"id":53269875,"uuid":"416122763","full_name":"araujo88/BTC-backtesting","owner":"araujo88","description":"Bitcoin trading strategy backtesting","archived":false,"fork":false,"pushed_at":"2021-10-30T04:10:43.000Z","size":1032,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-21T09:19:50.663Z","etag":null,"topics":["backtesting-trading-strategies","binance-api","bitcoin","bitcoin-trade","bitcoin-trading","ta-lib","trading-algorithms","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/araujo88.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}},"created_at":"2021-10-12T00:03:07.000Z","updated_at":"2024-09-14T05:48:25.000Z","dependencies_parsed_at":"2022-08-27T07:01:34.045Z","dependency_job_id":null,"html_url":"https://github.com/araujo88/BTC-backtesting","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/araujo88%2FBTC-backtesting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2FBTC-backtesting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2FBTC-backtesting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2FBTC-backtesting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/araujo88","download_url":"https://codeload.github.com/araujo88/BTC-backtesting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238734075,"owners_count":19521557,"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":["backtesting-trading-strategies","binance-api","bitcoin","bitcoin-trade","bitcoin-trading","ta-lib","trading-algorithms","trading-strategies"],"created_at":"2024-12-21T09:19:18.366Z","updated_at":"2025-10-28T22:31:05.984Z","avatar_url":"https://github.com/araujo88.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BTC-backtesting\n Bitcoin trading strategy backtesting on Python using libraries TA-Lib, Pandas, Binance API and Backtesting.\n \n On the example implemented, a simple EMA (Exponential Moving Average) crossing trading strategy is tested and its parameters (time interval of each EMA) are optimized. The data utilized was the BTC/USDT 1h candle closing price (1 year interval). The backtesting starts with intervals of 5 periods and 8 periods for the low and fast EMA respectively and, after optimization, 17 and 19 for each one.\n \n Here is the output BEFORE optimization:\n \n ![Alt text](before_optimization.png?raw=true \"\")\n \n Here is the output AFTER  optimization:\n \n  ![Alt text](after_optimization.png?raw=true \"\")\n\nAs observed, the final result changed from 41% (loss) to 164% (profit).\n\nInstallation instructions:\n - First, it is necessary to register at www.binance.com for API key generation\n - Next, install requirements.txt with ``` pip install -r requirements.txt ```\n\nUse instructions:\n - The cryptocurrency, candle interval and time interval can be modified at the desired backtesting .py file. As default, the pair is set to BTC/USDT, the candle interval to 1h and time interval to 365 days from the present day.\n\nLearn more about Backtesting.py: https://kernc.github.io/backtesting.py/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-aa88%2FBTC-backtesting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleo-aa88%2FBTC-backtesting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-aa88%2FBTC-backtesting/lists"}