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
This is a python bot that automatically logs in, clicks the new button, and sends heroes to work in the bombcrypto game

This is a python bot that automatically logs in, clicks the new button, and sends heroes to work in the bombcrypto game. It is fully open source and free.

856 Jan 04, 2023
Definitive Guide to Creating a SQL Database on Cloud with AWS and Python

Definitive Guide to Creating a SQL Database on Cloud with AWS and Python An easy-to-follow comprehensive guide on integrating Amazon RDS, MySQL Workbe

Kenneth Leung 6 Aug 17, 2022
Unofficial GoPro API Library for Python - connect to GoPro via WiFi.

GoPro API for Python Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi. Compatibility: HERO3 HERO3+ HERO4 (including HERO Se

Konrad Iturbe 1.3k Jan 01, 2023
This repository contains modules that extend / modify parts of Odoo ERP

Odoo Custom Addons This repository contains addons that extend / modify parts of Odoo ERP. Addons list account_cancel_permission Only shows the button

Daniel Luque 3 Dec 28, 2022
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources.

A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.

Donne Martin 11.1k Jan 04, 2023
A Webhook spammer For Python

Webhooker Optimizations Asynchronous Fast & Efficient Multi Tasked Usage Put high threads/tasks for maximum impact Webhook must be valid Proof of conc

andria 1 Dec 20, 2021
A GitHub Action that automatically reports your Advent of Code progress in a table in your README

Advent README Stars This action adds and maintains a stars report in your README based on your Advent of Code progress. Example Table 2021 Results Day

Kevin Duff 36 Dec 30, 2022
Código python para automatizar a junção de arquivos CSV's e salva-los em uma pasta final de destino.

merge_csv Código python para automatizar a junção de arquivos CSV's e salva-los em uma pasta final de destino. Esse projeto é usado pra unir alguns ar

Welder Fariles 1 Jan 12, 2022
Minimal Python client for the Iris API, built on top of Authlib and httpx.

🕸️ Iris Python Client Minimal Python client for the Iris API, built on top of Authlib and httpx. Installation pip install dioptra-iris-client Usage f

Dioptra 1 Jan 28, 2022
this is a telegram torrent bot

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

AYUSH 237 Dec 16, 2021
Retrieve information from DBLP and update BibTex files automatically

Rebib TLDR: This script retrieves information from DBLP to update your BibTex files. python rebib.py --bibfile xxx.bib It first parses the bib entries

Shangtong Zhang 49 Jan 01, 2023
Python version of PlaceNL's headless bot with automatic access token refresh

Reddit /r/place 2022 headless bot This headless Python bot will automatically login to reddit, obtain access tokens (and refreshes them when they expi

19 May 21, 2022
The official source code for Ghost Discord selfbot.

👻 Ghost Selfbot The official code for Ghost which was recently discontinued and released to the public. Feel free to use any of the code found in thi

Ghost 121 Nov 09, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Nov 01, 2021
A smart tool to backup members 📈 So you even after a raid/ ban you can easily restore them in seconds 🎲

🤑 Discord-backer 🤑 A open-source Discord member backup and restore tool for your server. This can help you get all your members in 5 Seconds back af

John 29 Dec 21, 2022
Python notebook allows send bulk whatsapp messages to contacts (not necessarily saved) using an excel file and the selenium package. It also produces a final report on the sending status of the messages.

WhatsApp messages bulk sending 📩 Este notebook (python) te permite enviar mensajes masivos de WhatsApp. El insumo principal es una hoja excel que con

Braulio Arteaga Lescano 8 Sep 15, 2022
Bot for Telegram data Analysis

Bot Scraper for telegram This bot use an AI to Work powered by BOG Team you must do the following steps to make the bot functional: Install the requir

8 Nov 28, 2022
Fetching tweets and integrating it with Kafka and PySpark

KafkaPySpark Zookeeper bin/zookeeper-server-start.sh config/zookeeper.properties Kafka Server bin/kafka-server-start.sh config/server.properties Kafka

Priyansh 2 Dec 29, 2021
Backend.AI Client Library for Python

Backend.AI Client The official API client library for Backend.AI Usage (KeyPair mode) You should set the access key and secret key as environment vari

Lablup 10 Feb 10, 2022
Declarative assertions for AWS

AWSsert AWSsert is a Python library providing declarative assertions about AWS resources to your tests. Installation Use the package manager pip to in

19 Jan 04, 2022