Binance leverage futures Hook

Overview

Simple binance futures

Attention

  • Just use leverage. The fee difference between futures and spot is not considered. For example, funding rate, etc.
  • Only support binance
  • Only support isolated
  • Only long, Short is not supported
  • Not support increasing margin
  • Not support adjusting leverage when holding positions,This is a limitation of Binance
  • Please use the 2021.07 version of FT. There is no guarantee that the previous or later versions will support.Don't forget pip install -r requirements.txt after updating FT

Prepare

  • New binance users only support 20x leverage, please confirm whether your account supports higher leverage! Make sure your API is enabled and have Futures permissions Open futures after created the API, the created API still does not support futres, you must create a new API
  • When the script starts, it will initialize Leverage, PositionsideDual, Isolated, so your position needs to be empty
  • Make sure that the following methods are not customized ohlcvdata_to_dataframe custom_stake_amount custom_stoploss confirm_trade_entry bot_loop_start or use super().xxx() first

Modify config.json

  • Must set order_types.stoploss_on_exchange to true.
  • Muset set bid_strategy.use_order_book to true.
  • Muset set ask_strategy.use_order_book to true.
  • Highly recommended set ccxt_config.enableRateLimit to true.
  • exchange.ccxt_config add "options": {"defaultType": "future"}
  • exchange.ccxt_async_config add "options": {"defaultType": "future"}

Modify strategy

from pandas import DataFrame

from freqtrade.strategy import stoploss_from_open
from pathlib import Path
import sys

sys.path.append(str(Path(__file__).parent))
import importlib

interface_futures_binance = importlib.import_module("interface_futures_binance")
importlib.reload(interface_futures_binance)


class SimpleBinanceFutures(interface_futures_binance.IFutures):
    use_custom_stoploss = True

    # Futures config
    # New binance users only support 20x leverage, please confirm whether your account supports higher leverage!
    # Make sure your API is enabled and have Futures permissions
    # (open futures after created the API, the created API still does not support futres, you must create a new API)
    _leverage = 10

    def custom_stoploss(
        self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs
    ) -> float:
        """
        Must! Must! Must use custom_stoploss, and turn on stoploss_on_exchange

        FT spot does not handle the logic of forced liquidation.
        Therefore, stoploss_on_exchange must be used to manually liquidate the position before the forced liquidation
        """
        p = locals()
        del p["self"], p["__class__"]
        parent_stoploss = super().custom_stoploss(**p)

        return max(stoploss_from_open(parent_stoploss, current_profit), -1)

Other

  • If you want to change the strategy, it is recommended to restart instead of using web reload.
Owner
Adriance
Adriance
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in python .

Ultramsg.com WhatsApp Bot using WhatsApp API and ultramsg Demo WhatsApp API ChatBot using Ultramsg API with python. Opportunities and tasks: The outpu

Ultramsg 64 Dec 29, 2022
Bot to notify when vaccine appointments are available

Vaccine Watch Bot to notify when vaccine appointments are available. Supports checking Hy-Vee, Walgreens, CVS, Walmart, Cosentino's stores (KC), and B

Peter Carnesciali 37 Aug 13, 2022
Reddit cli to slack at work

Reddit CLI (v1.0) Introduction Why Reddit CLI? Coworker who sees me looking at something in a browser: "Glad you're not busy; I need you to do this, t

3 Jun 22, 2021
This is a translator that i made by myself in python with the 'googletrans' library

Translator-Python This is a translator that i made by myself in python with the 'googletrans' library This application completely made in python allow

Thadeuks 2 Jun 17, 2022
ApiMoedas - This API is a extesion of API

🪙 Api Moeda 🪙 Este projeto é uma extensão da API Awesome API. Basicamente, ele mostra todas as moedas que a Awesome API tem e todas as suas conversõ

Abel 4 May 29, 2022
Discord bot for Shran development

shranbot A discord bot named Herbert West that will monitor the Shran development discord server. Using dotenv shranbot uses a .env file to load secre

Matt Williams 1 Jul 29, 2022
A Telegram bot to transcribe audio, video and image into text.

Transcriber Bot A Telegram bot to transcribe audio, video and image into text. Deploy to Heroku Local Deploying Install the FFmpeg. Make sure you have

10 Dec 19, 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 Dec 07, 2021
A pixeldrain python package using pixeldrain official api

Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/FayasNoushad/Pixeldrain/blob/main/LICENSE In

Fayas Noushad 6 Jan 26, 2022
✖️ Unofficial API of 1337x.to

✖️ Unofficial Python API Wrapper of 1337x This is the unofficial API of 1337x. It supports all proxies of 1337x and almost all functions of 1337x. You

Hemanta Pokharel 71 Dec 26, 2022
a discord bot for searching your movies, and bot return movie url for you :)

IMDb Discord Bot how to run this bot. the first step you must create prefixes.json file the second step you must create a virtualenv if you use window

Mehdi Radfar 6 Dec 20, 2022
Python API to interact with Uwazi

Python Uwazi API Quick Start To use the API install the requirements pip3 install -r requirements.txt and use it like this: uwazi_adapter = UwaziAdap

HURIDOCS 2 Dec 16, 2021
NoChannelBot - Bot bans users, that send messages like channels

No Channel Bot Say "STOP" to users who send messages as channels! Bot prevents u

Andrew 10 Oct 05, 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
(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

3 Jun 04, 2021
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Forward A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag

16 Oct 21, 2022
Asynchronous and also synchronous non-official QvaPay client for asyncio and Python language.

Asynchronous and also synchronous non-official QvaPay client for asyncio and Python language. This library is still under development, the interface could be changed.

Leynier Gutiérrez González 8 Sep 18, 2021
Telegram Bot for updating ongoing matches of Fotmob.com in channel by @AbirHasan2005

Fotmob-Bot A very simple Telegram Bot which will update ongoing matches of Fotmob in a channel. Demo Channel Configs API_ID - Get this from @TeleORG_B

Abir Hasan 22 Oct 21, 2022
🌶️ Give real chat boosting to your discord server.

Chat-Booster Give real chat boosting to your discord server. ✅ Setup: - Add token to scrape messages on server that you whant. - Put the token in

&! Ѵιchy.#0110 36 Nov 04, 2022
Braje: a python based credit hacker tool. Hack unlimited RAJE LIKER app Credit

#ReCoded Evan Al Mahmud Irfan ✨ ථ BRAJE 1.0 AUTO LIKER, AUTO COMMENT AND AUTO FOLLOWER APP CREDIT HACKER TOOL About Braje: Braje is a python based cre

Evan Al Mahmud Irfan ථ 2 Dec 23, 2021