Bitcoin dockerfile bittrex poloniex bitfinex Telegram
Need help with gbot-trader?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
steeply

Description

Trading robot for trade on crypto exchanges

208 Stars 97 Forks Other 180 Commits 4 Opened issues

Services available

Need anything else?

GBot Trader

Dependency Status

This app is working with server maintenance.

Exchange

  • Poloniex
  • Exmo
  • Bitfinex
  • Liqui
  • Dsx
  • Binance (Unofficial)
  • Cex (Unofficial)
  • Cryptopia (Unofficial)
  • Kraken (Unofficial)
  • Yobit (Unofficial)
  • Huobi (Unofficial)
  • Kucoin (Unofficial)
  • Hitbtc (Unofficial)
  • Stex (Unofficial)
  • Bleutrade (Unofficial)

Unofficial

  • The module on the exchange Unofficial is purchased separately from third-party developers! Telegram - @solvento.
  • The modules are running in the DEMO mode does not require a license.

Full version in Russian documentation

README RU

FAQ

Before asking questions, please read the FAQ RU. Most of the answers you will find in it.

Install

  1. Install node.js or use hosting (heroku, pivotal, UltraVDS, Zomro and etc.)

  2. Copy the repository and install the dependency packages:

    $ git clone https://github.com/steeply/gbot-trader.git
    $ cd gbot-trader
    $ npm i
    

Setting

Telegram. Creating a new bot

If you use the option TELEGRAM_OFF, then this paragraph is not necessary.

@BotFather

Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authorization token for your new bot.
The name of your bot is displayed in contact details and elsewhere.
The Username is a short name, to be used in mentions and telegram.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in ‘bot’, e.g. ‘trade_bot’ or ‘TradeBot’.
The token is a string along the lines of

110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
that is required to authorize the bot and send requests to the Bot API.

The receipt of Telegram ID

  1. Set the parameters API Exchange:
    EXCHANGE
    ,
    KEY
    ,
    SECRET
    and
    TELEGRAM_TOKEN
    .
  2. Run GBot Trader.
  3. Write your Telegram bot (which you created earlier using @BotFather) any message, you will receive your id number.
  4. Turn Off GBot Trader.
  5. Set the parameters
    TELEGRAM_ID
    .

Parameters variable environment:

Required parameters

Option

Description Type Default
KEY API key string -
SECRET API secret string -
NAME_COIN Trading currency string ltc
NAMECOINTWO Trading currency string usd
EXCHANGE The choice of the exchange
poloniex (inverted pairs)
bittrex (inverted pairs)
exmo
bitfinex
liqui
dsx
string -
EXCHANGE_HOST Host exchange API. If the primary host is not available. string -

Parameters for Telegram

Option

Description Type Default
TELEGRAMTOKEN Telegram token string -
TELEGRAMID Your User ID Telegram number -
SOCKS5HOST HOST SOCKS5 string -
SOCKS5PORT PORT SOCKS5 number 1080
SOCKS5USERNAME Username SOCKS5 string -
SOCKS5PASSWORD Password SOCKS5 string -
TELEGRAMBASEURL URL server and proxy string -
TELEGRAMOFF Disable Telegram boolean false

Option TELEGRAM_OFF disables the ability to use Telegram in the bot. All management and all notifications sent via Telegram are the same are disabled!

By default, the bot will work at default settings. You can change them using the following options.

Used trade options

Option

Description Type Default
TIMEUPDATEAUTOSETTINGS Interval update of auto settings (min) number 2
DEPOSITLIMIT Deposit consuming percent or the absolute number

If an absolute number is specified: the size of the used part of the Deposit in the currency NAMECOINTWO.
For exchanges with inverted currency in the currency of the parameter NAME_COIN
number or string 100%
COUNTORDERS Quantity all orders.
How many will be installed.
number Calculated based on deposit amount
QUANTITYORDERSINBLOCKS Quantity orders in blocks
How many orders will be simultaneously on the market.
number 0
HOLDQUANTITYORDERS To hold a given number of orders in QUANTITYORDERSINBLOCKS
(FAQ п.22)
boolean true
GREEDYFIRSTORDERSIZE Size of the "zero" order in the traded currency or percentage
Format: 0.1 or 5%
number or string 0
GREEDYFIRSTORDERSIZEINSECONDCURRENCY Size of the "zero" order in the base currency number 0
SIZEFIRSTORDERS The size of the first order in the currency being traded or in percent
Example: 0.1 or 5%
string 0
SIZEFIRSTORDERSINSECONDCURRENCY The size of the first order in the base currency number 0
SIZEORDERSMARTINGALE The size of the orders for Martingale (for Exponential - %, Linear - absolute number)
Example: 0.1 or 5%
string or number 0
CONTINUEMARTINGALEGRID To continue the grid Martingale when you restart the bot (saves the order size) boolean false
TRADINGPRICERANGE Price range allowed for bidding, absolute numbers or percentages.
Example:
3000/5000

10%/20%

10%

1000/10%

If not specified, no restrictions
string -
TRADINGPRICERANGEOTHER Range of prices, another currency pair allowed for trading, absolute numbers or percentages.
Example:

3000/5000

10%/20%

10%

1000/10%

If not specified, no restrictions
string -
OTHERPAIR Currency pair to monitor the price range. Specified as well as on the exchange.
Example:
btc/usd
string -
IGNOREORDERSATSTART Ignore the previously set orders at the start / restart of the bot boolean false
DELAYTIMECYCLES Delay in seconds before starting a new cycle
* for One orders: after execution of a profit order
* for Scalper: after TIMECLOSEORDERS
number 0
STOPLOSSABS Absolute price value for Stop Loss
(FAQ п.53)
number 0
BUYSTOPABS Absolute price value for Buy Stop
(FAQ п.53)
number 0
STOPLOSSFLOATING Percentage of price drop from High price to trigger a floating Stop Loss number 0

Important!

The size of the order for

SIZE_FIRST_ORDERS_INSECOND_CURRENCY
will be calculated by the formula SIZEFIRSTORDERSINSECONDCURRENCY / price

SIZE_FIRST_ORDERS
or
SIZE_FIRST_ORDERS_INSECOND_CURRENCY
select only 1 of the parameters!

GREEDY_FIRST_ORDER_SIZE
or
GREEDY_FIRST_ORDER_SIZE_INSECOND_CURRENCY
select only 1 of the parameters!

With the manual size of the first order RANGE_OFFSET does not work, and COUNT_ORDERS will be calculated automatically.

Offset orders

The possible indentation of the orders. Select one of the offered.

Option

Description Type Default
FIXPRICEFIRSTORDER Fixed price of the first order number 0
OFFSETFIRSTORDERSPERCENT Position difference of the first order in % number 0
OFFSETFIRSTORDERSPOINTS Position difference of the first order in points number 0
OFFSETORDERSPOINTS Position difference between orders in points number 10
OFFSETORDERSPERCENT Position difference between orders in % number 0
OFFSETORDERSEXPONENTIAL Position difference between orders is exponentially in % number 0
OFFSETORDERSBLOCK Position difference between orders is blocks in %
For example, in the first block orders will be indented 0.2, in the second block 0.4, etc.
number 0
RANGEOFFSET Range offset number 0

Parameter OFFSETFIRSTORDERS_PERCENT or OFFSETFIRSTORDERS_POINTS can be used in conjunction with any of the selected options.

To set the first order in the market, use

OFFSET_FIRST_ORDERS_PERCENT=-1
.

To limit the maximum indentation for OFFSETORDERSEXPONENTIAL use setting OFFSETORDERSEXPONENTIAL_MAX. Important! OFFSETORDERSEXPONENTIALMAX should be more than OFFSETORDERS_EXPONENTIAL.

Disable orders grid

Option

Description Type Default
DISABLEGRIDSELL Disable order placement on the grid for Sell orders boolean false
DISABLEGRIDBUY Disable order placement on the grid for Buy orders boolean false

Modules AutoConfig

Option

Description Type Default
DANGERPRICESTOP Bot stopping according to the price spike boolean false
DANGERPRICESTOPPERCENT The percentage of the price spike for the bot stopping number 9
DYNAMICSETTINGSTIME Dynamic time updating for auto options boolean false
DYNAMICOFFSETORDERS Dynamic order allocation boolean false
DYNAMICOFFSETINTERVAL The price check interval for the dynamic grid (in minutes) number 60
DYNAMICOFFSETPROFITDIVISOR The divisor of the change of the profitable order number 10
DYNAMICOFFSETINDENTIONDIVISOR Dividing the grid size number COUNTORDERS
TRENDDEFINITION Trend determination (Experimentally) boolean false
ABRUPTCHANGETREND Rapid trend reversal (Experimentally) boolean false
OFFMODULESAUTOSETTINGS Disabling all Autotune Modules boolean false

Options TREND_DEFINITION ABRUPTCHANGETREND only for strategy Scalper.

The option OFFMODULESAUTO_SETTINGS controls DANGERPRICESTOP, DYNAMICSETTINGSTIME, DYNAMICOFFSETORDERS, TRENDDEFINITION, ABRUPTCHANGE_TREND

Individual parameters strategies

All the strategies are mutually exclusive. If no strategy is selected, use the strategy of "Scalper".

Strategy "Scalper" and "Bollinger Bands"

Option

Description Type Default
TIMECLOSEORDERS Closing time of unused orders (min) number 5
TIMECLOSEORDERS_INACTIVITY Closing time of undemanded orders (min) number 15

Strategy "Scalper"

Option

Description Type Default
TYPESCALPER Scalper type of work. Value: 1 or 2 number 1
STEPBREAKEVENPERCENT Only for TYPE</em>SCALPER=1
Percentage of breakeven
number 50
TRADINGAMOUNTRANGE Range of random order size
Values are specified in the format start/end of the range.
string -

When using

TRADING_AMOUNT_RANGE
, the parameters
COUNT_ORDERS
,
SIZE_ORDERS_MARTINGALE
,
SIZE_FIRST_ORDERS_*
, etc. do not make sense and will be ignored.

Strategy "Bollinger Bands"

Option

Description Type Default
BBANDS Bollinger Bands (Trend strategy!) boolean false
BBANDSDEVIATION Deviation number 2
BBANDSPERIOD Period BBANDS number 20
RSITYPE rsi or stochrsi string rsi
RSIPERIOD Period RSI number 14
RSIRANGESELL RSI range for sell
Values are specified in the format start/end of the range.
string 70/100
RSIRANGEBUY RSI range for buy string 1/30
TIMEFRAME Time-frame. Interval of interrogation of the prices (minutes) number 1
CLOSEGRIDOPPOSITE Closes the opposite orders grid boolean false
SAVEPRICEFILE Save price cache to a file boolean false
PRICEFILEPATH A custom path to the directory with the file string Folder with bot

If

RSI_PERIOD = 0
, then the indicator is disabled and trading occurs only on the BBANDS indicator!

If you use the

SAVE_PRICE_FILE
option, you need write access to the directory. Note that if you run the bot and the real market prices are different from those in the file, the original orders may get wrong and sell at a loss!

The parameter

SAVE_PRICE_FILE
will not work on PaaS platforms (Heroku, Pivotal and any other platforms where container virtualization tools are used)!

If the default bbands is used without external indicators, then orders are placed not on the bid and ask of the market, but on the borders of the bbands lines, respectively, the offset of the first order are also calculated from these values

Strategy "One Orders"

When you start the strategy of "Sell One, Buy a lot" the initial state of the balance of the base currency in the pair is ignored!

Option

Description Type Default
ONEORDERSSELL Strategy: "One Sell a lot Buy" boolean false
ONEORDERSBUY Strategy: "One Buy a lot Sell" boolean false
ONEORDERSOFFSET The difference between LastPrice and first order in the stack of orders in %.
Will pull the order, if this value is exceeded.
number 2
ONEORDERSPROFITPERCENT Specifies the percentage desired profit
May take a fixed value, and range min/max
string or number 1
ONEORDERSSPOPERCENT Sets the percentage of the desired profit when the price jumps. (delay before launch)
(FAQ п.61)
string/number 0
INTEGRITYCONTROLORDERS Integrity control orders (soft or hard) string soft
TYPEDATAUSED Where to get information about the used orders:
active - active orders
history - active orders + trading history
string active
FIRSTLOADINGHISTORY Download the history when you start the bot boolean false
NUMBERROWSLOADHISTORY Number of rows to load history number 100
LOADHISTORYDAYS The number of days of history
While only used for Poloniex
number 30
SAVEHISTORY Save a copy of history to your computer boolean false
CYCLESAUTOEXIT How many cycles to make the exit number 0
AUTOEXITPERCENT How much percentage should the price move away from the last profit of the order to complete the current cycle.
(FAQ п.62)
number 0
STOPLOSSPERCENT Stop Loss percentage number 0
BUYSTOPPERCENT Buy Stop percentage number 0
TRAILINGSTOPPERCENT Trailing stop percentage number 0
TRAILINGGRIDPERCENT Trailing grid percentage number 0
DISABLECAPITALIZATION Disable capitalization in profit order boolean false
CAPITALIZATIONBUYORDER Includes partial capitalization of Buy orders in DISABLECAPITALIZATION boolean false
STRATEGYAUTOREVERS Auto switching strategy to reverse boolean false
OFFSETLASTORDERPERCENT The percentage of the price distance from the last order to enable auto-switching of strategy number 5
PERMANENTDEPOSIT Use the total deposit calculation together with the trades history boolean false
PRICETRADINGTYPE_CHANGE Price at which the trade type will change (Absolute value and percentage)
Format:

number
or
low/high

Example:
3000

3000/5000

10%/20%

10%

1000/10%

(FAQ п.58)
number or string -

If the parameter INTEGRITYCONTROLORDERS in

hard
mode, then a sell order will be installed only if the volume installed and executed buy orders will be the same.

If the parameter FIRSTLOADINGHISTORY included, will be loaded into the cache the first

NUMBER_ROWS_LOAD_HISTORY
BUY orders before the first SELL order for the selected pair and put a SELL order on the basis of these data.

Option DISABLE_CAPITALIZATION=true activates

INTEGRITY_CONTROL_ORDERS
on hard.

Additional options

Notifications

Option

Description Type Default
NOTIFICATIONPAIR Notification pair of rate changing (For example:
btc/usd, ltc/usd
or all/all for all pair)
string -
NOTIFICATIONDEVIATIONPERCENT In what percentage should the price spike for the notification to work number 5
MONITORINGPAIR Pairs for monitoring.
(For example:

btc/usd, ltc/usd
, or just a pair currency, for example:
btc
).
If none of that is set, ALL available pairs will be monitored on the exchange.
string All pairs
NOTIFICATIONERRORCOUNT The number of errors in 5 minutes for notification number 0
NOTIFICATIONORDERISEXECUTED Notice of execution of one orders boolean false
NOTIFICATIONEND_GRID Notification of the end of the order grid. Notification will be sent if there are less than 3 orders left boolean false

Log

Option

Description Type Default
LOG Calculating log output of auto settings boolean false
LOGDEBUG The output of the debug log boolean false
LOGTRANSPORTS Where to write the log:
0 - console
1 - file
2 - console and file
number 0
LOGPATH A custom path to the directory with the log string Folder with bot
LOGTREE Save logs by directory year/month/day boolean false

Error processing

Option

Description Type Default
NUMBERCHECKDATA How many times to check the data.
Use the value 2 or more.
0 - off
number 0
AUTORESTARTHANGING Auto-restart of the worker in case of his hangup (error message: "Worker does not meet" ) boolean true
RESTARTTRADERTIME How many seconds to wait before re-querying the data after network errors number 5

Other parameters

Option

Description Type Default
TIMEZONE Time zone Database Time Zones string Asia/Yekaterinburg
EXCHANGEFEE The Commission for transactions of the exchange number 0.25
DELAYREQUESTAPI The delay of requests to the API in milliseconds number 200
DELAYBETWEENMODULES Then delay in seconds between execution of consecutive modules. number 3
TITLE The title of the console window. string GBot
LANGUAGE The language of the interface (

ru
or
en
)
string ru
NODEENV Value production activate:
1. error notifications by E-mail.
2. prohibits the use of conf-dev.js.
3. disabling colors in logs.
4. disables TITLE
string dev
BOTTRADE Allow trading boolean true
URLSTATISTICS URL of the server where the statistics will be sent in post json format string -
REPEATCOMMANDACTION Will duplicate command to install/re-opening to fully execute the commands /sellall, /buyall, stoploss, etc boolean false
SAVE_STATE Saves the internal state to a file at shutdown. When restarting, it is restored from the file, ignoring the first stage of initialization and skipping all the initial calculations boolean false

Important:

  • If you've changed LANGUAGE send a command
    /start
    in Telegram bot for a new language initialization in Telegram

The settings for the DEMO module.

To enable the Demo module and emulate the trades select the option

EXCHANGE=demo
.

Option

Description Type Default
DEMOEXCHANGE The choice of the exchange to emulate string -
BALANCECOIN Virtual balance of the first coin number -
BALANCECOINTWO The virtual balance of the second coin number -

Run

$ npm start

For Windows

Create a start.bat file, specify the necessary parameters in it and run this file. ``` SET TELEGRAMTOKEN=110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw SET TELEGRAMID=12345678

SET DEPOSIT_LIMIT=80%%

....

npm start pause ```

Attention!

The percentages settings for Windows are specified by a double percent sign (%%)

For Linux and Mac

Create a start.sh file, specify the necessary parameters in it and run this file. ``` export TELEGRAMTOKEN=110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw export TELEGRAMID=12345678

export DEPOSIT_LIMIT=80%

...

node ./build/server ```

For Heroku

heroku ps:scale web=0
heroku ps:scale worker=1

To launch the control panel in a Telegram, send a message to:

/start

Additional commands in Telegram:

/info               - list of all commands

/version - The version of the bot /params - Parameters which can be changed via Telegram /params_no_comment /martin [cache] - A theoretical calculation of the orders of the martingale (parameters are taken from config) /ticker coin_name - Shows a quote of a pair coin_name /trade - Switches to the specified trading pair /stop [codeExit] - The application shutsdown. codeExit - an optional exit code. /sell_all - Sell on the market immediately. (Attention: The sale will be made without confirmation!) /buy_all - Buy on the market immediately. (Attention: The buy will be made without confirmation!) /restart - Restart GBot Trader /stats - Trading statistics /note [ignore text] - The text in this line will be ignored. It can be used as a comment. /stoplossfloating - Displays Stop Loss Floating information /stoploss - Displays StopLoss information /buystop - Displays BuyStop information /trail - Displays Trailing Stop information /getbalance - Displays the start balance /setbalance number - Sets the starting balance /addbalance number - Add coins to the starting balance

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.