Bachelor+ Benefit: GBULIVE Sun Apr 29nd 9am US Central UTC-5h (2pm UTC/GMT) (password protected)

GBULIVE Topics for this week: Topics: (subject to change) This Week In Gunbot Coin and Exchange News gunbot-monitor (gmon) for Gunbot version 9 Tip of the Week Q&A (post your questions in the Slack on the gbu_bachelor post or at time of meeting) Note: GBU Live session will be targeted to about one hour. GBU …

Know Your Limits

Know your limits

Configuring Gunbot can be an art, and it can be a science.  One of the most basic configuration elements is setting the proper limits to tell Gunbot how much to trade.  This article explains those basics and then some tips on how to avoid mistakes.

Know your limits

What’s Going On

Gunbot needs to be told what to do.  It needs to know what pairs you want to run, what strategies to run on those pairs, what Telegram account to notify of massive profits, and so much more.

One of the most fundamental pieces of information Gunbot needs to know is your budget.  Some people trade with very low amounts… skirting with the minimum order size that the Exchange will allow, and others trade with amounts that would make most people’s head spin.

In order to tell Gunbot your budget, you don’t tell it the total amount you have to play with, nor will it assume all the crypto you have in your account is fair game and auto-budget itself. It must be told how big each trade should be, and needs to know how to tell if an amount is too small to care about.  These small amounts, also called “dust”, might prevent Gunbot from trading if it’s not told to ignore them.

Limits Explained

Like with any configuration element, your first trip to learn about it should be the official Gunbot wiki.  That’s where the latest intel resides about variables, default settings, strategies and what’s latest in the most recent version.

Let’s see what the wiki has to say about these limits:

Parameter Default value Description
TRADING_LIMIT Strategy dependent Values: numerical – represent an amount in primary trading currency. This value defines the trading limit for limit buy orders placed by Gunbot. A value of 0.001 would place maximum orders of 0.001 BTC when used on a BTC_x pair. Only use whole numbers for fiat pairs.
MIN_VOLUME_TO_BUY Strategy dependent Values: numerical – represents the total value of a coins holdings in base currency. Sets a threshold for buy orders. If you own less than the set amount, buy orders will still be placed. This prevents owning very small quantities (dust) blocking buy orders. Only use whole numbers for fiat pairs.
`MIN_VOLUME_TO_SELL` Strategy dependent Values: numerical – represents the total value of a coins holdings in base currency. Sets a threshold for sell orders. If you own less than the set amount, sell orders will not be placed and the bot goes into buying mode again.

So, the first thing we learn is that TRADING_LIMIT does not represent your entire budget – it’s the amount Gunbot will trade per pair.  This is important, because every new pair you add to a Gunbot instance can possibly spend at least TRADING_LIMIT amount of your funding currency.

Use funding currency terms

Speaking of funding currency, that’s the second thing we need to know about TRADING_LIMIT  The amount you put as this value needs to be expressed in the same coin as you are using as the funding currency.  In Gunbot, this is the first coin of the pair.  For example, if the pair you run is BTC-OMG , then “BTC” is the Funding Currency (aka “base”) and OMG is the coin you want to buy (aka “quote”).  If your pair is ETH-LTC then Ethereum is your base and LiteCoin is your quote.  In Gunbot’s terms, the base comes first and quote comes second.

Note: As of Gunbot v7, all pairs are denoted in “BASE-QUOTE” format with a dash in the middle, regardless of how the Exchange expresses or denotes the format.  For example, Cryptopia might say “ETH/BTC” with a slash, or Kraken might put it backwards and use “XLTCXXBT” with an extra “X” in front of each asset, but only some, but Gunbot’s notation would be ETH-BTC for the Cryptopia example and BTC-LTC for the Kraken example.

So, put the TRADING_LIMIT in the same terms of the base.  If you run BTC-xxx pairs, then you should put the limit in as a Bitcoin amount.  ETH-xxx pairs need Ethereum values as the limit.

FIAT is “special”

There’s a special case for FIAT pairs (USD, EUR, USDT, TUSD, etc) where not only do you need to put the amounts in FIAT terms (100 for $100, for example instead of 0.001 BTC for a $10k bitcoin value), but you also need to not use any decimals.  WHOLE NUMBERS ONLY

Good:

TRADING_LIMIT: 120

Bad:

TRADING_LIMIT: 120.50

TRADING_LIMIT: 0.001

This goes for all “currency value” settings: TRADING_LIMIT, MIN_VOLUME_TO_BUY, MIN_VOLUME_TO_SELL, and FUNDS_RESERVE.   It also applies to Ping Pong Strategy variables PP_BUY and PP_SELL.

MVTB and MVTS – what are they?

The other two main configuration elements regarding actual money values are MIN_VOLUME_TO_BUY (MVTB) and MIN_VOLUME_TO_SELL (MVTS).  These help Gunbot understand when to buy and when to sell.

Dust explained

“Dust” is a term crypto traders use to describe very small amounts of crypto in an account.   Just like when you use a saw to cut some wood, the action of sawing not only gives the intended result (wood that is cut), but it also produces material as a side effect of performing the sawing — namely, dust.

Dust is important to understand, because you can accumulate dust in many ways in the crypto world.

For one, if you have, say 10.05634 EOS coins in your account, and you are only able to sell 10 of them, you will have 0.05634 EOS left in your account.  This might happen because your sell order couldn’t be matched up to an exact sell order that filled all 10.  Maybe your order was matched up to two buy orders – one for 6 EOS and one for 4 EOS.  Then when it came to try and get rid of the remaining amount, the order would be too small for the exchange to honor.

Another way you might get dust is from small micro-deposits, such as from Binance’s referral program.  Binance gives fee commissions for anyone you refer. It started off at 50% and is currently 20%.  So when someone you refer makes a trade, they have to pay a fee on that trade.  You get 20% of that fee.  The fee is already small – usually 0.1% if no BNB is used and 0.05% if BNB is used.   Therefore you’d be getting 0.02% or 0.01% of their trade, which is almost guaranteed to be a miniscule amount.  This becomes dust in your account.

MIN_VOLUME_TO_BUY (MVTB)

This setting allows Gunbot to avoid dust.  Normally, dust clogs up Gunbot and prevents it from trading.  Basically, it won’t initiate a trade if you already own some value of the coin.  However, since “dust” needs to be ignored, Gunbot needs to know what you consider “dust” vs “substantial enough to notice”.

Once you have at least MVTB amount of coins in your account, Gunbot goes into sell mode.  If you have less than MVTB coins, Gunbot is in buy mode.

MIN_VOLUME_TO_SELL (MVTS)

After reading the wiki entry for MVTS, you might think it’s basically the same as MVTB, since it says “threshold for sell orders”.

However, there’s a difference between when Gunbot should be in a Buying mood (crypto amount is less than MVTB) and when Gunbot should be allowed to sell (crypto amount is more than MVTS).

There’s also a difference between Gunbot being in a selling mood and Gunbot being allowed to sell.

How to Set Appropriate Limits

Now that we’ve reviewed a ton of detail on each of the settings, you might just be asking “ENOUGH ALREADY!  WHAT DO I PUT HERE?!?!?!”

Here are some tips on how to set the right amount:

Rule #1: MVTB must be less than or equal to TRADING_LIMIT.

Rule #2: MVTB and MVTS must be greater than or equal to the Exchange’s Minimum Order Size.

If you set this too low, then Gunbot will attempt to make orders, but the Exchange will kick them back.  It’s not like Gunbot is going to auto-increase the values for you – it is your money after all.

Rule #3: It’s ok and common for MVTB and MVTS to be the same

You can set MVTS higher, but be careful that you don’t make Gunbot stop selling while it’s unable to buy.  Most commonly, these two values will be the same amount.

Rule #4: It is highly recommended that TRADING_LIMIT be higher than MVTB  to avoid the “Double Buy Exploit“.  Target would be 3x to 4x, but it’s usually enough to make it 1.5 to 2x.

Many people, and the defaults in previous versions of Gunbot helped with this, use the same amount for `TRADING_LIMIT` and `MVTB`.  However, if you do this, then you are subject to experiencing the “Double Buy Exploit”.  It’s not an actual exploit from a security perspective, and it’s not a bug in any way.  It’s just a consequence of Gunbot doing exactly what you told it to do.

Rule #5: If you’re too Greedy, you’ll suffer in bear markets

Many beginner crypto traders, and especially Gunbotters, look to their right and see someone who has tripled their money with amazing trades.  They look to their left and see another person who’s made 10X gains and brags about the constant profits.

So, naturally, they think that’s what crypto is, so they set Gunbot running and give all their BTC to Gunbot.  It might work for a little while, but eventually the bear cycle comes around and BAGS happen.  And because they were greedy and gave all their BTC to Gunbot, Gunbot did exactly what it was told to do, and pretty soon, all the BTC is gone and all the trader has is a bunch of heavy bags that have lost value.

We at GBU recommend you use much less than all your BTC when botting.  First, you need room to handle your bags.  Bags happen to everyone and there is no magic formula to eliminate all of them fast, cheap, and cleanly.  You should always keep dry powder, and use much less budget than you think.

When I started off, I used the lowest amount both you and the exchange can stand, and only ran enough pairs that I used 10-20% of my available BTC.  This gave me enough room to learn Gunbot’s settings, to make sure I didn’t make wild mistakes, and when the bear market came, I had plenty of BTC to move to other pairs, use Double Up or move my bags off to another wallet.

With the above guidelines, you should be good to go.

Double Buy Exploit

Example: let’s say you run BTC-ETH pair and have 0.002 set for both TRADING_LIMIT and MVTB.  This means when you have less than 0.002 BTC worth of ETH in your account, Gunbot feels like buying.

Then, ETH becomes tasty and Gunbot buys some.  It buys 0.002 worth and it’s now in your account.

Well, Gunbot usually buys on a downtrend, if it’s configured like most people want.  If ETH value continues to drop after Gunbot purchases it, then you will have, say 0.00195 BTC worth of ETH in your account.

If this value stays there for the next cycle, and Gunbot has a low TRADES_TIMEOUT and isn’t using the safety switch, then, per the rules you have configured, 0.00195 BTC worth of ETH is now considered “dust”.  It’s free to buy again!  If the conditions are still ripe for buying, Gunbot will then purchase another TRADING_LIMIT amount of ETH (0.002) and it will be added to the wallet.

Now you have 0.00395 BTC worth and that amount is greater than MVTB, so it won’t buy again.

This shows up as a “double buy” in your trading history, because it will show two purchases of 0.002 close together. You might think Gunbot is double-buying by mistake, but it’s doing what you told it to do.

Exchange Minimum Order Size

At time of writing, here are the different Gunbot-supported Exchange minimums:

Exchange Minimum
(BTC)
Notes
Binance 0.001 Binance used to be 0.001, then changed to 0.002 and is now back to 0.001.  It also has additional minimum requirements more than just order size, such as minimum number of coins. Also, many coins must be purchased in whole numbers and not fractions (this doesn’t impact TRADING_LIMIT, however – Gunbot will automatically round the order to a whole number when needed). Binance also publishes their Trading Rules online.
Bittrex 0.001 Bittrex used to have a 0.0005 limit and then issued an announcement in November 2017 where they said the new limit is 0.001.  However, we’ve seen that we can still place orders for 0.0005 for many coins, if not all of them. Maybe Bittrex is slow in implementing and enforcing the rules, but GBU recommends following the published guidelines.
Poloniex 0.0001 Polo’s minimum is the same for all the funding currencies – BTC, ETH, XMR and USDT.
Kraken 0.002 Kraken’s minimum orders vary by currency – 0.002 is the BTC minimum.  You can view all the details on Kraken’s article about the topic.
Cryptopia 0.0005 This is from experience and forum posts vs an official post by the company.  It used to be 0.0001.
Bitfinex <varies> The official Bitfinex post about exchange minimum order size states:  “The minimum order sizes for each trading pair is periodically adjusted to maintain order sizes that are reasonably proportioned to their values. The ultimate goal is to keep the minimum order size between 10-25 USD equivalent value while limiting the changes to the minimum order sizes to useful incremental values.
CEX.io <varies>
0.002
According to CEX.IO’s guidance posted on their website, they say:
“Trading on CEX.IO is flexible in terms of order placement, however, there are certain limitations.You can always check them by typing in https://cex.io/api/currency_limits into your address line.”BTC is listed at 0.002.  Other currencies have their respective limits.
GDAX  0.001  GDAX publishes their minimums for trading, withdrawals and deposits on their support site.

 

Summary:

  1. Make `MIN_VOLUME_TO_BUY` and MIN_VOLUME_TO_SELL at least as big as the Exchange’s minimum order size.
  2. Make TRADING_LIMIT higher than `MIN_VOLUME_TO_BUY`.
  3. Make `TRADING_LIMIT` as low as you and the exchange can stand while you learn how to configure Gunbot and learn the market cycles.
  4. When using FIAT pairs, use whole numbers only (no decimals).

CEX.io Guide: How to create an API Key for Gunbot

Retrieving the API keys is mandatory. It is the interface that will allow the robot to ‘speak’ with the exchange. Depending on the exchange, the method to retrieve the API key can change. A) First, login to your account with your credentials. Create an account if you haven’t done so previously. Image: You should login …

Bachelor+ Benefit: GBULIVE Sun Apr 22nd 2pm US Central UTC-5h (7pm UTC/GMT) (password protected)

GBULIVE Topics for this week: Topics: (subject to change) This Week In Gunbot Coin and Exchange News Gunbot v9 DEEP DIVE Tip of the Week Q&A (post your questions in the Slack on the gbu_bachelor post or at time of meeting) Note: GBU Live session will be targeted to about one hour. GBU BACHELORS and …

Binance Fees Explained

If you use Binance, you might wonder about how differently they handle fees, and their BNB coin, and what you can do about it..

What’s Going On

At time of writing, Binance is the top fee-based CryptoCurrency exchange on the market.  By a huge margin.  They offer many pairs, lots of volume, have a decent interface and the API works most of the time.  It’s one of the top exchanges used by Gunbotters everywhere due to the profits gained.  Professor Bitlion wrote a series on “The Best Exchange of Them All” (GBU premium content) where he helps people choose which exchange would best work for them.

Binance introduced something revolutionary when they launched – they have their own cryptocurrency token, called BNB, that can be used for paying Trading Fees.  A Trading Fee is what all centralized exchanges charge for making or taking trades.  Some exchanges have a flat fee for all trades; others charge a different fee for makers and takers (the maker is the one who places a new order on the order book and the taker is the one who fills an existing order on the order book), and still others charge a sliding scale of fees based on volume, such as how much volume in the last 30 days.

In most if not all of those exchanges charging fees, they usually take their fee from one of the coins in the transaction.  For example, if buying LTC (LiteCoin) with BTC (Bitcoin) on Bittrex, then Bittrex takes 0.25% out of the trade from BTC.

Binance still supports that style of trading fees – the fee can be taken out of the purchased coin (not the funding coin).  But if the trader has BNB coin in their account, and has enabled the function “Use BNB for Fees”, then the fee is paid from the BNB coin instead of either the funding or the purchased coin.  This is what is new and different from the other exchanges.

The Good Points

As a Gunbotter or Day Trader or even a casual hobbyist, there are several positive traits of using a 3rd currency such as BNB to handle fees.  In fact, if someone is Gunbotting, it’s essential they understand what BNB can do for them, so they avoid losing out on the benefits.

Trading Fee Discounts

First, Binance currently offers a major discount on fees if you pay for fees with BNB.  For the first year, fees paid with BNB enjoy a 50% discount.  Binance fees are already some of the lowest around, with 0.1% being what they charge.  Compare this to Bittrex’ 0.25% and you have my attention.

The fee discount is on a schedule:


This notice was published around July 2017 so we still have some time to enjoy the 50% discount.  Then it will drop to 25% discount, and so on.

This means that instead of paying 0.25% + 0.25% at Bittrex for a normal trade – buying something and then selling it later – for a total of 0.5%, you can pay just 0.1% total (0.05% + 0.05%) for the same trade.

An 80% savings in fees is incredible, especially for Gunbotters who generate a flurry of trades 24×7.

Keeping Coins Whole

The second major reason for using BNB, especially when you use Gunbot and make a lot of trades, is that the coin you buy and the coin you buy with are both kept whole.  Since Binance requires most coins to be transacted in whole amounts, or on some coins only allowing one or two decimals, this becomes increasingly important.

Here’s an example of a typical trade without BNB:

  1. You configure Gunbot to run on BTC-EOS pair with a typical minimum TRADING_LIMIT of 0.001.
  2. Gunbot buys 0.001 BTC worth of EOS.  It has to buy them in whole number increments, so it buys 2.00 EOS
  3. The fee (0.1%) is calculated from the value of the trade and then the fee is paid with the bought coin (EOS).  So, EOS is re-evaluated in BTC terms and 0.1% of the value is deducted from the resulting EOS you receive.
  4. You are now the proud holder of 1.998 EOS
  5. Imagine the value of EOS went up.  CHA-CHING!
  6. Gunbot sees the price has gone up according to the strategy you run.  It goes to sell the EOS, and sees that it has 1.998 EOS to sell.  However, Binance requires whole numbers, so it rounds down to 1.0 EOS
  7. It tries to place a sell order for 1.0 EOS, but that is less than 0.001 BTC worth.  Binance kicks back the order, saying “your order needs to be at least THIS big to tradeGo home, kid.
  8. You are now stuck with this EOS bag until the coin doubles or you manually fix it by buying more EOS at the current price.

Now, here’s the same trade, but with the trader owning BNB:

  1. You configure Gunbot to run on BTC-EOS pair with a typical minimum TRADING_LIMIT of 0.001.
  2. Gunbot buys 0.001 BTC worth of EOS.  It has to buy them in whole number increments, so it buys 2.00 EOS
  3. The fee (0.1%) is calculated from the value of the trade and then a discount is applied (50%), so the fee ends up being 0.05%.  The fee is paid with the BNB coin.
  4. You are now the proud holder of 2.0 EOS
  5. Imagine the value of EOS went up.  CHA-CHING!
  6. Gunbot sees the price has gone up according to the strategy you run.  It goes to sell the EOS, and sees that it has 2.0 EOS to sell.  It knows Binance requires whole numbers, so this is fine.
  7. It tries to place a sell order for 2.0 EOS, and the order goes through because it meets the minimum order size.
  8. You have now profited.  Continue the cycle again, because that was fun!
Result: Using BNB for fees keeps your purchases whole so that you can more easily sell them.

It also helps tremendously with profit calculations since the fee is actually a separate transaction.

The Catch

We’ve gone over a couple major benefits to using BNB for fees. However, there is a catch to trading at Binance that should be pointed out.

As mentioned briefly in the example above, Binance disallows fractional trading on most coins, and on the other coins, it allows it but only to 1 or 2 or 3 decimals, depending on how expensive the coin is.  Said another way – at Bittrex, I can sell 1.99988882 EOS without a problem.  At Binance, I cannot sell 1.99988882 EOS – I have to sell 1 or 2 or some whole number.

This means that for many trades, you collect “dust” – which is a small amount of a coin left over or hanging around in your balance – that you cannot sell!

You don’t just collect dust from trades made without BNB token to pay the fees.

Dust from Binance referrals

Dust can also collect if you participate in Binance’s referral program.

Binance rewards affiliates by giving participants a percentage of the fees their referral pays.  This results in tiny micro-deposits of all sorts of coins, and the more you refer, and the more active they are, the more deposits you receive.

If someone you referred bought LTC with BTC, then they will pay 0.1% fee in LTC, and you will receive a percentage of that fee.  A tiny amount of LTC will just magically show up in your account.  And you cannot sell a tiny amount of LTC for BTC.

How to handle Binance dust

If you can’t sell a tiny amount of LTC for BTC, how do you handle it?  Is Binance tricking us all?

Well, this is the other use of BNB coin.   There are several coins on the BNB pair list.  You can’t sell a tiny amount of LTC for BTC, but you can sell a tiny amount of LTC for BNB.

Not every coin at Binance has a BNB pair.  For example, at time of writing, EOS doesn’t have a BNB pair.  So if you find yourself with a fractional amount of EOS, you are stuck with it until you collect more dust to fill in the gap to the next whole number.

But there are plenty of pairs that do provide a BNB option… and this is where you can periodically sell off your dust, or more likely for Gunbotters – purchase the dust you need to top off the coin to a whole number.

So, if you find yourself botting BTC-IOTA and then all of a sudden you have 0.8 IOTA you can’t get rid of, you can go sell it on the BNB-IOTA pair (IOTA/BNB in Binance terms).

The Bad Points

You probably thought “The Catch” was all there was.  Nope – there’s another catch.  And that’s if you use CoinTracking.info or other sites that pull trade history via API.

GBU gunbot university cointracking referral link discount

Normally, when CoinTracking pulls in trades from an exchange, it is able to discern the fee and includes this on the actual transaction.  For example, if you bought LTC with BTC, then this transaction would be one transaction in CoinTracking showing the purchase price and amount, the funding price and the amount, and then a fee and specify which coin was used for the fee.

However, with Binance, these fees are not associated correctly.  At time of writing, CoinTracking‘s recommendation is to create an additional transaction as [OUT] Lost for the fee.  That can result in a LOT of transactions for active Gunbotters.  Many Gunbotters have hundreds of transactions a day, so a manual correction is not feasible.

One would expect a more automated tool to address this in the future, either CoinTracking calculating it correctly, or a 3rd party tool to help run a report, find the fees and then insert the appropriate information into CoinTracking. I don’t know if a second transaction is feasible, but I can see a group-by-day or a group-by-week or a group-by-month offset transaction being entered to keep the BNB balance correct as well as appropriately handling fees for tax reporting purposes.

Summary:

  1. Using BNB can result in non-trivial discount on trading fees.
  2. Binance disallows fractional trading on many coins, which can clog up Gunbot.
  3. Paying fees with BNB can keep coins whole so you can easily sell what you bought and preserve profits.
  4. BNB coin pairs help A) sell off dust to reclaim stuck profit or B) purchase dust to make a coin’s balance whole enough to sell.
  5. Binance’s referral program creates dust, and must be handled manually.
  6. Tracking BNB Fees in services like CoinTracking.info can be difficult or inaccurate.

How to change port of Gunbot’s GUI for better security

As of Gunbot v8.0.3, Gunbot’s GUI (gunthy-gui) defaults to port 5000 and for security reasons, you might want to change it.

What’s Going On

Gunbot (XT, CS and RT) can run in two modes – by itself on the command-line (aka “Gunbot Core”) or with a GUI (aka “Gunbot GUI”).  Gunbot itself is the “gunthy” executable (named either gunthy.exe, gunthy-linx64, gunthy-macos, or gunthy-arm) and is what runs in both modes.  The GUI is optional.  The GUI (named gunthy-gui) presents a friendly interface for configuration, control and surface-level monitoring, and then runs the gunthy executable for you.

Both gunthy and gunthy-gui use what’s known as a network port to communicate with itself or other components.  For Gunbot, this is configured in the “ws” section of the config.js file and contains “port” and “clientport” settings- otherwise known as “Websockets”. For the GUI, this is an HTTP port, not configurable from the config.js file, and is part of the URL you can use to access the GUI, both locally on the box and from an external system.

The default port that Gunbot GUI runs on is 5000.  This means you would access “http://localhost:5000” when you’re actually accessing the system that runs Gunbot directly, or “http://<ip address>:5000” when accessing the system remotely.  If you have a DNS server or hosts file, you can configure those to point a user-friendly name to the IP address, such as myvpsisawesome.gunbotuniversity.com.  If you do that, you would still add the “:5000” at the end so the full URL is http://myvpsisawesome.gunbotuniversity.com:5000.

Why Security is Important to Some

If you leave the Gunbot GUI settings at default and use the default port of 5000, then you run the risk of being too-easily discovered by remote systems.  Once it’s known that the default port is 5000 for Gunbot, there are hackers, crawlers and systems such as http://shodan.io that can collect data and tell others that you’re running Gunbot.

I don’t know about you, but I’d rather my Gunbot GUI not be so easily found.  It won’t be long before we hear of some Gunbotter whose system was hacked, DDOS’ed or otherwise compromised and losses occur.

The first step in making your Gunbot more secure is to change from the default port.  There are other steps you can take, such as limiting the IP addresses that can talk to your server, and adding SSL certificate.  Those steps are not covered in this guide.

How to Fix

In order to change the default port that gunthy-gui uses, you need to set an “environment variable” called PORT to the port number you want the GUI to use.  Depending on what operating system you use, how you change this varies.

For Windows users, you set the port before you run the command:

set PORT=5003
gunthy-gui.exe

This should now make the GUI respond to URL with :5003 at the end instead of :5000.

You can also make a batch file to launch Gunbot GUI:

@echo off
set PORT=5003
start /d gunthy-gui.exe

For Linux/MAC/ARM users, you can do it all on one line.  From the directory gunbot is installed, running the following will launch the GUI and use port 5003:

env PORT=5003 ./gunthy-gui

If you use pm2, you can do the same thing on one line:

env PORT=5003 pm2 start ./gunthy-gui --name binance

Then use your normal pm2 list all and pm2 info binance and other commands to manage the gunthy-gui process.

Websocket port

It’s important to note that the PORT that the GUI uses to speak HTTP is not the “websocket” port or the “clientport” in the config file.

"ws": {
"port": 5001,
"clientport": 3000,
"hostname": "127.0.0.1"
},

This 5001 port here can be changed as well, but it needs to NOT conflict with any other port being used on the system.  You cannot use the same port for ws:port and PORT=xxxx.  They must be different ports.

Most of the time, you don’t need to change ws: port setting.  However, if you run multiple Gunbot instances on the same machine manually, then each port needs to be unique.

For example, the first time you install Gunbot on a machine, it can run with port:5000 for the GUI and port:5001 for ws:port.  If you put a second Gunbot instance in another folder and want to run it, you need to change ws:port from 5001 to something else, like 5003.  If you also wanted a second GUI running, you would use the changes described earlier, and maybe use 5002 for that.

Also, if you are accessing your Gunbot GUI from a remote system, you will want to change the hostname setting inside of ws to be the IP address or FQDN (fully-qualified domain name) of the machine running Gunbot GUI.  For example, if you’re using a VPS, you would put in the IP of the VPS. Otherwise, in Gunbot 8.0.3 and earlier, the GUI will be slow and open up a lot of websocket connections to a box that won’t respond.

For example:

"ws": {
"port": 5021,
"clientport": 3000,
"hostname": "4.2.2.1"
},

Or

"ws": {
"port": 5021,
"clientport": 3000,
"hostname": "myawesomegunbot.gunbotuniversity.com"
},

Gunbot version 9 no longer uses websockets and doesn’t require the hostname update.

Note: in previous versions, running multiple GUIs, even when changing the port, didn’t work well for me.  I haven’t tested it in version 8.  Instead, I just spin a new VPS for another instance so that I’m not subject to any IP address problems, resource constraints, or interoperability issues.

Summary:

  1. If you keep default settings for things like what port the GUI listens to, you increase your risks.
  2. It’s fairly trivial to change the GUI port so you’re not so easily found.
  3. The “PORT” environment variable dictates which port the GUI uses for HTTP.

 

Help me understand Gunbot’s MFI – Money Flow Index

Do you want to know more about Gunbot’s Money Flow Index, or MFI?  Here are some things you will want to know.

What’s going on

The BTC/USD money flow index (MFI) is calculated by Gunbot looking at the ASK book of BTC/USD and takes both price and volume information. It’s supposed to help indicate overbought or oversold conditions, much like RSI (Relative Strength Index) does. However, RSI indicator is price-only, and the benefit of the MFI is that it uses volume as well. Volume can help predict a pump or dump.

So, MFI is a volume-weighted RSI-type metric. If BTC/USD is oversold, the MFI number goes lower and lower. The idea is that oversold BTC/USD means the volume is growing on the ASK book, and that means there may be a pump of BTC soon.

MFI is a volume-weighted RSI-type metric

Why MFI is important to some

Anyone who’s been around crypto a while knows that pumping of BTC price might mean the altcoin’s value will drop in contrast. So, OKKIES_MODE is a feature Gunbot offers that allows you to temporarily stop Gunbot from trading if it senses a BTC pump coming up.

For a long time in crypto, when BTC “mooned” (shot up in value quickly), the altcoins bled in the streets.  There wasn’t enough liquidity or ability to buy alts with anything but BTC.  But as the market grew, and more ETH pairs, BCH pairs, XMR pairs, USDT/TUSD/USD pairs came online, there were more ways to buy altcoins than just with BTC.  For this reason, it’s more and more common that when BTC moons, so will several altcoins, which is different than it was for many years.

The original scenario of “BTC rises signals ALTs demises” is still valid for many pairs much of the time.  Because of this, if BTC rises and ALTs drop, Gunbot would normally see a price drop of an ALT as a buying opportunity.  It would buy the ALT and then be left with a bag because BTC kept rising and rising, and then set a new high and sit there.  The likelihood of the ALT price recovering any time soon was not very high.

OKKIES_MODE was created to help Gunbot prevent getting into a bag situation.

But more recently, it has indicated the opposite, so it’s not as hard and fast of a rule as it used to be.  For this reason, the savvy Gunbotter won’t just blindly turn this on or off – it doesn’t always mean it will protect against bags all the time.  It is recommended that Gunbotters review pair-by-pair what that specific coin pair’s likelihood is of tanking when BTC goes up.  You can use Allanster’s backtesting tuners on Trading View for help with that.  Check out the tuners on Trading View or two posts on Gunthy Forums: here and here.

How it’s Used

BTC_MONEY_FLOW is the setting in the config you want it to use as a threshold to decide whether to make trades or not.  OKKIES_MODE is what you set to true or false as to whether or not you want Gunbot to collect (v8) or care (v8 and v9) about this metric.

Default setting:

Most strategies come with default setting of “true” and “35” in Gunbot version 8.0.3.  TSSL Strategy uses default of “false” and “32”.

"OKKIES_MODE": true,
"BTC_MONEY_FLOW": 35,

On some exchanges, the MFI isn’t calculated easily or consistently.  Be sure to review console logs for the MFI values and make sure they are coming across, if you have OKKIES_MODE turned on.  In Gunbot version 8.0.3, if OKKIES_MODE is false, then the Money Flow Index values will show “undefined”.

When MFI has prevented Gunbot XT from buying, you will see a message that says

There is too much enthusiasm… waiting to buy

Summary:

  1. If Gunbot produces bags for you when BTC price pumps, consider enabling OKKIES_MODE and setting the `BTC_MONEY_FLOW` to 35 or lower.
  2. If your exchange or pair produces “undefined” results for MFI when you have `OKKIES_MODE` enabled, disable it.
  3. Before blindly setting this variable, research a coin pair’s history of reaction to BTC pumps.

 

 

 

Bachelor+ Benefit: GBULIVE Sun Apr 15th 1pm US Central UTC-5h (6pm UTC/GMT) (password protected)

GBULIVE Topics for this week: Topics: (subject to change) This Week In Gunbot (updates on Gunbot v9) Coin and Exchange News Picking the Right Exchange Tip of the Week Q&A (post your questions in the Slack on the gbu_bachelor post or at time of meeting) Note: GBU Live session will be targeted to about one …

How do I fix Telegram api – make sure that only one bot instance is running errors?

originalHost: ‘api.telegram.org’,
originalHostHeaderName: ‘host’,
responseContent: [Circular],
_destdata: true,
_ended: true,
_callbackCalled: true },
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
read: [Function],
body:
{ ok: false,
error_code: 409,
description: ‘Conflict: terminated by other getUpdates request; make sure that only one bot instance is running’ } } }

You might see this error in your err.log or console log or in the GUI.

What’s going on

Gunbot version 8 added direct Telegram support.  Whenever there are buys or sells, Gunbot can connect to the Telegram API and send you a message.  It requires a chatbot token, your Telegram id and an arbitrary label.

If you’re running just one bot, you might not see this very often.  However, if you run multiple bots (or the one bot is very busy), you may see this error.

First, don’t worry.  This error doesn’t mean there’s anything wrong with Gunbot, or your trades aren’t happening.  It only means you are missing out on a few Telegram Notifications about buys and sells.

Second, Gunbot caches the missed telegram notifications.  So, if it had a problem trying to send you a notification yesterday, it’s going to KEEP TRYING to send the notification, but it will most likely keep getting this error.  So, you will continue to see the error until you restart Gunbot.

How to Fix It

For Gunbot Version 8, there’s not much you can do to permanently fix the problem other than creating a different chatbot for each Gunbot instance.  And even that won’t 100% fix the problem.

According to several reports, such as this one, this problem is caused by an outdated set of code.  It’s most likely that Gunbot has this older node_modules compiled into it, and will continue to have the problem until the next version.  It is rumored that Gunbot v9 no longer has the problem, so GBU’s guess is that the newer node_modules was compiled into Gunbot v9.

In order to stop getting errors for the telegram notifications it’s continuing to retry, you need to restart Gunbot.  That clears the cache of missed notifications and it will stop retrying.  You’ll be good until the next notification that fails.

So, in summary:

  1. In Gunbot Version 8, make a different chat bot for each instance.
  2. Restart Gunbot to clear out old notification retries
  3. Wait for Gunbot Version 9, which supposedly fixes the issue.

 

 

 

How do I fix Cannot read property ‘askPrice’ of undefined error?

TypeError: Cannot read property ‘askPrice’ of undefined
at Binance.parseOrderBook (C:\snapshot\Gunbot-master\ctx\js\binance.js:0:0)
at module.exports.fetchOrderBook.Promise.binance.allBookTickers (C:\snapshot\Gunbot-master\ctx\js\binance.js:0:0)
at Request.module.exports._makeRequest.request [as _callback] (C:\snapshot\Gunbot-master\ctx\helper\binance\binance-api.js:0:0)
at Request.init.self.callback (C:\snapshot\Gunbot-master\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (C:\snapshot\Gunbot-master\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (C:\snapshot\Gunbot-master\node_modules\request\request.js:1085: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:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9

You might be getting this error and wondering “what did I do wrong?”  “How do I fix it?”  “Why does botting hate me?”

This error message – keyed on the TypeError: Cannot read property askprice of undefined tagline – usually means one MAJOR thing is wrong with your configuration.

One of your pairs is wrong.

“But, my pairs are right!” I can hear you saying.  Check again, I say.

Gunbotting isn’t a science – it’s an art.  Go through your pairs and actually check on the exchange if they exist. Gunbot does what you tell it to do, even if it’s wrong.

For example, if you’re running Binance, and you didn’t correct the typo in the default config, you might be running BTC-IOT instead of BTC-IOTA.

If you use the GUI, and gunbot and Trading View support the exchange, then the graph will show you if the pair is good or not.  If you see an actual graph, then your pair is for sure good.

However, if you see “Invalid Symbol” then that’s telling you that the pair is no good.  Remove it.

invalid symbol

If you’re sure the pair name is correct, then it could be an API error, or, in some cases, the Exchange allows the coin to be traded normally (ie, through the web interface) but the Exchange doesn’t allow API trading.

Other things to check if all else fails:

  • Ensure your API key is valid on the Exchange.
  • Ensure your time is synced properly
  • Make sure you’re not banned from the Exchange on a temporary IP ban or a permanent ban.