Add first free strategies

This commit is contained in:
Gerald Lonlas
2018-01-21 00:34:31 -08:00
commit 1ee6c3debe
134 changed files with 1523 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
*For requestion a new strategy. Please use the template below.*
*Any strategy request that does not follow the template will be closed.*
## Step 1: What indicators are required?
*Please list all the indicators required for the buy and sell strategy.*
## Step 2: Explain the Buy Strategy
*Please explain in details the indicators you need to run the buy strategy, then
explain in detail what is the trigger to buy.*
## Step 1: Explain the Sell Strategy
*Please explain in details the indicators you need to run the sell strategy, then
explain in detail what is the trigger to sell.*
## Source
What come from this strategy? Cite your source:
* http://
+79
View File
@@ -0,0 +1,79 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
.env
.venv
.idea
.vscode
+207
View File
@@ -0,0 +1,207 @@
# Freqtrade strategies
This Git repo contains free buy/sell strategies for [Freqtrade](https://github.com/gcarq/freqtrade) >= `0.16.0`.
## Disclaimer
These strategies are for educational purposes only. Do not risk money
which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE
AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING
RESULTS.
Always start by testing strategies with a backtesting then run the
trading bot in Dry-run. Do not engage money before you understand how
it works and what profit/loss you should expect.
I strongly recommend you to have coding and Python knowledge. Do not
hesitate to read the source code and understand the mechanism of this
bot.
## Table of Content
- [Free trading strategies](#free-trading-strategies)
- [Contributes](#Contributes)
- [FAQ](#faq)
- [What is Freqtrade?](#what-is-freqtrade)
- [What includes these strategies?](#what-includes-these-strategies)
- [How were tested the strategies?](#how-were-tested-the-strategies)
- [How to install a strategy?](#how-to-install-a-strategy)
- [How to test a strategy?](#how-to-test-a-strategy)
- [Which coins were tested?](#which-coins-were-tested)
- [Can I have your configuration file?](#can-i-have-your-configuration-file)
- [Can I have your dataset?](#can-i-have-your-dataset)
- [How did you build dataset?](#how-did-you-build-dataset)
- [How to create/optimize a strategy?](https://github.com/gcarq/freqtrade/blob/develop/docs/bot-optimization.md)
- [Offer me a coffee](#offer-me-a-coffee)
## Free trading strategies
Value below are result from backtesting from 2017-12-19 to 2017-01-20 and
`experimental.sell_profit_only` enabled. More detail on each strategy
page.
| Strategy | Buy count | AVG profit % | Total profit | AVG duration |
|-----------|-----------|--------------|--------------|--------------|
| [Strategy 001](https://github.com/glonlas/freqtrade-strategies/issues/1) | 287 | 2.39 | 0.02763202 | 1306.3 |
| [Strategy 002](https://github.com/glonlas/freqtrade-strategies/issues/2) | 158 | 2.67 | 0.01686667 | 387.9 |
| [Strategy 003](https://github.com/glonlas/freqtrade-strategies/issues/3) | 147 | 2.21 | 0.01277113 | 694.9 |
| [Strategy 004](https://github.com/glonlas/freqtrade-strategies/issues/4) | 232 | 2.11 | 0.01977185 | 455.3 |
Strategies from this repo are free to use and feel free to update them.
Most of them were designed from Hyperopt calculations.
## Contributes
Feel free to send your comments, optimizations and requests via an
[Issue ticket](https://github.com/glonlas/freqtrade-strategies/issues/new).
### Strategy requests
Are you looking to implement a new strategy, or one found on atrading
Forum/Chan?
You can request it via
[Issue ticket](https://github.com/glonlas/freqtrade-strategies/issues/new).
Please follow the template questions. Request that does not follow the
template will be removed. I cannot promise to implement all of them,
but will do my best to help.
## FAQ
### What is Freqtrade?
[Freqtrade](https://github.com/gcarq/freqtrade) is a Simple High
frequency trading bot for crypto currencies designed to support multi
exchanges and be controlled via Telegram built by [gcarq@](https://github.com/gcarq).
This bot is similar other trading bot like
[Gekko](https://github.com/askmike/gekko), and
[Zenbot](https://github.com/DeviaVir/zenbot)
### What includes these strategies?
Each Strategies includes:
- [x] **Minimal ROI**: Minimal ROI optimized for the strategy.
- [x] **Stoploss**: Optimimal stoploss calculated based on hyperopt result.
- [x] **Buy Strategy**: Result from Hyperopt or based on exisiting trading strategies.
- [x] **Sell Strategy**
- [x] **Indicators**: Includes the indicators required to run the strategy.
- [x] **Hyperopt configuration:** To tune the strategy parameters.
- [x] **Backtesting results**
### How were tested the strategies?
All strategies are tested with the dataset from this repo. The data set
is located into [user_data/data](https://github.com/glonlas/freqtrade-strategies/tree/master/user_data/data) folder.
For each strategies, I run backtests for 2 Period and 2 parameters:
`experimental.sell_profit_only` enabled and
`experimental.sell_profit_only` disabled
#### Period 1: From 2017-11-19 to 2017-12-20
1. `experimental.sell_profit_only` at `true` (Config file [user_data/config-profit-on.json](https://github.com/glonlas/freqtrade-strategies/blob/master/user_data/config-profit-on.json)).
2. `experimental.sell_profit_only` at `false` (Config file [user_data/config-profit-off.json](https://github.com/glonlas/freqtrade-strategies/blob/master/user_data/config-profit-off.json)).
#### Period 2: From 2017-12-19 to 2017-01-20
1. `experimental.sell_profit_only` at `true` (Config file [user_data/config-profit-on.json](https://github.com/glonlas/freqtrade-strategies/blob/master/user_data/config-profit-on.json)).
2. `experimental.sell_profit_only` at `false` (Config file [user_data/config-profit-off.json](https://github.com/glonlas/freqtrade-strategies/blob/master/user_data/config-profit-off.json)).
### How to install a strategy?
First you need a [working Freqtrade](https://github.com/gcarq/freqtrade/blob/feature/custom_strategy/docs/index.md)
in version >= 0.16.0.
**Note:** This version is not merged yet but you can find into the branch `feature/custom_strategy`.
```bash
git clone https://github.com/gcarq/freqtrade.git
git checkout feature/custom_strategy
```
Once you have the bot on the right version, follow this steps:
1. Select the strategy you want. All strategies of the repo are into
(user_data/strategies](https://github.com/glonlas/freqtrade-strategies/tree/feature/custom_strategy/user_data/strategies)
2. Copy the strategy file
3. Paste it into your `user_data/strategies` folder
4. Run the bot with the parameter `-s <STRATEGY_FILE_NAME_WITHOUT_.py>` (ex: `python3 ./freqtrade/main.py -s strategy001`)
### How to test a strategy?
Let assume you have selected the strategy `strategy-001.py`:
**Simple backtesting**
```bash
python3 ./freqtrade/main.py -s stragegy-001 backtesting --realistic-simulation
```
**Refresh your test data**
```bash
python3 ./freqtrade/main.py -s stragegy-001 backtesting --realistic-simulation -r
```
**Test with live data**
```bash
python3 ./freqtrade/main.py -s stragegy-001 backtesting --realistic-simulation -l
```
### Which coins were tested?
You will find the list of coin tested into the configuration files
(`user_data/config-profit-on.json` and
`user_data/config-profit-off.json`)
| Pair | Tested |
|-------|--------|
| BTC_ADA | Yes
| BTC_NEO | Yes |
| BTC_NXT | Yes |
| BTC_MCO | Yes |
| BTC_ETH | Yes |
| BTC_BCC | Yes |
| BTC_VOX | Yes |
| BTC_GUP | Yes |
| BTC_SC | Yes |
| BTC_VTC | Yes |
| BTC_STRAT | Yes |
| BTC_OMG | Yes |
| BTC_OK | Yes |
| BTC_EDG | Yes |
| BTC_STORJ | Yes |
| BTC_EMC2 | Yes |
| BTC_XLM | Yes |
| BTC_LSK | Yes |
| BTC_SYS | Yes |
| BTC_POWR | Yes |
| BTC_PAY | Yes |
| BTC_DGB | Yes |
| BTC_ETC | Yes |
| BTC_XRP | Yes |
| BTC_LTC | Yes |
| BTC_IOP | Yes |
| BTC_RCN | Yes |
| BTC_BTG | Yes |
| BTC_MONA | Yes |
| BTC_SALT | Yes |
| BTC_DASH | Yes |
| BTC_QTUM | Yes |
| BTC_CVC | Yes |
| BTC_KMD | Yes |
| BTC_XEM | Yes |
| BTC_XMR | Yes |
| BTC_ZEC | Yes |
| BTC_WAVES | Yes |
| BTC_PIVX | Yes |
| BTC_XZC | Yes |
| BTC_DOGE | No, this pair is blacklisted |
## Can I have your configuration file?
You will find them into [user_data/](https://github.com/glonlas/freqtrade-strategies/tree/master/user_data) folder.
## Can I have your datasets?
Yes of course! Datasets are into
[user_data/data](https://github.com/glonlas/freqtrade-strategies/tree/master/user_data/data)
folder. Download and use them.
## How did you build dataset?
I am using data collected from Bittrex and run the script
`scripts/extract_data.py`
```bash
python3 scripts/extract_data.py -f user_data/data/complete_data -d user_data/data/2017-11-19_2017-12-19 -s 2017-11-19 -e 2017-12-20
python3 scripts/extract_data.py -f user_data/data/complete_data -d user_data/data/2017-12-19_2018-01-19 -s 2017-12-19 -e 2018-01-20
```
# Offer me a coffee
This repo is made for you to improve your trading strategies. If you are
happy with the result of your strategy, feel free to offer me a coffee :)
- BTC: 1KouEQdEKGiFGvm9iCb5K9pkUqnsASqmGS
- ETH: 0x767D8AfB3B31131cBbf5b7318D2046996c9a40f2
- LTC: LXFPwMs38DMj6ecD4xWEPnWjNAjp78uNZM
+121
View File
@@ -0,0 +1,121 @@
#!/usr/bin/env python3
"""
Extract a period from dataset
author@: Gerald Lonlas
github@: https://github.com/glonlas/freqtrade-strategies
"""
import logging
import argparse
import sys
import json
import os
from datetime import datetime
logger = logging.getLogger('Bittrex_Extractor')
def list_files(directory, extension):
return [f for f in os.listdir(directory) if f.endswith('.' + extension)]
def arg_valid_date(arg):
try:
return datetime.strptime(arg, "%Y-%m-%d")
except ValueError:
msg = "Not a valid date: '{0}'.".format(arg)
raise argparse.ArgumentTypeError(msg)
def parse_args(args):
parser = argparse.ArgumentParser(
description="Bittrex ticker extractor. Extract data period from Bittrex ticker file"
)
parser.add_argument(
'-v', '--verbose',
help='Switch the script to logger DEBUG',
action='store_const',
dest='loglevel',
const=logging.DEBUG,
default=logging.INFO,
)
parser.add_argument(
'-f', '--folder',
help='Source Folder that contains the JSON files',
dest='source',
default=os.path.join('user_data', 'data'),
type = str,
metavar = 'PATH',
)
parser.add_argument(
'-d', '--destination',
help='Destination folder where to store the new files',
dest='destination',
required=True,
type=str,
metavar='PATH',
)
parser.add_argument(
'-s', '--start',
help='Start date. Format YYYY-MM-DD',
dest='start',
required = True,
type=arg_valid_date
)
parser.add_argument(
'-e', '--e',
help='End date Format YYYY-MM-DD',
dest='end',
required=True,
type=arg_valid_date
)
return parser.parse_args(args)
def init_logger(loglevel):
logging.basicConfig(
level=loglevel,
format='%(asctime)s - %(message)s',
)
def main(args):
logger.info('Start Bittrex ticker extractor')
logger.info('------------------------------')
logger.info('source: %s' % args.source)
logger.info('Destination: %s' % args.destination)
logger.info('From: %s to: %s' % (args.start, args.end))
source = args.source
destination = args.destination
files = list_files(source, 'json')
start = args.start
end = args.end
for file in files:
with open(os.path.join(source, file)) as json_file:
logger.info('Opening: %s' % os.path.join(source, file))
tickers = json.load(json_file)
logger.info('Parsing tickers')
new_data = []
for ticker in tickers:
date = datetime.strptime(ticker['T'], "%Y-%m-%dT%H:%M:%S")
if start <= date < end:
new_data.append(ticker)
dest_file = os.path.join(destination, file)
with open(dest_file, 'w') as outfile:
logger.info('Writing new file: %s', dest_file)
json.dump(new_data, outfile)
if __name__ == '__main__':
args = parse_args(sys.argv[1:])
init_logger(args.loglevel)
main(args)
+74
View File
@@ -0,0 +1,74 @@
{
"max_open_trades": 10,
"stake_currency": "BTC",
"stake_amount": 0.004,
"fiat_display_currency": "USD",
"dry_run": true,
"unfilledtimeout": 120,
"bid_strategy": {
"ask_last_balance": 0.0
},
"exchange": {
"name": "bittrex",
"key": "",
"secret": "",
"pair_whitelist": [
"BTC_ADA",
"BTC_NEO",
"BTC_NXT",
"BTC_MCO",
"BTC_ETH",
"BTC_BCC",
"BTC_VOX",
"BTC_GUP",
"BTC_SC",
"BTC_VTC",
"BTC_STRAT",
"BTC_OMG",
"BTC_OK",
"BTC_EDG",
"BTC_STORJ",
"BTC_EMC2",
"BTC_XLM",
"BTC_LSK",
"BTC_SYS",
"BTC_POWR",
"BTC_PAY",
"BTC_DGB",
"BTC_ETC",
"BTC_XRP",
"BTC_LTC",
"BTC_IOP",
"BTC_RCN",
"BTC_BTG",
"BTC_MONA",
"BTC_SALT",
"BTC_DASH",
"BTC_QTUM",
"BTC_CVC",
"BTC_KMD",
"BTC_XEM",
"BTC_XMR",
"BTC_ZEC",
"BTC_WAVES",
"BTC_PIVX",
"BTC_XZC"
],
"pair_blacklist": [
"BTC_DOGE"
]
},
"experimental": {
"use_sell_signal": true,
"sell_profit_only": false
},
"telegram": {
"enabled": false,
"token": "",
"chat_id": ""
},
"initial_state": "running",
"internals": {
"process_throttle_secs": 5
}
}
+74
View File
@@ -0,0 +1,74 @@
{
"max_open_trades": 10,
"stake_currency": "BTC",
"stake_amount": 0.004,
"fiat_display_currency": "USD",
"dry_run": true,
"unfilledtimeout": 120,
"bid_strategy": {
"ask_last_balance": 0.0
},
"exchange": {
"name": "bittrex",
"key": "",
"secret": "",
"pair_whitelist": [
"BTC_ADA",
"BTC_NEO",
"BTC_NXT",
"BTC_MCO",
"BTC_ETH",
"BTC_BCC",
"BTC_VOX",
"BTC_GUP",
"BTC_SC",
"BTC_VTC",
"BTC_STRAT",
"BTC_OMG",
"BTC_OK",
"BTC_EDG",
"BTC_STORJ",
"BTC_EMC2",
"BTC_XLM",
"BTC_LSK",
"BTC_SYS",
"BTC_POWR",
"BTC_PAY",
"BTC_DGB",
"BTC_ETC",
"BTC_XRP",
"BTC_LTC",
"BTC_IOP",
"BTC_RCN",
"BTC_BTG",
"BTC_MONA",
"BTC_SALT",
"BTC_DASH",
"BTC_QTUM",
"BTC_CVC",
"BTC_KMD",
"BTC_XEM",
"BTC_XMR",
"BTC_ZEC",
"BTC_WAVES",
"BTC_PIVX",
"BTC_XZC"
],
"pair_blacklist": [
"BTC_DOGE"
]
},
"experimental": {
"use_sell_signal": true,
"sell_profit_only": true
},
"telegram": {
"enabled": false,
"token": "",
"chat_id": ""
},
"initial_state": "running",
"internals": {
"process_throttle_secs": 5
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
[]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More