Freqtrade 3commas wrapper for python

Overview

Freqtrade 3commas wrapper

The aim of this project is to provide an easy way to integrate freqtrade with 3commas. The main reason someone would want to do this is to use the auto DCA feature that 3commas provides and unfortunately freqtrade lacks.

DCA can be risky, especially if used on bad/shit/meme coins, so please use responsibly.

Setup in 3commas

Make a 3commas account and bot

First, you'll need to create a 3commas account and connect 3commas to your exchange. Then create a multi-pair long bot with the pairs you want to trade. Here you could actually select all pairs (eg. USDT_ALL) and make the more exact pair selection in freqtrade. Note, if you're going to use VolumePairList, you will need to select all the pairs in 3commas.

create a multi-pair long bot

Next set the Deal start condition to Manual/API

After electing the pairs, set your order amounts, safety orders and take profit settings. There are plenty of YouTube tutorials explaining what these are.

Once you're happy with the settings click Create bot

We will also need to write down the bot_id, this can be found in the API example or URL when looking at the bot.

get the bot id

Now we can start the bot. Since the bot is set to Manual, it won't make any trades.

3commas API

In order to control the 3commas bot with freqtrade we'll need an API key and secret.

You can get these by going to https://3commas.io/api_access_tokens and creating a new API key with BotsRead and BotsWrite

Save the key and secret, we'll need them later.

Freqtrade setup

Freqtrade has excellent documentation available at https://www.freqtrade.io/en/stable/

Follow the tutorial to get started.

Add 3commas credential to config.json

Once you've created a freqtrade configuration, you should have a file called config.json Open it in your favorite editor and add the following in the json root:

"3commas": {
	"key": "3commas_key_goes_here",
	"secret": "3commas_secret_goes_here",
	"bot_id": 123456
},

Fill that with the 3commas credentials and bot_id from the previous steps and your config.json should look something like this:

3commas json config

Add the wrapper

Now you'll need to download the 3commas wrapper in the user_data directory

wget https://raw.githubusercontent.com/AlexBabescu/freqtrade_3commas/master/user_data/freqtrade3cw.py

The wrapper depends on the py3cw package. You will need to install it with:

pip install py3cw

If you are a Docker user, please refer to the freqtrade documentation on how to add additional packages in the freqtrade container - https://www.freqtrade.io/en/stable/docker_quickstart/#additional-dependencies-with-docker-compose

Using the wrapper in a strategy

All you need is to import Freqtrade3cw into your strategy and decorate the populate_buy_trend method.

....
from user_data.freqtrade3cw import Freqtrade3cw

class SampleStrategy(IStrategy):
	....

	@Freqtrade3cw.buy_signal
	def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
		....

Starting freqtrade

Freqtrade should be configured to run in dry-mode on the same exchange as your 3commas bot. If you are going to use VolumePairList then you must set your 3commas bot to use all the pairs.

Limitations and future work

Currently this only supports sending buy signals.

TODO:

  • send sell signals
  • turn this into a python package

If you have any questions you can find me on discord at alb#1349

Have fun!

Owner
Alex Babescu
Alex Babescu
🎄 JustaGrabber - A discord token grabber written in python3

🎄 JustaGrabber - A discord token grabber written in python3 🎇 Made by kldiscord https://github.com/kldiscord 🌟 Please leave a star if you liked Jus

1 Dec 19, 2022
A part of HyRiver software stack for accessing hydrology data through web services

Package Description Status PyNHD Navigate and subset NHDPlus (MR and HR) using web services Py3DEP Access topographic data through National Map's 3DEP

Taher Chegini 51 Dec 10, 2022
a list of disposable and temporary email address domains

List of disposable email domains This repo contains a list of disposable and temporary email address domains often used to register dummy users in ord

1.6k Jan 08, 2023
A robust, low-level connector for the Discord API

Bauxite Bauxite is a robust, low-level connector for the Discord API. What is Bauxite for? Bauxite is made for two main purposes: Creating higher-leve

1 Dec 04, 2021
Read manga from your favourites websites on telegram.

tg-manga-bot Read manga from your favourites websites on telegram. Current Development Bot @idkpythonbot Telegram Channel tg_manga_bot Commands start

Daniel Rivero 41 Dec 22, 2022
The Most Simple yet Powerful and Advanced Google Colab Notebook for Zip, Unzip, Tar, UnTar, RaR, UnRaR Files in Google Drive

The Most Simple yet Powerful and Advanced Google Colab Notebook for Zip, Unzip, Tar, UnTar, RaR, UnRaR Files in Google Drive

Dr.Caduceus 15 Aug 16, 2022
A Simple Telegram Bot That Can Generate Strong Password With Many Features Written In Python Using Pyrogram

Password-Generator-Bot A Simple Telegram Bot That Can Generate Strong Password With Many Features Written In Python Using Pyrogram Features Random Pas

Muhammed Fazin 17 Dec 23, 2022
A python api to get info on covid-19

A python api to get info on covid-19

roof 2 Sep 18, 2022
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 07, 2022
Discord nuke bot with python

Discord-nuke-bot 🇷🇺 🇷🇺 🇷🇺 🇷🇺 🇷🇺 TODO: Добавить команду: Удаления всех ролей Спама каналами Спама во все каналы @everyone Удаления всего aka

Nikita Maykov 10 Oct 14, 2022
Charged's cogs for Red!

Light-Cogs Charged's cogs for Red! Read below for more information. Features and Cogs TechInfo Lots of commands helping you and your devices! Extended

Charged 2 Jan 07, 2022
Discord Crypto Payment Cards Selfbot

A Discord selfbot that serves the purpose of displaying text and QR versions of your BTC, LTC & ETH payment information for easy and simple commercial or personal transactions.

2 Apr 12, 2022
Telegram vc - A bot that can play music on telegram group's voice call

Telegram Voice Chat Bot A bot that can play music on telegram group's voice call

1 Jan 02, 2022
Creating a Python API, for the MakeMyTrip Flight Schedules.

MakeMyTripAPI Creating a Python API, for the MakeMyTrip Flight Schedules. Source: MakeMyTrip is an Indian online travel company founded in 2000. Headq

Aman Priyanshu 0 Jan 12, 2022
Technical Test - Python Programmer Grupo Nexxera

Technical Test Nexxera Group Teste Técnico - Grupo de Programadores Python Nexxera 📍 Prepare-se para usar a API Nossa API de transações de contas dig

Raul dos Santos Moraes 1 Mar 16, 2022
An automated tool that fetches information about your crypto stake and generates historical data in time.

Introduction Yield explorer is a WIP! I needed a tool that would show me historical data and performance of my staked crypto but was unable to find a

Sedat Can Yalçın 42 Nov 26, 2022
A Python library for loading data from a SpaceX Starlink satellite.

Starlink Python A Python library for loading data from a SpaceX Starlink satellite. The goal is to be a simple interface for Starlink. It builds upon

Austin 2 Jan 16, 2022
A Simple modular tool to fetch and parse data related to the stock market.

🐒 stonks-o-fetcher A Simple modular tool to fetch and parse data related to the stock market. Getting started For the moment the only source is this

Daniele 23 May 31, 2021
Manage AWS Secrets the easy way

AWStanding Easily load variables from AWS Parameter store into environment variables. Why to AWStanding? Because it handles AWS pagination so the amou

Juan Ignacio Sánchez Sampayo 13 Dec 30, 2022
A Python script to update Spotify Playlist data every 5 minutes.

Spotify Playlist Updater A Python script to update Spotify Playlist data every 5 minutes. Description An automatic playlist updater using Spotify API

6 Nov 24, 2022