There was a problem loading the comments.

Creating an API key for futures trading on the Binance COIN-M Futures

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Perpetual futures contracts Binance Futures COIN-margin

We have already described the advantages and disadvantages of trading cryptocurrency futures contracts with leverage, as well as the process of creating a bot for trading perpetual Profitable trading on Binance Futures USDT-margin with the bot, which appeared in September 2019.
In the summer of 2020, a new type of futures trading appeared on the Binance exchange, namely COIN-margin futures, which are represented by quarterly and perpetual futures.
In this article, we will look at perpetual COIN-Margin futures. You can trade them with a leverage of up to x125.

Contents
1. What is the difference between COIN-M and USDT-M on Binance Futures
2. How to create a bot for Binance Futures COIN-M
3. Replenishment of the COIN-M futures account
4. Create an API key for trading on Binance Futures COIN-M
5. Adding the API key to RevenueBot
6. Creating a bot for COIN-M Binance Futures using the “Quick start” menu

7. Fine-tuning the bot
8. The position of mode

 

1. What is the difference between COIN-Margin and USDT -Margin on Futures Binance?

The main difference between USDT-Margin futures and COIN-Margin futures on the Binance exchange is in the base coin.
The base coin for USDT-Margin futures is the USDT stablecoin. In USDT, you need an initial Deposit to trade in any of the presented pairs. Profit from trading is also obtained only in USDT.
In a growing market, this can reduce the profit, since the value of the cryptocurrency is growing, and the profit is obtained not in it but in the USDT stablecoin.
In addition, not everyone trusts the USDT stablecoin and does not want to store funds in this coin.
The main advantage of USDT-Margin over COIN-Margin is a greater variety of trading pairs.
For COIN-M futures, the base coin is BTC and a number of other cryptocurrencies (ETH, ADA, LINK, BNB, TRX, DOT, EOS, LTC, BCH, XRP, ETC). Each trading pair has its own base coin.

As for COIN-Margin, USD is the counter coin that is being traded.
Price of 1 futures contract = 100USD for the BTC-USD pair.
Price of 1 futures contract = 10USD for ETH-USD, ADA-USD, LINK-USD, BNB-USD, TRX-USD, DOT-USD, EOS-USD, LTC-USD, BCH-USD, XRP-USD, ETC-USD pairs.
Cryptocurrency is used to finance the initial margin (the initial depot for the bot is needed in the base coin) and calculate profit and loss (profit is also obtained in the base coin).
The main advantage of COIN-M over USDT-M is that you get a profit in cryptocurrency, not USDT, and do not incur losses when the price of cryptocurrency increases while trading in USDT.

 

2. How to create a bot for Binance Futures COIN-M




  • Click on “Open now” in the lower right corner. We would be grateful if you use our referral code 40247736 =);


2f8912ab674d1d22ccafbac7318853f1.png

  • After that, the futures account will be activated, and you can start preparing for trading.

 

3. Replenishment of the COIN-M futures account

  • First, you need to transfer the necessary coin from your spot wallet to your COIN-M futures account. To do this, click on “transfer” in the lower-right corner;




  • Enter the amount you want to transfer to your COIN-M futures account. Then, click on “Confirm transfer”. ATTENTION! If you want to trade BTC-USD, you need to top up your account in BTC. If you want to trade in ETH-USD, you need to top up your account in ETH, and so on… Remember that each pair uses its own coin in this trade;




  • You can also use the transfer function to transfer funds back to your spot account.

4. Create an API key for trading on Futures COIN-M

Now we have a new way to quickly create an API key for the Binance exchange!

Binance FASTAPI is a convenient, fast and secure way to create API keys. With FASTAPI, you can automatically generate and bind API keys in a couple of clicks without having to enter them manually. 

If futures trading is enabled in your Binance account, then using Binance FASTAPI, 3 separate API keys are created at once — Spot, Futures USDS-M, Futures COIN-M. 

When FASTAPI is connected, a white list of IP addresses is used, which ensures the safety and security of user funds. All trading operations will be allowed only from IP addresses from the white list. In addition, the FASTAPI connection cancels the 90-day validity period of the API key.

 

To use this function, you need to select the Binance exchange on the API key addition page and click the link "FASTAPI connection", you will be redirected to your Binance account, where you will need to approve access. If you are not logged in to the exchange, then you will need to log in first, it is better to do this before creating an API key.

 

 

Next, approve access to your account to create an access API.

cd59899cd80e3d9bee8abdbdb411f32f84b0a6673fe20b342b34b1e61b83b47319ac12df1563703c?t=b13dede57f33018117251fe088d7e583

After successful completion of the operation, you will receive the message "The key 'FastAPI key' has been successfully created" and you will be able to use the created keys for the Binance Spot, Futures USDS-M и COIN-M.

 

 

Create an API key for trading on Futures COIN-M standard way

c66c247a5f256e90a0ef1c0854d105722f55f61bafd265f6a5f063fa5b301e981d708d6cb89e2ec0?t=a09f24bd741b9fd47c70bfa790c9445c

  • Next, you need to remove the "Default Security Controls" checkbox;

c74c0b2d803a745f580d9bac9fb9c12002f32e4129616185789e7da3d4ce79ad06057e57c220c4b2?t=f2510c01000da97eeaf2fbed9d74f472

  • In the pop-up window, you need to confirm that the "default security controls" is disabled;

9e7f8ace5e0905ea6b5cbe4288df6e263483db0febd08aa4ab3849fcb929250e57cdddb3d651cf75?t=c9fd0508e5bad57ba3ba0e5c5b6160680b870008d88a809e7fa4ace0ef4a6a9a47771401d17b86684593df275fe2ed6e84ca3c9c5047190c?t=111729ea29b659dbbad24c42acad6dc9

  • Next, click "Create API" and select the key type "System generated";

a0998af7d47952c576d1d56d7f470ffa528dead486ac72465b3b410954dfdbd72d4d38736cf6f25a?t=5ae75924aafc09a5cf05eb36819a6861

  • We set the label of the API key;

37b4ccb78680cf464f86c204343cec5e3125568830195fc4b883ca4d7c66c95c747cc3b572e608fc?t=764f2f62f84927f3388766b52f1623d6

  • Passing a security check;

f374ca740f4d41dd9f8dc57c24a3222690b38b4f929f4d2954d92e7c1b875779d9e2193dfeca169c?t=02d5de58a1864a9906bc3d43ce48514d

  • Activate the restriction "Enable spot and margin trading", set IP access to "Unrestricted", save the API Key and Secret Key (they will be needed when adding a key for the RevenueBot), then click Save;

3873441103dd3d089efb8fcafcbfdce20a45c2fe25c840063b292e0c67099dc8697610366841e9ea?t=dcb17bde1221e2b76dba6f1915eecd2e

  • We confirm the validity period of the API key;

fef7290bde1c11b8b5124fd863797b73cc8bf763b2a7a62fbac376326e92682f731b497a8cdff8ff?t=ccdf41dd9dfcecaef89196301c4dc3bf

 

5. Adding an API key to RevenueBot

  • Go to the “API keys” menu  and click on “Add API key”;
  • Come up with a title key, for example, “revenuebot futures coin m”. In the exchange field, you should select “Binance Futures COIN-M” copy timing “API Key” and “Secret Key” in the appropriate fields and click on “Add API key”.




6. Create a bot to Binance Futures COIN-M

  • Go to the “Quick start” menu
  • Give a name to the bot
  • Select the “Binance Futures COIN-M” exchange
  • Select the previously created API key for futures trading or create a new one.
  • Select a trading pair. At the time of writing, you can choose one of the 12 suggested pairs. You can also use the convenient menu of recommended pairs, which displays those trading pairs that had the most profitable trades in the last 24 hours (if, of course, at least one of these 12 pairs was in the top).
  • Select the algorithm
    LONG — buying cryptocurrency futures for USD, and then selling them at a higher price.— the one that was brought to the COIN-M futures account. Using the long algorithm is advantageous in a bullish trend (a growing market).
    SHORT – selling cryptocurrency futures for USD, and then buying them at a lower cost. Profit is also available only in the main coin — the one that was brought to the COIN-M futures account. Using the SHORT algorithm is advantageous in a bearish trend (a falling market).




  • Set the bot with a Deposit
    The bot needs to set a Deposit in the pair’s main coin (the coin that was brought to the COIN-M account). The profit is available only in the main coin for both the LONG algorithm and the SHORT algorithm. The example of bots in different trading pairs:— If the bot has a TRX-USD trading pair set, the bot’s deposit must be in TRX for both LONG and SHORT algorithms. The profit will also be in TRX. The COIN-M account must have TRX coins for trading such a bot.
    — If the bot has a DOT-USD trading pair set, the bot’s deposit must be in DOT for both LONG and SHORT algorithms. The profit will also be in DOT. The COIN-M account must have DOT coins for trading such a bot.
    Thus, we get that for each trading pair; the COIN-M account must have its own cryptocurrency, which will be used by the exchange to finance the initial margin.When trading COIN-M futures, when sending an order, the number of contracts that we want to buy or sell is transmitted to the exchange in addition to the price.
    Price of 1 futures contract = 100USD for the BTC-USD pair.
    Price of 1 futures contract = 10USD for ETH-USD, ADA-USD, LINK-USD, BNB-USD, TRX-USD, DOT-USD, EOS-USD, LTC-USD, BCH-USD, XRP-USD, ETC-USD pairs.To create a grid of orders, the bot calculates how many contracts the user’s allocated deposit will last and how many contracts will be in each grid order. According to the exchange’s rules, the number of contracts in order is an integer. This rule of the exchange affects the setting of the martingale in the order weights of the grid. If you want the order for the martingale to work correctly in order weights, you need to set it more than for normal trading, where signs after the dot are allowed in order amounts. This is especially important when trading with a small deposit and small leverage when the number of contracts in orders is small.
  • Set the leverage
    Setting the leverage is a multiplication of your depot (borrowed funds from the exchange). Thanks to these borrowed funds, you get the opportunity to increase the volume of your trading operations and profit.
    Don’t be greedy and don’t use maximum leverage, it’s very risky. Be sure to keep insurance funds on the futures account that are not involved in trading until the right moment. This will make it possible to get the profit out of the open position.
  • Be aware of the risks:
    — If you use a large amount of leverage, then there is a possibility that the entire margin balance in the futures wallet may be liquidated in the event of an extreme price change. Therefore, you need to fully understand and understand how this trading tool works and be able to assess risks.
    It is also important to develop and strictly adhere to money management to avoid the liquidation of all funds.
    — It is mandatory to have insurance funds on the futures account that are not involved in trading until the right moment. This will make it possible to get the profit out of the open position.
  • Set the position mode
    By default, “one-way position mode” is set on the exchange. Use this mode when configuring the bot if you don’t know which one to choose.
    In one-way mode, a position can only be opened in one direction for one trading pair at a time (this is either a SHORT or LONG position).
    More information about position modes.

  • Set the number of insurance orders and martingale
    The Deposit must be sufficient to create all insurance orders, and each of the orders must meet the minimum size requirement of the exchange. The martingale determines how many percent each subsequent order in the grid is larger than the previous one. Using a martingale allows you to close a position with profit with a smaller price rebound.
    As noted above, you need to use more % martingale for COIN-Margin futures than for other bots. This is due to the fact that the number of contracts in the order must be an integer according to the exchange’s rules.
  • Enable partial placement of the order grid
    Due to the fact that it is not allowed to place orders more than 15% from the current price of the trading pair on the Binance Futures exchange, we recommend that you always use the partial placement of the order grid for futures bots (sets the number of simultaneously active safety orders from the entire grid that the bot will place on the exchange). If the price change overlap of more than 15% is set in the bot, the bot will not be able to place all safety orders in the grid at once. In this situation, enabling partial placement of the order grid will help. The bot will not place the entire grid of orders at once, but only the specified number. After that, the bot will track the placed orders and place new orders when active orders are executed. If you want to find out more information about the partial placement of a grid of orders, see the blog article “Setting the number of active insurance orders”.
  • Select a trading mode
    You can choose one of the ready-made templates for bot settings. We recommend using the “normal trading mode for Binance Futures”, which uses a 40% price change overlap, which is suitable for continuous operation of the bot with low risks.
    We remind you that you must enable partial placement of the order grid (sets the number of simultaneously active safety orders from the entire grid).
    There is also an aggressive trading mode with a 15% price change overlap. It is suitable for temporary trading when there is time to monitor the bot’s work. It allows you to get more profit, but at the same time the risks increase.

  • Using filters to start the bot
    We recommend always using filters to start the bot. This is necessary so that the bot starts trading at the right time (not buying on an overbought market and selling on an oversold one). That’s why, popular and effective trading indicators such as RSI, CCI, and Bollinger Bands are used. We use RSI < 70, CCI < 110 for the LONG algorithm, and RSI > 20, CCI > -110 for the SHORT algorithm. You can change or add new filters for the start when editing the bot.
    Read more about filters in our blog “filters for a start”.
  • There are three ways to continue: Create a bot / Create and edit a bot / Create and launch a bot

 

Select the “Create bot” option, if:
— you don’t understand fine-tuning yet and want first to see how the bot trades with popular and suitable settings for most cases;
— you don’t want the bot to be launched yet, but you want to get acquainted with additional information about the service.
The bot will be created, and the user will be able to get acquainted (before launching the bot) with all the information about how to continue working with the bot: where to view the created bots and make more subtle settings, links to the articles “how to manage the bot” and “see statistics of its work”.
Select the “Create and edit bot” option, if you are familiar with the bot’s fine-grained settings and want to adjust them.
The bot will be created, and the user will have access to fine-tuning (recommended for experienced users who know what they are doing and how the bot works).
Select the “Create and launch bot” option, if you want to quickly create and launch a bot with the settings that are suitable in most cases. The bot will be created and launched. You can also find information on how to continue working with the bot: where to view the created bots and make more subtle settings, links to the articles “how to manage a bot”, and “see statistics of its work”.

 

7. Fine-tuning the bot

You can set fine-tuning options:
— when creating a bot for Binance Futures in the classic “Bots” menu;
— when you click on the “Create and edit” button in the Quick start menu, after the main bot settings are set.

The main settings:

  • Price change overlap: The percentage of price change overlap sets how much the order grid will cover the price change. In fact, this setting states how many percent of the current price will be defended by the last order in the grid.
  • Indent of the first order %: Indent of the first order in %. It sets how many percent the first order’s price in the grid will be less than the current price (for the LONG algorithm) or more than the current price (for the SHORT algorithm).
  • The price on the stock exchange: Selection of the rate on the exchange from which the order grid will be calculated. These can be BUY, SELL, or AVERAGE rates. We recommend using the SELL rate for the LONG algorithm and the BUY rate for the SHORT algorithm.
  • Order grid and martingale: here you can set the number of orders in the grid and martingale (by how many percent each subsequent order in the grid will be larger than the previous one). By clicking on the view orders matrix, you can see the calculated grid of orders.
  • Profit %: here we set the percentage of profit that will be laid by the bot when calculating the price of the order that ends the cycle (take-profit order).
  • Profit coin: this setting is only available for the short algorithm. It sets which of the traded coins will make a profit.
  • Grid tightening %: it happens that the bot placed a grid of orders, and the price went in the other direction. It turns out that you need to wait until the price returns, and you can wait a long time. This expectation can be avoided by setting the order grid update to the current price. Here you can set the percentage at which the current grid of orders is canceled and a new one is placed.
  • Delay before canceling the order grid for tightening: here you can set a delay in minutes before starting to cancel the current order grid when the Cycle up setting is triggered. This setting allows you to avoid frequent cancellations of the current order grid, when the price has changed in a very short time and returned to the previous level. You can wait for some time to avoid removing the current grid of orders in vain.
  • Delay before canceling the order grid for tightening: here you can set the delay in minutes before setting a new grid after canceling the previous grid of orders. This setting also allows you to avoid negative consequences in a situation where the price has changed in a very short time and returned to the previous level.
  • Delay after the cancellation of the order grid for tightening: here you can set the delay in minutes before starting a new cycle after the current cycle ends.

Additional settings:

  • Profit capitalization: When making a profit, you can add it to the Deposit that the bot uses, thus increasing the Deposit.
    When this setting is enabled, all the bot’s operation’s profit is credited to the virtual wallet that this bot uses.
  • Logarithmic distribution: Usually, the order grid is calculated so that all orders in it are located linearly, at the same distance from each other across the entire price overlap. If the price fluctuates slightly, the first orders in the grid, which are the smallest in volume, will be executed most often. If you want to attract more deposits to trading with small price fluctuations, you can use a logarithmic distribution that will increase the order density near the current price and lower the order density when moving away from the current price. The order density can be adjusted differently for different situations by increasing or decreasing the logarithmic factor. For most cases, the value logarithmic factor = 1.5 is suitable. By clicking on the view orders matrix, you can see the calculated grid of orders.
  • Price limit: Use this setting to avoid starting to buy too expensive and start selling too cheap.
    It sets the maximum price above which the bot will not start a cycle for the long algorithm and the minimum price below which the bot will not start a cycle for the short algorithm.
  • Fix the first partially executed order with a profit: it happens that the first order in the grid was partially executed, but the price went in the other direction. This happens when the bot operates a large depot and orders in the grid are quite large, even the very first one. In such a situation, you can wait a long time for the price to return and the order to be fully executed so that the algorithm continues to work. By enabling this setting, you can set the profit percentage for calculating the price at which we will get a profit if we cancel a partially executed order and set the final cycle order for its amount. After all, the price went in the direction where we will get a profit, but the order has turned out to be too large.
  • Automatic algorithm flipping: depending on certain conditions, the bot can stop the current active cycle, cancel all active orders, including take profit, and then transfer the Deposit received from the work to the wallet of another bot (with the opposite algorithm) and start it up. Read more in the blog article Automatic algorithm flipping.
  • Automatic switching of a trading pair: at the start of the operation, the bot can change the trading pair set in its settings to another one that currently has more suitable volatility indicators for successful trading. A volatility analyzer is used to assess the volatility of cryptocurrencies. It calculates the number of multidirectional price fluctuations over the nearest past time. They select the cryptocurrency, the price of which has changed many times. Read more in the blog article Automatic switching of a trading pair.

We will also analyze the position mode settings.

 

8. The position mode

In the settings of futures bots, you can set the position mode.
At the moment, there are 2 position modes on Binance Futures. They are “one-way mode” and “hedging mode”.
One-way position mode
By default, the exchange sets “One-way position mode”. You should use this mode when configuring the bot if you don’t know which one to choose.
In one-way mode, a position can only be opened in one direction for one trading pair at a time (this is either a SHORT or LONG position).
Two settings have been added for the one-way position mode. We recommend you to turn them on. For most cases, these settings will further secure futures trading.
1) Do not start the bot if there is an open position or active orders for the current pair.
This setting will not allow the bot to interfere with an already started trade by affecting the open position (manually or by another bot). Bots with automatic switching of a trading pair will not be able to enter the same pair.
2) Place a take profit order with the “position reduction” parameter.
This setting will not allow the bot to go beyond the open position or open a position in the opposite direction.



Hedging mode
In hedging mode, you can open independent multidirectional positions for one trading pair at the same time (keep LONG and SHORT positions open for one trading pair at the same time).
This position mode allows you to run two bots simultaneously in the same pair with different algorithms. Two multidirectional positions will be opened, and each bot will only control its own position.



Attention! The position mode is set the same for all trading pairs, so you can’t run bots with different position modes.
The position mode can be set (changed) only if there are no open positions. Therefore, if you decide to change the position mode, you need to make sure that all bots are stopped, and their positions are closed. In addition, you need to close all manually opened positions and only then change the position mode. You don’t need to manually change the position mode on the exchange for the bot to work. The bot checks the startup mode’s position mode and changes it to the one set in the bot settings.
You can see what position mode is set on Binance here:




Share via

Related Articles

© RevenueBot