Code Monkey home page Code Monkey logo

binance-bot's Introduction

Introduction

This project consists of an automated trading program, aka a bot, to be used with the Binance trading platform. The bot is fully written in Javascript.

Features

The bot is set for XRP/USDT trading in Binance. Every minute the bot updates the prices with the latest closing price for candlesticks 1min from Binance, calculates the stochRSI indicator, smoothes the stochRSI with an Ehlers filter and make a buy order if the smoothed indicator shows an oversold situation. Then, the bot awaits to sell with a small profit margin, which can be set in the code (default 0.2%). It's also simple to change the code for another trading pair.

The bot relies only in the StochRSI + Ehlers filter logic, so it's quite simple.

Future development

I will continue evolving this bot in the second semester of 2019. Here are some points that deserve attention:

  • Implement a stop logic if prices drop too low, to cut losses.
  • Use more data points for the stochRSI indicator.
  • Consider other technical indicators to create a more elaborate logic.

Dependencies

The bot depends on the following Node modules:

  • "binance-api-node": "^0.8.10",
  • "technicalindicators": "^2.0.5"

Setup

Clone the repository with HTTPS:

$ git clone https://github.com/sindelio/binance_bot.git

Or with SSH:

$ git clone [email protected]:sindelio/binance_bot.git

Then move into the cloned directory:

cd binance_bot

Install the module dependencies:

$ yarn

Make sure the directory path name has no spaces or Yarn will complain!

Running

Inside the project root directory (/bot_binance):

$ node bot_public.js

Contributions

All contributions and comments are welcome!

License

This code is licensed under the MIT license.

binance-bot's People

Contributors

sindelio avatar

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  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  avatar  avatar  avatar  avatar

binance-bot's Issues

Open single ordem how one pair

I found this program very interesting, I want to program my own bot, a doubt that I could not understand in the code how I do to allocate balance for bot operations to open orders and that he only use this value or open a single order with the pair , I couldn't identify in the code

Need help about SRSI

Hi @sindelio, coding is my hobby and async arrow functions is new for me, I could't find any ansewer on MDN, even SOF :), so please can you excplain me line 95-111 in bot_public.js

I use it without yarn.

// Initializes the Ehlers filter (super smoother)
const initializeSmoother = async (SRSI) => {
	console.log('INITIALIZING SUPER SMOOTHER');
	filter[0] = c1 * (SRSI[1].stochRSI + SRSI[0].stochRSI);
	filter[1] = c1 * (SRSI[2].stochRSI + SRSI[1].stochRSI) + c2 * filter[0];
	filter[2] = c1 * (SRSI[3].stochRSI + SRSI[2].stochRSI) + c2 * filter[1] + c3 * filter[0];
	console.log('smoothedStochRSI: ', filter[2], '\n');
}

// Calculates next value for the Ehlers filter
const calculateSmoother = async (SRSI) => {
	console.log('CALCULATING SUPER SMOOTHER');
	let newValue = c1 * (SRSI[3].stochRSI + SRSI[2].stochRSI) + c2 * filter[2] + c3 * filter[1];
	filter.push(newValue);
	filter.shift();
	console.log('smoothedStochRSI: ', filter, '\n');
}

(SRSI) and SRSI[*].stochRSI

they are variables, function names or refference to some external node modules like line 90?

StochasticRSI.calculate(inputStochRSI)`

or something else. I can't realise there origin and nature.

As can see in console it's array:

srsi

Thanks in advance.

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.