Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/araujo88/btc-backtesting
Bitcoin trading strategy backtesting
https://github.com/araujo88/btc-backtesting
backtesting-trading-strategies binance-api bitcoin bitcoin-trade bitcoin-trading ta-lib trading-algorithms trading-strategies
Last synced: 13 days ago
JSON representation
Bitcoin trading strategy backtesting
- Host: GitHub
- URL: https://github.com/araujo88/btc-backtesting
- Owner: araujo88
- Created: 2021-10-12T00:03:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-30T04:10:43.000Z (about 3 years ago)
- Last Synced: 2023-03-08T04:35:35.185Z (almost 2 years ago)
- Topics: backtesting-trading-strategies, binance-api, bitcoin, bitcoin-trade, bitcoin-trading, ta-lib, trading-algorithms, trading-strategies
- Language: Python
- Homepage:
- Size: 1010 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BTC-backtesting
Bitcoin trading strategy backtesting on Python using libraries TA-Lib, Pandas, Binance API and Backtesting.
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.
Here is the output BEFORE optimization:
![Alt text](before_optimization.png?raw=true "")
Here is the output AFTER optimization:
![Alt text](after_optimization.png?raw=true "")As observed, the final result changed from 41% (loss) to 164% (profit).
Installation instructions:
- First, it is necessary to register at www.binance.com for API key generation
- Next, install requirements.txt with ``` pip install -r requirements.txt ```Use instructions:
- 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.Learn more about Backtesting.py: https://kernc.github.io/backtesting.py/