Flash Crash Bot

From Haasonline Software Wiki
Jump to: navigation, search

The Flash Crash Bot is one of Haasonline’s most popular and proven bots. It’s based on grid strategies adjusted for cryptocurrency markets. While it may not be easy to setup, it is worth getting familiar with this bot. The flash crash bot is available within the Advanced license only.

About

The Flash Crash bot sets pre-orders above and/or below a specified base price. Buy orders are placed at predefined price points that fall below the set base price. Conversely, sell orders are placed above this base price. When a buy order has been completed, the base price will be moved down and a sell order will be placed on the old base price. Conversely, when a sell order has been completed the base price moves up and a buy order is placed on the old base price.

The flash crash bot places orders above and below a user-defined base price. The range is determined by the base price. Orders are spread out by percentage or price. You can set the amount to be used for each order and how much time until an order refill occurs. The idea is to catch extreme flash crashes and pumps.

'Note:' This page will use the BTC/USD market in every example.

Restrictions

Only works on spot markets. Limited to a maximum of 100 buy and 100 sell orders.

Settings

FCB-parameters.png

Price Settings

Current Price - Information field to show the current price of the market Spread - Price points are calculated based on the configured spread. Spread Type - The Flash Crash Bot supports 4 different price spreads. Always make sure this value covers at least twice the fee. Fixed Amount - The Percentage spread will assure the orders are placed with an x amount between each other. Make sure this value covers the fee costs twice.

Price Calculation: Base Price + (Spread * Order Number).

FCB-spread fixed amount.png

Percentage

The percentage spread will assure the orders are placed with an x% between each other. Make sure this value covers twice the fee amount.

Price Calculation: Base Price + (Base Price * Spread * Order Number).

FCB-spread percentage.png

Percentage With Boost

The percentage spread will assure the orders are placed with an x% and an exponential boost between each other. Make sure this value covers twice the fee amount.

Price Calculation:

Price = Base Price + ((1 + Spread) ^ Order Number)

Final Price = price * (1 + Spread * (Boost ^ Order Number)

FCB-spread percentage boost.png

Exponential

The exponential spread type will create a spread that will exponentially grow bigger with each order. It is advised to open the full-screen view while creating an exponential spread. The price spread chart is a great tool to visualize your spread.

FCB-spread exponantial.png

Amount Settings

Used Currency

The currency to use for orders. For example, on a BTC/USD market where BTC is selected, the order amount will be equal to the value set on the spread. When BTC is selected as the Used Currency, the BTC order amount will be equal to the amount set in Spread. The used currency also determines how the profit is generated. When BTC is selected, the Flash Crash Bot will generate profits in USD. Conversely, when USD is selected, profits are generated in BTC.


Total Buy Amount

The total buy amount is the total amount in USD allocated to the Flash Crash Bot. In combination with the spread, the total amount setting will control the number of buy orders that will be placed.


Total Sell Amount

The Total Sell Amount is the total amount (in BTC) allocated to the Flash Crash Bot. In combination with the spread, it will control the number of sell orders that will be placed.


Order Size

This is how large a single order will be. Bigger is not always better.


Refill Delay The refill delay will add a timeout before replacing completed orders. This option is useful when the Flash Crash Bot is waiting for a flash crash but only wants to execute the sell orders after the market has stabilized. This can result in a higher profit since the sell orders are completed at a higher price.

Flash Crash Bot Orderbook

The order book displayed insides the Flash Crash Bot is a visualization of the internal order book used by the bot. The left column shows the price point determined by the settings. The middle column represents the order amount on that price points. The right column will be filled when activated and show the current amount outstanding on the price points.

FCB-orderbook.png

Setup Guide

  • Create a new Flash Crash Bot
  • Open the Custom Bot page by selecting it in the menu on the left side.
  • A new screen will show up, on it you will find a big + added. A small window will slide down.
  • Select the Flash Crash Bot from the list.
  • Select the Account (API) you like to use and the Price market you like to trade on.
  • Click on "Add bot",

The menu will slide up and a new bot will appear in the list. Click on the bot to open it.

FCB-setup guide 1.png

FCB-setup guide 2.png

Price Settings

FCB-setup price settings.png

  • Enter the base price. The base price can be entered manually or set to the current price by clicking on the current price
  • Select one of the available price spread options.
  • Set a spread value and other value (if shown).

Amount Settings

FCB-setup amount settings.png

  • Select the Used Currency in the dropdown. (gains are paid out in the opposite currency)
  • Set the Total Buy Amount allocated to the bot.
  • Set the Total Sell Amount allocated to the bot.
  • Set the Order Size. Make sure the amount is higher than the minimum trade amount of the selected account.
  • Set or leave the default value of the Refill Delay. Only use this if the bot is set up in anticipation of a real flash crash.

After hitting the save button, the bot will create and show an order book. This is the result all the settings. If you are not sure you have selected the right settings it is good idea to test your settings by running a backtest. Keep in mind that the actual values of the bot will change. You will need to reconfigure the bot after the backtest is completed.


Profit Calculation

The Flash Crash Bot is a different concept than other trade bots; therefore the profit calculation can be tricky. There are many ways to do this, and Haasonline has implemented the method we consider the most accurate and realistic. There is a downside of this method, however. For a 100% accurate profit calculation the order book needs to be back into his original position.

For the profit calculations, two lists are created. One list contains all of the executed buy orders; the other list contains all of the executed sell orders. Both lists are sorted ascending on price and matched line by line independent from the actual date it was executed. The profit is calculated from the differences between orders. Here is an example of how the profits are calculated for the bot.

FCB-Profit Calculation.png

Full Screen

The Flash Crash Bot comes with a built-in full-screen mode. In this mode, you are able to visualize the orders on a chart. This can help with tuning your bot and making sure the order range is configured properly.

The full-screen mode is also the gateway to use the advanced features of the Flash Crash Bot.

Follow The Trend

FCB-follow the trend.png

The Follow The Trend (FTT) feature will allow the bot to follow slow-moving markets in anticipation of a real flash crash (up or down) without orders executing while the market is sideways. The FTT setting creates a narrow range that allows for some price movement. When the price slowly breaks out of this channel, the bot will adjust in such a way that the price will be back within the range. Once the flash crash occurs, the price will break out of the channel fast and will complete the first order. At that time the feature will be disabled and the Flash Crash Bot will operate as normal.


Restrictions

  • The Flash Crash Bot can only have orders on 1 side. Only buy or only sell orders.
  • The feature will deactivate once the first orders has been completed.
  • This feature will only work when the selected price spread is Fixed Amount or Percentage Spread.

Check Interval

The value is the timeout for the relocation of the FTT price channel.

Price Channel Size

This value determines how big the range of the price channel is. For example, when using a Fixed Amount spread of $100 and a Price Channel Size of 2, the price is allowed to move in a $200 range before it will break out.

Price Channel Offset

This value will determine the offset of the price channel calculated from the Base Price.

Example

  • Bot with only buy orders.
  • Base price of $14.000
  • A Fixed Amount Spread of $100
  • Price Channel Offset of 2

Scenario one - Price slowly drops Let’s assume the price slowly drops to $14,150. The Check Interval kicks in, and the FTT will relocate the price channel so it will have a new range of $14,100 - $14,300. The bot will cancel the first buy order at $13,900 and the new order (which is still the first order) is now at $13,800. Scenario two - Price slowly or quickly raises

Scenario two - Price slowly or quickly raises Let’s assume the price rises to $14,830. The Check Interval kicks in, and the FTT will relocate the price channel to have a range of $14,800 - $15,000. The bot will cancel the first buy order at $13,900 and the new order will be set at $13.800 Scenario three - A flash crash happens

Scenario three - A flash crash happens Someone made a big mistake and created a large market sell order. The price rapidly drops to $12.000 and bounce back to $13.700. The Flash Crash Bot will get its first (batch of) completed orders. It will disable the FTT and start processing the buy orders and placing sell orders. Normal operations will continue until manually readjusted.


Bot Deactivation

FCB-bot deactivation.png


When using several Flash Crash Bots, it becomes hard to keep track of the idle ones. The price can trend away from your determined order range and not make any orders for days. The Bot Deactivation feature allows you to set a predetermined value on where the bot will cancel all its outstanding orders and deactivate itself. This will clean up the open order list and free up the allocated assets.

Aside from being idle due to the price trends, there is also a risk of missing an opportunity in a significant up or downtrend. This feature also allows you to move in or out of the market, entirely with a market order. Open orders will be canceled, all the allocated assets will be bought or sold, and the bot will be deactivated.

Trigger Level The trigger level specifies the price where deactivation will occur.

Example:

  • Bot with 10 buy orders and a total of 1 BTC.
  • Base price of $14.000
  • Highest buy order $13.900
  • Lowest buy order $13.000
  • Trigger Level 10%

Scenario one - A significant uptrend starts

The bot only has buy orders left. At this point, the trigger level is at $15.400. When the market rises higher than $15,400, all the outstanding orders will be canceled. When all orders are confirmed to be canceled, the bot will place a market buy order of 1 BTC (if this option is enabled), then deactivates itself.

Scenario two - A significant downtrend starts

The bot only has sell orders left. At this point, the base price is $13,000 and trigger price $11.700. When the market drops below the $11,700, all the outstanding orders will be canceled. When all orders are confirmed to be canceled, the bot will place a market sell order of 1 BTC (if this option is enabled), then deactivates itself.

Control Orders

FCB-Control orders.png


This feature allows you to add orders on the fly on an active or inactive bot. It will add an order below the lowest buy order and above the highest sell. If there are not any buy or sell orders, it will add one below or above the base price. When removing an order the lowest buy order or highest sell order will be removed and canceled.

Amount Calculator

FCB-trade amount calculator.png

The Amount Calculator is an easy tool to allocate a percentage of your wallet to the bot.The Amount Calculator is an easy tool to allocate a percentage of your wallet to the bot.

Stop & Cancel This option will cancel all open orders related to the bot. After the orders have been canceled, the bot will be deactivated. It may take awhile to cancel all the orders. During this process, the bot cannot be modified.

Stop & Leave This option will deactivate the bot and leave all the order on the exchange. If the bot is not modified, after the deactivation, it will keep track of the orders. If the orders are completed, it will register them and update the profit calculation.