Instruction manual (with full description of the algorithm of the bot operation):
A bot is a set of services that are configured to perform automatic trade with your parameters on some exchanges. In other words, services bots constantly send requests to exchanges, receive the current status, and based on the embedded algorithm send teams to the exchange to create / withdraw orders.
From your point of view, the bot is something that works somewhere in the cloud and has a page control accessible through a browser.
What is API Key
To work the bot needs a special access key - API Key, consisting of two values - public and secret parts. Depending on the exchange API Key can have a different appearance. This key allows the exchange to identify and approve requests from the bot, linking them to your account. Get the API key (generate) in Exchange settings.
The list of operations that can be performed using these keys is strictly is regulated and must be defined by you when creating the key. As a rule, key must be the right (more precisely, the one who uses the key) to receive account information (info) and trade (trade).
In no event should the key be given to the input-output of funds (deposit / withdraw)!
Bot does not need these rights.
How does the API key work? Each request to the exchange through its API (interface
access through which the bots work) is encrypted using the secret part key. The exchange, in turn, deciphers the requests. In this way it is guaranteed that the request was not forged along the way (after all, the secret part is knownonly the sender and the receiver).
The exchange also monitors the query sequences using unique numbers are nonce. The bottom line is that with each request is transmitted special numeric parameter is nonce. And in each request it should be more previous. If the number is less, the exchange will reject the request.
The Key API access key should not be used anywhere except the bot.
I will give an example. The bot is running and the last request sent nonce = 1000. Next you entered the same key in another program, it sent a request with nonce = 5000. All working. Then the bot sends its request with nonce = 1001 and the exchange discards it with message that the nonce should be greater than 5000. All, the bigger the bot will not be work with this key and you need to change the key.
Supported exchanges
Initially, the bot was created to work with BTC-E, but then support was added still a number of exchanges. At the moment, the bot supports working with WEX (ex BTC-E), Bitfinex, Bittrex, Poloniex, Exmo. You can work with any pair that is supported by the exchange, and it can also be changed in the control panel. Limitation one - the bot can only work with one pair at a time. If you want to
To trade at once on two pairs or more - you should register so much different bots, how many pairs are planned.
Work algorithm
Orders created by the bot can be of two types: macro and fix. Macro order is order from the procurement table (for Long) or the sales table (Short). Fix-order is a warrant in which the profit is fixed (sell for the Long and buy strategies for strategy Short).
The bot can work with two types of algorithm - the so-called Long and Short. The names of the algorithms are given quite arbitrarily, and they mean only that the first works like "first bought, then sold more", and the second as "first sold, then I bought it cheaper. " In other words, the bot's Short algorithm does not mean that you will shorten the borrowed funds. The general essence of both algorithms is the same.
You need to understand that the bot does not look at the stock exchange continuously. Bot expose orders for purchase, and then once a minute (mostly) checks the availability of their orders for exchange. If at the next check it turns out that there is no warrant any more -
the bot believes that it is executed by the exchange. The interval of this cycle is 1 time per minute.
In the original version of the bot, he worked on an extremely simple algorithm: he bought the asset one order, and put it on sale at a higher price, too, one order. Such trade is not very effective, since it implies that the price should always jump up from the purchase. In the case of its fall, such an algorithm powerless. Therefore, the algorithm was modified.
A key feature of the new algorithm (further all in the example of Long strategy, for Short all the way around): The purchase is not a single order, but with the help of called the purchase table. In other words, if you want to spend on purchasing a certain amount of money, you are not purchasing one order, but break it into many smaller orders, each of which is cheaper previous. So if the price falls, then you buy more and more asset. The more, the further the price falls. At the same time, a fix order (sale) it is always displayed one, no matter how many purchases were made. Wherein the amount of fixation will be equal to the amount of purchased funds (total), and the fix price will be equal to the price of the purchased asset plus profit. What does it give? This gives the fact that every next completed purchase order, the total price of the asset falls, and the fix order is also lowered, as if following the price. This greatly increases the chances of its execution in a rebound.
Consider how the purchase order table is calculated. For calculation tables we need the following parameters (they are specified in the strategy settings):
- Number of orders. It is clear - how many orders will be created (how many orders will be split purchase)
- Indent the first step. When the bot calculates the purchase table, it is based on the price of the last transaction on the exchange (LAST price). Indent the first step shows how much the price of the first purchase order should be less than the LAST price. Indicated as a percentage of the LAST price. Instead of indenting the first step in percent can specify a fixed value of the price the first step.
- Overlap of the price. Shows what percentage of the price will be covered table. In other words, the difference between the most expensive and the cheapest order.
- Martingale. Shows how much the volume (price * amount) of each more a cheaper order should be more than the previous one.
- Logarithmic distribution. Whether or not to use logarithmic order distribution. See below.
The logarithmic distribution of orders
By default, when the bot considers a table of purchase orders, it calculates prices orders linearly, distributing them evenly over the entire overlap of the price move. In other words, if you have 6 orders and an overlapping price range from 100 to 50, then the order prices will be 100, 90, 80, 70, 60, 50. In real life we put quite a large percentage of the overlap in the course of the price to insure against sudden sharp and deep fall in prices. But the main price fluctuations usually occur near the price of LAST, so with this distribution a significant part of the depot does not participate in the bidding. To involve more money in the auction (naturally, by increasing risks), one can use the logarithmic order distribution. In this case, the concentration of orders varies from more frequent near the price of LAST to the rarer by the end of the table, something like this: 100, 95, 87, 78, 65, 50.
Limits of the exchange for orders
All exchanges have certain restrictions imposed on newly created orders. For example, there are restrictions on the minimum amount of asset in order. For the pair BTC / USD this is, say, 0.01 BTC. An order, is that buying or sale, for a smaller number of BTC will be rejected by the exchange. This limit for each exchange and for each pair of its own. Therefore, there is an optional limit the minimum number of depots for trading a bot. It works this way.
You started the bot and he counted the table of purchase orders. Further the bot checks, whether the smallest warrant corresponds to the limits of the exchange. If the order is obtained less than permissible - this means that your depot is not enough to create the entire the requested purchase table. In this case, the bot takes the volume of the first order equal to the minimum allowable and recalculates the entire table on the basis of new data. In this case, you do not have enough depot to create all requested orders, and the bot creates only those for which the depot is enough, starting with the most expensive orders (it's the smallest in volume). In exceptional cases, the depot may not grab even one order - then the bot will not try to create anything at all.
Accounting commissions of the exchange and limits on orders
Bot takes into account the commission fees automatically. In the case of creating orders for
the minimum allowed number, as described in the example above, the bot adds to the minimum allowable quantity of purchase is also the commission of the exchange, so that after the Exchange executes the purchase and takes away its commission, the account the amount that satisfies the minimum amount to create fix orders. For example, for the above case with BTC / USD and the BTC-E exchange, the minimum amount of asset for the purchase order will be 0.01002004 BTC (0.01 + 0.2% of the commission).
The actions of the bot when executing purchases
If the bot sees that one or more purchases have been executed, it creates one fix order and puts it on the stock exchange. If the fix order has already been created earlier, the bot removes the old and expose a new one, to a generalized sum.
Pulling orders
In a situation where the bot exhibited purchases, but the price grows up, you can very long wait until the price returns to the level of purchases. For such cases, the bot has a special mechanism - the suspension of orders. This function constantly compares the current price of the last transaction and the price of the first purchase order (the most expensive one). If the difference between them becomes equal to or begins to exceed the double indent the first step (the strategy parameter), the bot cancels all purchase orders and rearranges them again, starting from the current price of the last transaction. The whole table as it were, "pulled up" after the price increase. There is another option configuring the braces - through the "Bracket indentation" parameter, where you can use your hands specify the specific value of indentation in percent, at which it starts to work lift.
Changing the pair
To change a pair, you just need to go to the control panel, select another pair and save the settings (without restarting). Changing a pair is a special case and the bot will do this: first the bot will cancel all its macro orders on the exchange.
Next, the bot will change the working pair and initiate the restart of the cycle - that is, a grid of orders on a new pair. At the same time, if there was a fix on the old pair, then he will remain on the stock exchange. Subsequently, if you return to the original pair, the bot will see its fix and continue to work with it.
What is it for? For example, you are in an investor and do not want to wait long performance fixation. You can temporarily switch to another pair, trade there, and when the price of the first pair finally drops or is pulled up - go back and continue to add to the existing fix.
If you use a bot just for purchasing, you may want to change the pair not removing macro orders. For this, there is a setting "Do not remove macro orders when changing strategy or pair. "
Emergency handling
Work with the exchange is associated with a high probability of non-standard situations in a variety of places. For example, the exchange server may stop Respond, or the user can inadvertently take down any order. Practically for each of its actions, the bot controls many parameters that can directly or indirectly indicate the occurrence of an abnormal situation, and tries to process it appropriately. For example, if the bot sees that the warrant is executed and it is necessary to expose a fix, it first of all will check up, whether The purchased asset is on the user's account, since if the order was not executed, and was taken by hands, the asset will not be fixed and will not be put out. If the asset is actually not there, the bot will simply forget about this warrant and that's it. Or the moment fix updates. To do this, you need to remove the old order, count it and expose it new. If something went wrong, and the new order failed to expose, bot will try to restore the old order as it was before cancellation.
In general, all the measures taken make the work of the bot quite reliable, but in some
cases does not prevent to control his work at least occasionally.
Notifications
In some cases, the bot can send you notifications about important events. At the moment, several such events are defined:
- Full execution of the table of macro-orders
- Execution of a fix order
- Failure to expose the fix
- Failed to restore the fix
The first two notifications can be turned on or off from the panel management, while notifications of the inability to take action with fixom do not turn off.
Basic settings.
Strategy. Here you can choose one of the available trading strategies. LONG or SHORT. The description of the strategies themselves is given above. When changing strategy and pressing The "save" button restarts the cycle automatically. In addition, except for existing purchases, the bot also forgets about the existing fix (but does not remove him from the stock exchange).
Pairs. You can select one of the pairs available for trading. When you press the button "save" cycle restart is also automatic. But the existing fix will remain in the memory of the bot and on the exchange. This will allow, in the future, initial pair, continue working with the already existing fixation.
Use of depot. Allows you to specify which part of your available funds (which are not used in other orders) the bot can take into circulation. You can set or in percent, or specify the exact value. For example, we have 1000 on our account USD and we want to trade on a pair of BTC / USD, using 60% of the depo. This means that when calculation of the procurement table the bot will be based on the amount of 600 USD. He will do each time before calculating the table. For example, we had a fix on the account was 1100 USD. Hence, the bot will display a new purchase table using 60% of the 1100, that is 660 USD. If we want to distinguish a bot for work, for example, only 400 USD in any case, regardless of the total amount of funds on the account, we indicate this in the second field.
Indent the first step or the price of the first step. Determines the price that will be have the closest purchase order to the last price. Indent 1% means that the price of the first purchase order will be 1% lower than the price of the last transaction. If we want to set a fixed price for the first order, then fill in the second field. If the fixed price of the first step is used, the tightening function orders do not work.
Overlapping the course of the price. Determines the price values for the minimum and maximum order. Overlapping the course of the price of 20% means that the minimum order will be 20% cheaper than the maximum. For example, if the price of the first order is 90, then at the overlap of the course price of 20% the price of the last order will be 72.
Number of orders. Determines how many orders will be in the table.
Attention! Orders can be set less than indicated, in the case of restrictions on limits. See "Limits of the Stock Exchange for Orders"
Martingale. Determines by how much percent the amount of each next a cheaper order will be more than the previous one. Pay attention, I mean volume (price * amount).
Profit. Allows you to specify the profit in the fix order as a percentage of the purchase price, and in absolute value.
Advanced settings
The indentation of the braces. Optional setting. If specified, then the order lift it works when the LAST price deviates from the nearest order for this amount.
For more details see the chapter "Pulling orders".
Delay after the execution of the fix order. Allows you to specify a mandatory pause after the execution of the fixation. In some cases, such a pause can reduce the probability of buying at a price spike. By default it is not used.
Price limit. Allows you to set the price value, after which the bot will stop set up an order table. Used to protect against purchases on sharp price changes. For example, for Long's strategy the current price is 100. We can put a limit of 200. In this case, if a pampus occurs and the price jumps sharply above 200, the bot will no longer display the order table to avoid buying on pampa. The same is true for Short's strategy, only orders will stop showing
when the price falls below a specified level. Once the price returns to allowable framework, the bot will continue to work.
Use the logarithmic distribution of orders. See above.
Do not take macro orders when changing strategy or pair. By default, when changing strategy or pair all macro orders are automatically removed. This setting allows you to turn off the withdrawal and leave orders on the exchange.