touch config files to dockerize
This commit is contained in:
parent
75c89bcd64
commit
bef088ff90
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
version: '3'
|
version: "3"
|
||||||
services:
|
services:
|
||||||
freqtrade:
|
freqtrade:
|
||||||
image: freqtradeorg/freqtrade:stable
|
image: freqtradeorg/freqtrade:stable
|
||||||
@ -17,12 +17,12 @@ services:
|
|||||||
# Expose api on port 8080 (localhost only)
|
# Expose api on port 8080 (localhost only)
|
||||||
# Please read the https://www.freqtrade.io/en/latest/rest-api/ documentation
|
# Please read the https://www.freqtrade.io/en/latest/rest-api/ documentation
|
||||||
# before enabling this.
|
# before enabling this.
|
||||||
# ports:
|
ports:
|
||||||
# - "127.0.0.1:8080:8080"
|
- "127.0.0.1:8080:8080"
|
||||||
# Default command used when running `docker compose up`
|
# Default command used when running `docker compose up`
|
||||||
command: >
|
command: >
|
||||||
trade
|
trade
|
||||||
--logfile /freqtrade/user_data/logs/freqtrade.log
|
--logfile /freqtrade/user_data/logs/freqtrade.log
|
||||||
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
|
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
|
||||||
--config /freqtrade/user_data/config.json
|
--config /freqtrade/user_data/config.json
|
||||||
--strategy SampleStrategy
|
--strategy Strategy002
|
||||||
|
@ -29,7 +29,7 @@ class DefaultStrategy(IStrategy):
|
|||||||
stoploss = -0.10
|
stoploss = -0.10
|
||||||
|
|
||||||
# Optimal timeframe for the strategy
|
# Optimal timeframe for the strategy
|
||||||
timeframe = '5m'
|
timeframe = '15m'
|
||||||
|
|
||||||
# Optional order type mapping
|
# Optional order type mapping
|
||||||
order_types = {
|
order_types = {
|
||||||
@ -119,7 +119,7 @@ class DefaultStrategy(IStrategy):
|
|||||||
"""
|
"""
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(dataframe['rsi'] < 35) &
|
(dataframe['rsi'] < 30) &
|
||||||
(dataframe['fastd'] < 35) &
|
(dataframe['fastd'] < 35) &
|
||||||
(dataframe['adx'] > 30) &
|
(dataframe['adx'] > 30) &
|
||||||
(dataframe['plus_di'] > 0.5)
|
(dataframe['plus_di'] > 0.5)
|
||||||
@ -142,7 +142,7 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
(qtpylib.crossed_above(dataframe['rsi'], 70)) |
|
(qtpylib.crossed_above(dataframe['rsi'], 75)) |
|
||||||
(qtpylib.crossed_above(dataframe['fastd'], 70))
|
(qtpylib.crossed_above(dataframe['fastd'], 70))
|
||||||
) &
|
) &
|
||||||
(dataframe['adx'] > 10) &
|
(dataframe['adx'] > 10) &
|
||||||
|
141
user_data/config.json
Normal file
141
user_data/config.json
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
{
|
||||||
|
"max_open_trades": 2,
|
||||||
|
"stake_currency": "BTC",
|
||||||
|
"stake_amount": "unlimited",
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
|
"fiat_display_currency": "USD",
|
||||||
|
"timeframe": "1m",
|
||||||
|
"dry_run": true,
|
||||||
|
"dry_run_wallet": 1,
|
||||||
|
"cancel_open_orders_on_exit": false,
|
||||||
|
"unfilledtimeout": {
|
||||||
|
"buy": 10,
|
||||||
|
"sell": 30
|
||||||
|
},
|
||||||
|
"bid_strategy": {
|
||||||
|
"price_side": "bid",
|
||||||
|
"ask_last_balance": 0.0,
|
||||||
|
"use_order_book": false,
|
||||||
|
"order_book_top": 1,
|
||||||
|
"check_depth_of_market": {
|
||||||
|
"enabled": false,
|
||||||
|
"bids_to_ask_delta": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ask_strategy": {
|
||||||
|
"price_side": "ask",
|
||||||
|
"use_order_book": false,
|
||||||
|
"order_book_min": 1,
|
||||||
|
"order_book_max": 1,
|
||||||
|
"use_sell_signal": true,
|
||||||
|
"sell_profit_only": false,
|
||||||
|
"ignore_roi_if_buy_signal": false
|
||||||
|
},
|
||||||
|
"exchange": {
|
||||||
|
"name": "binance",
|
||||||
|
"key": "",
|
||||||
|
"secret": "",
|
||||||
|
"ccxt_config": {"enableRateLimit": true},
|
||||||
|
"ccxt_async_config": {
|
||||||
|
"enableRateLimit": true,
|
||||||
|
"rateLimit": 200
|
||||||
|
},
|
||||||
|
"pair_whitelist": [
|
||||||
|
// "ADA/BTC",
|
||||||
|
"ALGO/BTC",
|
||||||
|
// "ATOM/BTC",
|
||||||
|
"BAT/BTC",
|
||||||
|
// "BCH/BTC",
|
||||||
|
"BRD/BTC",
|
||||||
|
"BTG/BTC",
|
||||||
|
// "CAKE/BTC",
|
||||||
|
// "CHZ/BTC",
|
||||||
|
// "DCR/BTC",
|
||||||
|
"DOGE/BTC",
|
||||||
|
// "DREP/BTC",
|
||||||
|
"DASH/BTC",
|
||||||
|
// "EGLD/BTC",
|
||||||
|
// "EOS/BTC",
|
||||||
|
"ENJ/BTC",
|
||||||
|
// "ETH/BTC",
|
||||||
|
// "FTT/BTC",
|
||||||
|
"GTO/BTC",
|
||||||
|
"HBAR/BTC",
|
||||||
|
"IOST/BTC",
|
||||||
|
"IOTA/BTC",
|
||||||
|
// "LINK/BTC",
|
||||||
|
"LTC/BTC",
|
||||||
|
"MANA/BTC",
|
||||||
|
// "MITH/BTC",
|
||||||
|
"MKR/BTC",
|
||||||
|
// "NEO/BTC",
|
||||||
|
// "NKN/BTC",
|
||||||
|
// "NXS/BTC",
|
||||||
|
// "ONT/BTC",
|
||||||
|
"PPT/BTC",
|
||||||
|
// "QTUM/BTC",
|
||||||
|
// "RUNE/BTC",
|
||||||
|
"RVN/BTC",
|
||||||
|
// "SOL/BTC",
|
||||||
|
"SRM/BTC",
|
||||||
|
"TFUEL/BTC",
|
||||||
|
"THETA/BTC",
|
||||||
|
"TRX/BTC",
|
||||||
|
"VET/BTC",
|
||||||
|
"VIA/BTC",
|
||||||
|
"WAVES/BTC",
|
||||||
|
// "XEM/BTC",
|
||||||
|
"XLM/BTC",
|
||||||
|
"XMR/BTC",
|
||||||
|
"XRP/BTC",
|
||||||
|
"XTZ/BTC",
|
||||||
|
// "ZIL/BTC",
|
||||||
|
"ZRX/BTC",
|
||||||
|
"SXP/BTC",
|
||||||
|
// "WAN/BTC",
|
||||||
|
// "WIN/BTC",
|
||||||
|
],
|
||||||
|
"pair_blacklist": [
|
||||||
|
"BNB/BTC"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pairlists": [
|
||||||
|
{"method": "StaticPairList"}
|
||||||
|
],
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
|
"telegram": {
|
||||||
|
"enabled": false,
|
||||||
|
"token": "1356047596:AAHuyBLkOuoJ0SSYYOt5TXd2YBUzD3uzoEA",
|
||||||
|
"chat_id": "bitsbee1_bot"
|
||||||
|
},
|
||||||
|
"api_server": {
|
||||||
|
"enabled": true,
|
||||||
|
"listen_ip_address": "0.0.0.0",
|
||||||
|
"listen_port": 8080,
|
||||||
|
"verbosity": "error",
|
||||||
|
"enable_openapi": false,
|
||||||
|
"jwt_secret_key": "06907b5231babf844792af80070386aab331065690b15f7d86964666fc64fc30",
|
||||||
|
"CORS_origins": [],
|
||||||
|
"username": "kecheon@gmail.com",
|
||||||
|
"password": "dmdcjs0"
|
||||||
|
},
|
||||||
|
"bot_name": "freqtrade",
|
||||||
|
"initial_state": "running",
|
||||||
|
"forcebuy_enable": false,
|
||||||
|
"internals": {
|
||||||
|
"process_throttle_secs": 5
|
||||||
|
}
|
||||||
|
}
|
135
user_data/strategies/Strategy002.py
Normal file
135
user_data/strategies/Strategy002.py
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
|
||||||
|
# --- Do not remove these libs ---
|
||||||
|
from freqtrade.strategy.interface import IStrategy
|
||||||
|
from typing import Dict, List
|
||||||
|
from functools import reduce
|
||||||
|
from pandas import DataFrame
|
||||||
|
# --------------------------------
|
||||||
|
|
||||||
|
import talib.abstract as ta
|
||||||
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
|
import numpy # noqa
|
||||||
|
|
||||||
|
|
||||||
|
class Strategy002(IStrategy):
|
||||||
|
"""
|
||||||
|
Strategy 002
|
||||||
|
author@: Gerald Lonlas
|
||||||
|
github@: https://github.com/freqtrade/freqtrade-strategies
|
||||||
|
|
||||||
|
How to use it?
|
||||||
|
> python3 ./freqtrade/main.py -s Strategy002
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Minimal ROI designed for the strategy.
|
||||||
|
# This attribute will be overridden if the config file contains "minimal_roi"
|
||||||
|
minimal_roi = {
|
||||||
|
"60": 0.01,
|
||||||
|
"30": 0.03,
|
||||||
|
"20": 0.04,
|
||||||
|
"0": 0.05
|
||||||
|
}
|
||||||
|
|
||||||
|
# Optimal stoploss designed for the strategy
|
||||||
|
# This attribute will be overridden if the config file contains "stoploss"
|
||||||
|
stoploss = -0.10
|
||||||
|
|
||||||
|
# Optimal timeframe for the strategy
|
||||||
|
timeframe = '1m'
|
||||||
|
|
||||||
|
# trailing stoploss
|
||||||
|
trailing_stop = False
|
||||||
|
trailing_stop_positive = 0.01
|
||||||
|
trailing_stop_positive_offset = 0.02
|
||||||
|
|
||||||
|
# run "populate_indicators" only for new candle
|
||||||
|
process_only_new_candles = False
|
||||||
|
|
||||||
|
# Experimental settings (configuration will overide these if set)
|
||||||
|
use_sell_signal = True
|
||||||
|
sell_profit_only = True
|
||||||
|
ignore_roi_if_buy_signal = False
|
||||||
|
|
||||||
|
# Optional order type mapping
|
||||||
|
order_types = {
|
||||||
|
'buy': 'limit',
|
||||||
|
'sell': 'limit',
|
||||||
|
'stoploss': 'market',
|
||||||
|
'stoploss_on_exchange': False
|
||||||
|
}
|
||||||
|
|
||||||
|
def informative_pairs(self):
|
||||||
|
"""
|
||||||
|
Define additional, informative pair/interval combinations to be cached from the exchange.
|
||||||
|
These pair/interval combinations are non-tradeable, unless they are part
|
||||||
|
of the whitelist as well.
|
||||||
|
For more information, please consult the documentation
|
||||||
|
:return: List of tuples in the format (pair, interval)
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
("ETH/USDT", "15m"),
|
||||||
|
("BTC/USDT", "5m"),
|
||||||
|
]
|
||||||
|
|
||||||
|
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
"""
|
||||||
|
Adds several different TA indicators to the given DataFrame
|
||||||
|
|
||||||
|
Performance Note: For the best performance be frugal on the number of indicators
|
||||||
|
you are using. Let uncomment only the indicator you are using in your strategies
|
||||||
|
or your hyperopt configuration, otherwise you will waste your memory and CPU usage.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Stoch
|
||||||
|
stoch = ta.STOCH(dataframe)
|
||||||
|
dataframe['slowk'] = stoch['slowk']
|
||||||
|
|
||||||
|
# RSI
|
||||||
|
dataframe['rsi'] = ta.RSI(dataframe)
|
||||||
|
|
||||||
|
# Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)
|
||||||
|
rsi = 0.1 * (dataframe['rsi'] - 50)
|
||||||
|
dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)
|
||||||
|
|
||||||
|
# Bollinger bands
|
||||||
|
bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
|
||||||
|
dataframe['bb_lowerband'] = bollinger['lower']
|
||||||
|
|
||||||
|
# SAR Parabol
|
||||||
|
dataframe['sar'] = ta.SAR(dataframe)
|
||||||
|
|
||||||
|
# Hammer: values [0, 100]
|
||||||
|
dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)
|
||||||
|
|
||||||
|
return dataframe
|
||||||
|
|
||||||
|
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
"""
|
||||||
|
Based on TA indicators, populates the buy signal for the given dataframe
|
||||||
|
:param dataframe: DataFrame
|
||||||
|
:return: DataFrame with buy column
|
||||||
|
"""
|
||||||
|
dataframe.loc[
|
||||||
|
(
|
||||||
|
(dataframe['rsi'] < 30) &
|
||||||
|
(dataframe['slowk'] < 20) &
|
||||||
|
(dataframe['bb_lowerband'] > dataframe['close']) &
|
||||||
|
(dataframe['CDLHAMMER'] == 100)
|
||||||
|
),
|
||||||
|
'buy'] = 1
|
||||||
|
|
||||||
|
return dataframe
|
||||||
|
|
||||||
|
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
"""
|
||||||
|
Based on TA indicators, populates the sell signal for the given dataframe
|
||||||
|
:param dataframe: DataFrame
|
||||||
|
:return: DataFrame with buy column
|
||||||
|
"""
|
||||||
|
dataframe.loc[
|
||||||
|
(
|
||||||
|
(dataframe['sar'] > dataframe['close']) &
|
||||||
|
(dataframe['fisher_rsi'] > 0.55)
|
||||||
|
),
|
||||||
|
'sell'] = 1
|
||||||
|
return dataframe
|
Loading…
Reference in New Issue
Block a user