GithubHelp home page GithubHelp logo

cryptomanzap / futures-binance-bot-trader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alirezasarami/futures-binance-bot-trader

0.0 0.0 0.0 8 KB

Example of Binance futures bot with WMAs indicators

Python 100.00%

futures-binance-bot-trader's Introduction

Futures-Binance-Bot-trader

Example of Binance futures bot with WMAs indicators

Hello This project is a very simple example of building a Bainance bot trader. The video of making this bot has been uploaded on YouTube to: To work with this bot, you must enter the api key and secret key in the config.py file.

Instruction youtube video link = https://www.youtube.com/watch?v=tl57JIFQfyU

in BinanceFuturesPy you should change new_order function lines :

BinanceFuturesPY -> futurespy.py -> line 538 - >

def new_order(
    self,
    symbol: str,
    side: str,
    orderType: str,
    quantity: float,
    timeInForce: float = None,
    reduceOnly: bool = False,
    price: float = None,
    newClientOrderId: str = None,
    stopPrice: float = None,
    workingType: str = None,
    positionSide : str = None,
    closePosition : bool = False,
    priceProtect : bool = False,
):
    """
    POST
    
    Choose side:                SELL or BUY
    Choose quantity:            0.001
    Choose price:               7500

    To change order type    ->  orderType = 'MARKET'
    To change time in force ->  timeInForce = 'IOC'
    """

    req = "order?"

    querystring = {
        "symbol": symbol,
        "side": side,
        "type": orderType,
        "quantity": quantity
    }

    if timeInForce is not None:
        querystring["timeInForce"] = timeInForce
    if positionSide is not None :
    	querystring["positionSide"] = positionSide
    
    if closePosition is not False :
    	querystring["closePosition"] = closePosition
    
    if priceProtect is not False :
    	querystring["priceProtect"] = priceProtect
    	
    if reduceOnly is not False :
    	querystring["reduceOnly"] = reduceOnly
    if price is not None:
        querystring["price"] = price
    if newClientOrderId is not None:
        querystring["newClientOrderId"] = newClientOrderId
    if stopPrice is not None:
        querystring["stopPrice"] = stopPrice
    if workingType is not None:
        querystring["workingType"] = workingType
    querystring["timestamp"] = self.timestamp()
    querystring["recvWindow"] = self.recvWindow

    querystring = urllib.parse.urlencode(querystring)

    return self._post_request(req, querystring)

futures-binance-bot-trader's People

Contributors

alirezasarami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.