Giter Club home page Giter Club logo

binance-volatility-trading-bot-js's Introduction

Hello there ๐Ÿ‘‹

const Thang = {
    code: ["Typescript", "Solidity", "PHP"],
    askMeAbout: [ "web-dev","blockchain", "ops", "translating"],
    technologies: {
        backEnd: {
            js: ["nodeJs", "nestJs"],
            php: ["laravel"]
        },
        frontEnd: {
            js: ["reactJs", "jQuery"],
            css: ["bootstrap"],
        },
        smartContract: "Solidity",
        libs: ["OpenZeppelin", "Hardhat", "redux toolkit", "coreUI"],
        databases: ["mongoDb", "mySql"],
        devOps: ["docker", "swarm"]
    },
    architecture: ["Single page applications", "Event driven", "Upgradeable smart contracts"],
    currentFocus: "AWS",
    interests: ["tech", "language", "cryptocurrency"]
};

binance-volatility-trading-bot-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

binance-volatility-trading-bot-js's Issues

Error in executing buying volatiles function:

[6/7/2021, 11:04:49 AM] Error in executing buying volatiles function: "Error in calculating quantity: "Current portfolio value exceeds the initial quantity, waiting for the current asset(s) to be sold first...""

Bad string type in sold-assets.json

  • The sell_at key is returned as a text when it should be numeric
  • The profit key is a text with the % symbol. Should this be a simple numeric and leave the text formatting to the front end

Multiple orders for a single symbol

When a price continues to rise the bot will purchase further orders of a single symbol. This is recorded correctly in the current-orders.json but when it comes to selling it does not appear to process all orders.

Suggested behaviour: when a stop loss is triggered for a symbol then all current orders for that symbol should be closed, not just the first on the list.

Feature: Set stop loss limit instead of waiting for next script run

Issue: When a symbol's price is rapidly falling it can go far below the SL_Threshold before the script is run again and value is lost. This is worse if a longer interval is set.

Possible fix: Use the Binance API to set a stop loss limit at the SL_Threshold.

  1. Initial SL limit is set when the order is placed
  2. After Interval the order status is checked. If it has been filled the order is moved from current to sold with the price data set
  3. If the order has not been filled the script runs as normal
  4. If the TP_Threshold has been reached the SL order is cancelled and a new one is sent for the newly calculated SL_Threshold

Challenges:

  • This might require a separate table for the stop loss orders?
  • This might make the bot too responsive when a delay for the interval would allow the price to bounce back above the SL

Console output - add date/time and output all to a log file

When there is a long period where nothing happens it can be hard to keep track of the executions. It might be helpful to add a timestamp to the output to make it clearer what is happening and when.

[2021/05/18 18:05:02] No coin has risen more than 5% in the last 5 minutes
[2021/05/18 18:05:02] MATICUSDT price has hit SL threshold
[2021/05/18 18:05:03] The asset MATICUSDT has been sold sucessfully at the profit of -5.72% and recorded in sold-assets.json
[2021/05/18 18:05:03] Wait for the bot to gather data to check price volatility...

Also, outputting the console to a .log file would help with troubleshooting. This might need to be configured with some form of log rotation.

Order not being removed from current-orders.json on sale

When an order is sold the action goes through correctly but the order is not removed from current-orders.json. This results in the bot trying to repeatedly sell the item but not being able to as the Binance wallet no longer has the item to sell.

How to get mor than 6 assets price

{
BNBUSDT: { price: '488.00000000', time: 1630134032907 },
BTCUSDT: { price: '48960.73000000', time: 1630134032907 },
ETHUSDT: { price: '900.00000000', time: 1630134032907 },
LTCUSDT: { price: '172.55000000', time: 1630134032908 },
TRXUSDT: { price: '0.08478000', time: 1630134032908 },
XRPUSDT: { price: '0.99990000', time: 1630134032908 }
}
i like to have all prices from pair USDT (>=220 assets)

FIRST ISSUE

To whoever is reading this, your code might be not perfect but you are :)

Account with insufficient balance warning is scary

Receiving the following warning is very scary

Error in executing buying volatiles function: "Error in executing buy function: {\"code\":-2010,\"msg\":\"Account has insufficient balance for requested action.\"}"

Maybe this can be caught and replaced with something friendlier?

Tried to buy but there was not enough funds available

Interference between safe mode and price check

I'm seeing some double entries at the same time stamp which appears to be the INTERVAL script and the safe mode script running at the same time. See 11:16 on the following logs. The price increase calculations seem to be adding together as well.

Purchased at: 0.3496
Max during ownership: 0.3850 (gain of 10.1%)

[26/05/2021, 11:11:34] The price of RAMPUSDT has increased 6.78%
within last 5 minutes...
[26/05/2021, 11:11:34] Successfully place an order: {"symbol":"RAMPUSDT","quantity":142.93,"orderId":36363922,"bought_at":0.3496,"TP_Threshold":0.360088,"SL_Threshold":0.339112,"purchase_time":"26/05/2021, 11:11:34","purchase_time_unix":1622023894804,"updated_at":"26/05/2021, 11:11:34"}
[26/05/2021, 11:12:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:13:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:14:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:15:33] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:16:33] The price of RAMPUSDT has increased 7.15%
within last 5 minutes...
[26/05/2021, 11:16:33] Error in executing buying volatiles function: "Error in calculating quantity: "Current portfolio value exceeds the initial quantity, waiting for the current asset(s) to be sold first...""
[26/05/2021, 11:16:33] The RAMPUSDT has hit TP threshold and we continue to hold as TRAILING MODE activated
[26/05/2021, 11:16:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:16:34] The price of RAMPUSDT has increased 11.33%
within last 5 minutes...
[26/05/2021, 11:16:34] RAMPUSDT price hasn't hit SL or TP threshold, continue to wait...
[26/05/2021, 11:16:34] Error in executing buying volatiles function: "Error in calculating quantity: "Current portfolio value exceeds the initial quantity, waiting for the current asset(s) to be sold first...""
[26/05/2021, 11:17:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:18:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:19:33] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:20:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:21:33] Wait for the bot to gather data to check price volatility...
[26/05/2021, 11:21:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept
[26/05/2021, 11:21:34] RAMPUSDT price hasn't hit SL or TP threshold, continue to wait...
[26/05/2021, 11:24:11] RAMPUSDT price has hit SL threshold
[26/05/2021, 11:24:11] The asset RAMPUSDT has been sold sucessfully at the profit of 0.94% and recorded in sold-assets.json
[26/05/2021, 11:24:11] RAMPUSDT price hasn hit SL threshold during this scan and the asset is sold
[26/05/2021, 11:24:12] Error in scanning Error in selling asset when it hits SL threshold: Error in selling 142.93 of RAMPUSDT: {"code":-2010,"msg":"Account has insufficient balance for requested action."}

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.