GithubHelp home page GithubHelp logo

andresilvasantos / bitprophet Goto Github PK

View Code? Open in Web Editor NEW
230.0 230.0 74.0 622 KB

Node crypto trading platform for Binance exchange.

License: MIT License

JavaScript 100.00%
alerts binance bot cryptocurrency notifications telegram trading

bitprophet's People

Contributors

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

bitprophet's Issues

Setting strategy - EMA value

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you search the current opened issues?

QUESTION

I'm trying to set a strategy and need to get the previous EMA value, how can I do that ? I'm not a skilled programer. I tried but it doesn't seems to work.
Iยดv tried this two ways.

1)
var prevema_15m = parseFloat(chart15m[chart15m.length - 3].close)
var ema8_15m = bp.indicators.ema(prevema_15m, 8)
_____________
2)
var ema8_15m = bp.indicators.ema(chart15m[chart15m.length - 3].close, 8)

If some have any idea. I'll be very grateful.

rename commands

hi
I want to know how to rename command?
for example rename list command to text?

Add martingale grid to buydip strategy

It would have a great benefit if we could set an average down orders in case of price moves down after the first buy order is filled. In that case we can lower profit price even with large moves down. This can be implemented as an addition to the stoploss method

Strategie reloading - question

Does bitProphet reloads strategies from file each time it starts new pair cycle or it loads it only once at start time? What i'm interested in is whether I can change parameters on the go, or should I restart bitProphet each time I make changes?

i cant install and run bitprophet

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you search the current opened issues?

Description

[i cant install and run bitprophet]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Versions

Bitprophet version: [version]

NPM version: [version]

You can get this information from executing npm version.

Crashes while running

Bot keeps crashing every few hours

/Users/FamilyMac/Downloads/bitprophet-master/strategies/buydip.js:218
if(order.price.toFixed(8) != pair.sellTarget.toFixed(8) || amountToSell > sellOrderAmount) {
^

TypeError: pair.sellTarget.toFixed is not a function
at Object.manageSellOrder (/Users/FamilyMac/Downloads/bitprophet-master/strategies/buydip.js:218:54)
at Object.process (/Users/FamilyMac/Downloads/bitprophet-master/strategies/buydip.js:75:18)
at create.process (/Users/FamilyMac/Downloads/bitprophet-master/strategy_generator.js:187:25)
at Object.process (/Users/FamilyMac/Downloads/bitprophet-master/strategy_manager.js:45:44)
at Timeout.processStrategies [as _onTimeout] (/Users/FamilyMac/Downloads/bitprophet-master/bitprophet.js:186:29)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5)

How to use strategy generator

Does it create the code for new strategy.. since the strategies you have provided in README there no relevant modules in the strategies folder...

Question

I've setup Telegram. Am I supposed to pull the code out of the readme file and create a new file to place that it in order to start the program?

I can run

Hi, sorry for the simple question, I am a beginner programmer and just learning. I just downloaded the current version of your program. When I try to run it
npm install bitprophet --save
I get an error
\bitprophet>npm install bitprophet --save
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "bitprophet" under a package
npm ERR! also called "bitprophet". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Root\AppData\Roaming\npm-cache_logs\2021-03-02T05_47_49_884Z-debug.log==
I also tried to initialize this
npm init (bitprophet)
what should I do?

Traffic consumption

Candlestick update needs to be improved to improve traffic performance.
Establish websockets connection to receive the last candlestick only and update locally the candlesticks array.

Ref #32

Set multiple markets to same strategy

Will be great have a way to use same strategy to many maskets. Duplicate the strategy file it not much productive

Ex:

buydip: {
name: "Buy Dip",
paperTrading: false,
buyAmountMarket: 0.001,
profitTarget: 1.5,
maxLoss: 0.5,
maxTradingPairs: 5,
targetMarket: ["BTC","ADA","ONT"]

}

Auto buy BNB

Add the option to auto buy more BNB if it reaches a certain low.

Setup Q/A

Getting this error on start:

node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. internal/modules/cjs/loader.js:702:30
WTF

[Description of the bug or feature]

Telegram receives start message, but no response arrive on any command

tracking multiple/all pair on binance

Hello , can this project auto tracking all BTC pair on binance and auto order the coin is on uptrend(like DCA) and auto sell these coin has hit the profit % or auto sell it for stop loss ? , Thanks You !

Frontend?

Telegram and Discord work great, but I found myself often writing "left" multiple times in a row to see the progress of trades.
Do you think it would be a great feature to have a web frontend where you can start/stop each strategy, see trades being updated in realtime and easily view your profits?

Multiple accounts in a single instance.

Hello Andre

The buydip strategy is rather greedy on traffic. When I need to run two bots with the same strategy what should be the steps to prevent double data loading from exchange? Could there be easy fix or complete rewrite needed?

Change to futures

Is there any way to use this bot for futures trading and not spot?

i cant install bitporphet

i run on "home" on linux
npm install bitprophet --save

results on this mesage:
user@user1:~$ npm install bitprophet --save
npm WARN checkPermissions Missing write access to /home/user/node_modules/bitprophet
npm WARN enoent ENOENT: no such file or directory, open '/home/user/package.json'
npm WARN [email protected] requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.

npm ERR! path /home/user/node_modules/bitprophet
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/home/user/node_modules/bitprophet'
npm ERR! { Error: EACCES: permission denied, access '/home/user/node_modules/bitprophet'
npm ERR! stack: 'Error: EACCES: permission denied, access '/home/user/node_modules/bitprophet'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/home/user/node_modules/bitprophet' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2018-07-12T03_51_08_237Z-debug.log

ETIMEDOUT WebSocket Error

I am getting an error due to time out issues. How should I go about fixing this?

I have all the dependencies installed via npm as well.

After I initialize a strategy through telegram the errors begin to pop up a few seconds later.

Here is a log of the info in the console.

Initialization complete.
Waiting connection for user data updates: 01:42:05
Waiting connection for user data updates: 01:42:06
Waiting connection for user data updates: 01:42:08
Waiting connection for user data updates: 01:42:09
Waiting connection for user data updates: 01:42:11
Waiting connection for user data updates: 01:42:12
Waiting connection for user data updates: 01:42:14
Loading connection for user data updates: 01:42:15
Waiting connection for user data updates: 01:42:17
Waiting connection for user data updates: 01:42:18
Waiting connection for user data updates: 01:42:20
Waiting connection for user data updates: 01:42:21
Waiting connection for user data updates: 01:42:23
Waiting connection for user data updates: 01:42:24
[ 'WebSocket error: btcusdt@kline_5m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_5m (1006)' ]
[ 'WebSocket error: btcusdt@kline_15m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_15m (1006)' ]
Loading connection for user data updates: 01:42:26
[ 'WebSocket error: Yc31tSDcII2ptOsr4pk46EW2a9UGK74opWybIuJ7nyi9fcd7JnCcF9apXDkf (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: Yc31tSDcII2ptOsr4pk46EW2a9UGK74opWybIuJ7nyi9fcd7JnCcF9apXDkf (1006)' ]
[ 'WebSocket error: btcusdt@kline_5m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_5m (1006)' ]
[ 'WebSocket error: btcusdt@kline_15m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_15m (1006)' ]
Waiting connection for user data updates: 01:42:27
[ 'WebSocket error: btcusdt@kline_5m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_5m (1006)' ]
[ 'WebSocket error: btcusdt@kline_15m (ETIMEDOUT) connect ETIMEDOUT 54.92.26.88:9443' ]
[ 'WebSocket closed: btcusdt@kline_15m (1006)' ]

alert to strategy conversion

Hello! I know this is not an issue, I just need help to transform alertsrsi.js into strategy. for example when RSI is less than 30 make a buy order. Thanks in advance.

Missing trading pairs reported in list command

version: v0.6.18

Not all the valid trading pairs for a given market are reported using the list command. I'm running the alertsrsi strategy with the following configuration in the index.js file.

alertsrsi: {
       name: "Alerts RSI",
       maxTradingPairs: 5,
       excludeTokens: ["TRX", "ETH", "ADA", "BCC", "LTC", "ONT", "ICX", "ETC", "TUSD", "QTUM", "XLM"],
       targetMarket: "USDT"
}

and get the bot reports the following 4 tokens as valid:

Valid Pairs [4]:
#BNB/USDT
#BTC/USDT
#NEO/USDT
#XRP/USDT

I expect at IOTA, EOS to be listed as well.

buyAmountMarket Question

Hi,

In the index.js for the strategies, is the buyAmountMarket in the targetMarket currency? For example with targetMarket: "USDT" then is the buyAmountMarket: 200 in USD?

Thanks

Awesome effort btw!

Include one pair.

In the readme there is a possibility to ExcludeTokens, is there a possibility to include only 1 pair? I want to trade only BTC/BUSD.

Selling for 0.27 or 0.07% profits

I have setting for 5% profit exit in the index.js --- but it keeps existing at 0.27% or 0.07% profits... does it identify that the coin might be in downward trend and existing the positions... if yes -- why would it pick the coin in 1st place... just trying to learn... not putting a lot of money... only which can help me learn and i dont mind losing in the process.

strategy for exit?

Hello!
Is possible to set strategy for sell?
I would like set Sell by indicator not by target or stop loss.
Should I change somewhere in setupSellOrder section?

Persistent commands question

Hi,

Is it possible with the current framework to have a persistent command?

For example, manual buy and a command to then initiate a trailing stop.

set proxy error

Title

  • bug: set proxy ERROR

Platform:

  • windows

node version:

  • 8

Long descrption
set https_proxy=http://128.199.51.183:3128 befor run in command prompt

code*

const bitprophet = require('bitprophet')

bitprophet.options({
    binance: {
        key: "9xxxxxrts",
        secret: "xxxx"
    },
    telegram: {
        chatId: "qtradingview_bot",
        token: "xxxx"
    },
   
})

bitprophet.start()

result

{
   "result":"C:\Users\AT\Desktop\yt\node_modules\node-binance-api\node-binance-api.js:352
            if ( options.verbose ) options.log('using proxy server ' + proxy);
            ^

ReferenceError: options is not defined
    at subscribe (C:\Users\AT\Desktop\yt\node_modules\node-binance-api\node-binance-api.js:352:13)
    at Object.chart (C:\Users\AT\Desktop\yt\node_modules\node-binance-api\node-binance-api.js:1630:36)
    at Object.startChartUpdate (C:\Users\AT\Desktop\yt\node_modules\bitprophet\exchange_utils.js:173:22)
    at create.startChartUpdates (C:\Users\AT\Desktop\yt\node_modules\bitprophet\pair_generator.js:118:14)
    at create.addWatcherChartUpdates (C:\Users\AT\Desktop\yt\node_modules\bitprophet\pair_generator.js:153:11)
    at C:\Users\AT\Desktop\yt\node_modules\bitprophet\bitprophet.js:292:28
    at binance.balance (C:\Users\AT\Desktop\yt\node_modules\bitprophet\exchange_utils.js:102:5)
    at C:\Users\AT\Desktop\yt\node_modules\node-binance-api\node-binance-api.js:1254:33
    at Request._callback (C:\Users\AT\Desktop\yt\node_modules\node-binance-api\node-binance-api.js:190:20)
    at Request.self.callback (C:\Users\AT\Desktop\yt\node_modules\request\request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (C:\Users\AT\Desktop\yt\node_modules\request\request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (C:\Users\AT\Desktop\yt\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)"
}

thank you

Question

Hi @andresilvasantos

Just wanted to start with "this is not an issue" ๐Ÿ˜„

I would like to contribute more to this project and I was wondering if you have already a development plan .. and or if you are using a project management tool to organize yourself.

All the best
I

Error when command node bitprophet

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you search the current opened issues?

Description

Ao executar : "node bitprophet"
Retorna o erro: TypeError: Cannot read property 'binance' of undefined

Steps to Reproduce

  1. [First Step]: configure vars.js file like readme
  2. [Second Step]: run command node bitprophet
  3. [and so on...] TypeError: Cannot read property 'binance' of undefined

Expected behavior: Start bitprophet

Actual behavior: just exit with error

Versions

Bitprophet version: master

NPM version: 6.14.12

You can get this information from executing npm version.

Flood messages when alert

Hello,
How to avoid flood messages when alert? I create alert when EMA15 cross EMA50 and when it's happen I get flood. It's possible is change pair.functions.chart from ticks to last created/closed candle?

`process: function(strategy, pair) {
if(!pair.functions.chartUpdatesActive(intervalsWatch)) {
pair.functions.ensureChartUpdates(intervalsWatch)
return
}

	var chart4h = pair.functions.chart(intervalsWatch[0]).ticks
	var chart1h = pair.functions.chart(intervalsWatch[1]).ticks

	if(chart4h.length < 500 || chart1h.length < 500) return

	
	var ema4h15 = bp.indicators.ema(chart4h, 15, 100, 2)
	var ema4h50 = bp.indicators.ema(chart4h, 50, 100, 2)
	
	var ema1h15 = bp.indicators.ema(chart1h, 15, 100, 2)
	var ema1h50 = bp.indicators.ema(chart1h, 50, 100, 2)
	
	var ema4h15last = ema4h15[0]
	var ema4h50last = ema4h50[0]
	var ema4h15curr = ema4h15[1]
	var ema4h50curr = ema4h50[1]
	
	var ema1h15last = ema1h15[0]
	var ema1h50last = ema1h50[0]
	var ema1h15curr = ema1h15[1]
	var ema1h50curr = ema1h50[1]
	
	if( ema4h15last < ema4h50last && ema4h15curr >= ema4h50curr ){
		console.log(pair.name, " @ EMA15 at 4h cross EMA50 โ—๏ธ")
	}
	
	
	if(!pair.alertSent && ema4h15last < ema4h50last && ema4h15curr >= ema4h50curr) {
		strategy.sendMessage(pair, " @ EMA15 at 4h cross EMA50 โ—๏ธ")
		pair.alertSent = true
	}
	else if(ema4h15curr > ema4h50curr ||  ema4h15last < ema4h50last ) {
		pair.alertSent = false
	}
	
	if(!pair.alertSent && ema1h15last < ema1h50last && ema1h15curr >= ema1h50curr) {
		strategy.sendMessage(pair, " @ EMA15 at 1h cross EMA50 โ—๏ธ")
		pair.alertSent = true
	}
	else if(ema1h15curr > ema1h50curr ||  ema1h15last < ema1h50last) {
		pair.alertSent = false
	}	`

telegram flood

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.