2. Averages/Averages group

General concept: theidea is to create an algorithm that detects a short-term trend change that goes against a long-term trend, allowing the trader to capitalize on a short period of time when the market will «predictably» undergo a correction.

Mechanism of action: by selecting a long period and a short period, the algorithm technically compares the two average prices for the two periods.

  • For intervals greater than 1 minute: ((minimum + maximum value of the corresponding candles) / 2.
  • For intervals less than 1 minute: average price of all segments of 0.5 seconds / number of segments used.

From this you set the «Trigger distance«, which is the distance between the values of the average price, long (long period) and short (short period) time interval. The trigger distance can take both positive and negative values. If you are looking for an average price for a short period of time that is lower than the average price for a long period of time, you should set the trigger distance to a negative value and vice versa. Once this rule is set, you can decide at what distance from the current price a new order should be placed (buy or sell as you choose). This is achieved by the «Order Price Distance» value, which can also be either positive or negative.

Another set of parameters specific to this algorithm are the «Multi-Order» parameters, grid mode. You can enable or disable this mode as you choose. It allows the algorithm to place multiple orders at a certain distance from each other or from the initial price level (if the order aggregation mode is enabled), there is also an option to increase each next order. If automatic TP/SL aggregation for multiple orders is enabled, the algorithm will automatically join an existing TP/SL when the «Join on first fill» option is enabled or after the «Cancel delay» period has expired. This mode will also cancel orders that have not been executed. «Order Lifetime» indicates to you how long it will take for the algorithm to start scanning the market again to see if the algorithm conditions are met.

Add a new algorithm by clicking the «Add Algorithm» button on the «Algorithms» tab. The following pop-up window will appear:

The user can choose between AVERAGES and AVERAGES GROUP algorithm. The first one runs the algorithm for one trading pair, the second one — for several trading pairs or the whole market.

Consider AVERAGES GROUP:

General settings

Set a unique name for the algorithm, for example, with a brief description of its features. For standard operation of the algorithm, enable Auto Restart, the algorithm will start again after the time specified in the Delay parameter, until it is stopped. Note, it is recommended to use a restart time equal to or greater than the long interval, in order to exclude repeated signals by the algorithm.

Emulation: if the checkbox is checked, the algorithm works in the «emulation» mode, without placing orders to the exchange. (In this mode, the commission is not taken into account in the reports, you need to calculate it yourself for analysis)

Name: specify the name of your algorithm to easily identify it in the full list of algorithms. For convenience, you can specify parameters in the name, for example, «2.5-long». Or use the formulae for auto-generation of the name based on the algorithm parameters.

  • Auto start with core: the checkbox allows the user to select whether the algorithm will start automatically after the core starts.
  • Stop if trade latency is higher than: will stop the algorithm (and cancel its orders) if the transaction latency exceeds this value. Specified in seconds. 1 second = 1000 ms delay.

Stop on trade latency. It is recommended to use a small value (1-5 seconds) to stop the algorithm as soon as a delay in the input of stock data is noticed. This is an additional protection against lags on the exchange side, which can cause unwanted order fills. In low liquid spot markets, as well as long distances, you can increase this parameter and thus disable the autostop, specifically to keep trading when the market is chaotic.

  • Stop if order latency higher than: will cancel the placing of an order if for any reason it takes longer to place (or cancel) than the time specified in this setting in seconds.
  • Auto restart: allows you to allow or disallow the algorithm logic to run automatically if a previously placed order has been executed.
  • Restart delay: delay of the algorithm from re-triggering. In seconds.
  • Open graph on trigger: theon/off switch allows the user to open a chart to the screen when an order is filled on this strategy.
  • Filter check frequency: time in seconds, how often the algorithm checks the values of current deltas on the market. For «slow» algorithms, it is desirable to query deltas less frequently to reduce the load on the core.
  • Order time window: sets the time period in seconds within which a request is valid for processing by the exchange. If for any reason the request is sent with a delay or the exchange takes a long time to process it and does not fit within the specified time frame, the exchange itself will cancel the request.

Market Filters

Market Type: allows the user to select the desired market type for trading: Spot/Futures/Delivery.

Quote asset: determines the quoted asset (For example usdt or btc). If you want to trade the entire market to Tether currency, specify usdt and press Enter.

White list: currency pairs of the «white list». If you fill this field, you should leave the item «Combined by Quoted Pair» empty! Suppose you want to trade only two pairs BTCUSDT and ETHUSDT, then specify them in this field separated by commas. Trading on other pairs will not be performed. Format — btcusdt, ethusdt, etc.. Followed by Enter key on the keyboard

Black List: currency pairs of the «black list». Let’s assume that in the field «Quote Assets» you specified the quoted asset usdt, but you do not want to trade on currency pairs BTCUSDT and ETHUSDT, then specify them separated by commas in the Blacklist field. Format — btcusdt, ethusdt, etc. Followed by Enter key on the keyboard

Orders limitations: Exchange Quantitative Rules (Binance only) includes protection against banning under the quantitative rules category. Read more on the Binance website: https://www.binance.com/ru/support/faq/4f462ebe6ff445d4a170be7d9e897272.

Active markets filter

Set a clear limit on the number of markets for the algorithm. It helps to correctly calculate the resources used for an algorithm that has more markets passing through the global filters than necessary. Set the principles for sorting the list of markets to select from a larger number of markets. The result of this Filter and the sorting principle will be a limited list from which markets will be pushed out and added over time, and the algorithm will start or stop accordingly. The List sorting frequency parameter allows the user to set the time in seconds for the list to be updated by pairs based on global filters, which allows a pair to enter or leave the list, as well as the sorting order (ascending or descending). The Ignore First parameter allows users to start placing orders in the sorted list from any position (if 0 is left, it will start from the first position of the list). Example: In global filters the quota market USDT is specified, the list of 100+ markets is obtained, you want to trade only on the 10 most volatile ones for the last hour, then «Max active markets» = 10 and the sorting principle «1h descending» is specified.

  • Filter 1,2,3-…: set of filters (you can add any number of filters via the «Add filter» button). Currently you can filter by absolute deltas or relative deltas from 5s to 24h and by per 24 hours Quote asset volume (24h QAV).
  • Max. active markets: it isrequired to specify the maximum number of markets in the filtering list. For example, if you will filter by delta in descending order, and you specify 10 markets, then there will be conditionally TOP 10 with the highest delta.
  • Ignore first: thenumber of markets that are the first in the generated list to be ignored. For example, when forming by volume, you do not need BTC, which often tops the list by this criterion.
  • List sorting frequency: specify the list update frequency in seconds. Note: this parameter will sort the list that is formed by all trading pairs that have passed the global filters. How often the global filters are applied to the pairs you specified for use by the algorithm is determined by the «Filter check frequency» in the General section.

Price step filter

  • Range: (from and to, in absolute value) sets the interval for the algorithm for the price step as a percentage of the current price (if the price step is less or more than this percentage, the order will not be placed).

It is used to cut off «square» coins from trading, on which the price step can reach up to several percent.

Mark price filter

  • Range: sets the algorithm the interval of deviation of the mark price from the current market price (in percent) within which the order will be placed. IMPORTANT: you can set both negative and positive values. Orders will be placed as long as mark price is within the specified range.

Funding rate filter (funding)

Specify the range of the funding rate in which the algorithm will work.

Example (screenshot above): the algorithm will place orders only on coins that have a funding rate between -0.5% and 0.5%

Funding filter

Specify the range of the funding rate and the time BEFORE the funding rate payment at which the algorithm will start or pause and the time AFTER the funding rate payment at which the algorithm will start or pause again, depending on the «Action» parameter

Example (screenshot above): trading will be stopped one minute before the funding rate is paid only on those coins whose funding is in the range of -100% to -1% and will start again one minute after the rate is paid.

(Read more about the financing rate: https://www.youtube.com/watch?v=4vzkgi_7knA )

Symbol Delta Filter

Enables/disables delta filters for each coin for which the algorithm is configured to place orders. This option allows you to add one or more filters, which can differ by time interval and delta range. The delta range can be relative (if values are entered with a «-» sign) or absolute (values are entered as positive integers) and must be entered from smaller (left field) to larger (right field).

Use absolute or relative delta: deltas must be specified in the «range» field. Absolute delta can only have positive values. When using Relative delta, the values can be negative, e.g. from -1.5% to -0.5%

  • Time : timeinterval of the delta, currency pairs (which will be selected given the quoted currency, «white list», «black list» data). You can choose one of the proposed options. In the future, the limits of the minimum and maximum delta of markets will be based on this interval.
  • Range: Specify the range of the minimum and maximum delta. From N1% to N2%. If the delta of the asset is outside the selected range, the algorithm will not work and orders will not be placed. For example, if you have chosen a time period of 5 minutes and specified a range from 0.5% to 2%, the algorithm will work only on those pairs where the price has changed not more than 2% and not less than 0.5% in 5 minutes — price direction is not important. The values are positive only. You can view the deltas in the client — tab «Market Live».
  • Cancel if out of range: if checked, orders in this algorithm will be canceled when deltas leave the selected range.

Note: youcan add multiple filters with deltas of different types.

Symbol Quote Asset Value (QAV) filter

  • Range: specify the range of minimum and maximum volume for 24 hours, currency pairs (which will be selected taking into account the data of the quoted currency, «white list», «black list»). If the volume of the selected currency pair is less than the set value in the first field or higher than the value in the second field, the algorithm will not work and orders will not be placed. You can view the volumes in the client — «Market Watch» tab.

Other Symbols Delta Filters

  • Trading pair: allows selecting anytrading pair, from various Markets (Spot/Futures) relative to the deltas of which the filter will be used. For example, Sport BTCUSDT.
  • Time: thetime interval of the BTC currency delta. You can choose one of the proposed options. In the future, the minimum and maximum BTC delta limits will be based on this interval.
  • Range: Specify the range of minimum and maximum BTC delta. From N1% to N2%. If the delta of BTC is outside the selected range, the algorithm will not work and orders will not be placed on the selected pairs. The values are positive only. You can view BTC deltas in the client — «Market Live» tab.
  • Cancel if out of range: if checked, orders in this algorithm will be canceled when deltas move out of the selected range.

Performance Filter: Allows the user to customize the performance of the current algorithm based on the trading results of all running algorithms, a specific trading pair, the current algorithm or any other algorithm.
For more details, please refer to the instructions

Algorithm parameters

Long and short time intervals are specified, during which the average price is calculated and compared with each other. If the price of a short interval has moved upwards from the average price for a longer interval, then growth for the last time interval is determined and vice versa. The relative delta between the intervals is indicated with a sign (-) if it is necessary to determine the fall or without a sign if it is necessary to determine the growth. The Order Price Distance is specified in order to either buy at the market price when a signal is detected or, on the contrary, to place a little further from the current price in the hope of catching the result of a trend continuation.

  • Long period: defines the long period of time (in seconds) to be used for the algorithm.
  • Short period: defines the short time interval (in seconds) to be used for the algorithm.
  • Trigger Distance: sets the value (in percent) of the difference between the long and short period that will result in placing an order. Can be either a positive or negative value.
  • Order Price Distance: sets the distance from the current price (in percent) at the moment of algorithm triggering for the initial order to be placed by the algorithm. It can be either a positive or negative value.

Order Details

Select the order direction (Buy or Sell/Long or Short) and the order size, in USDT equivalent. Specify the time after which the order will be canceled.

  • Side: allows the user to select which type of order to place to the algorithm Buy (Long) or Sell (Short).
  • Client Order type: sets the type of order to be placed by the algorithm. You can read more about the order type in the documentation of the Exchange itself.
  • Stop Price: sets a certain distance from the price level at which the Stop Limit Order is placed to the price that triggers the Stop Limit Order.
  • Order size: order value set in USDT. This value takes into account the leverage of users. For example, for trading on the BTCUSDT pair, the minimum order is 0.001 BTC, at the price of BTC 45000$ will be equal to 45$. It is necessary to specify from 45, this value will already be leveraged, i.e. with a leverage of x125 — your funds will be involved 0.36$. Try to specify a little higher than the minimum value for correct execution of the order.
  • Iceberg: when activated, hides the true order size by buying/selling with smaller and equal volumes. Allows the user to hide large volume orders in the order book. Enabled separately for new orders and Take Profit orders.
  • Cancel on first deal: when using a multi-order grid, the grid will be canceled if any of the Take Profit orders of this algorithm is filled.
  • Auto join: the filled orders of the algorithms will be joined together, thus shifting the average entry point. After the orders are joined, the distance to the TP/RL will be updated relative to the average price.
  • Join Key: Used to join positions of different algorithms. If enabled, all positions with the same key will be joined. 

Note: In order to join positions exclusively within one algorithm, it is necessary to check the Auto join checkbox and set the join key.

  • Max. position size: The maximum volume that an order can accumulate by averaging or the total volume of separately executed orders on one pair for a given algorithm.

Cancel Delay

On/Off parameter of the lifetime of orders placed on one trading pair by this algorithm, in seconds. The «do not cancel if executed» parameter will cancel the specified «cancel delay» when the first order from the grid of orders placed by the algorithm is executed, and will leave the rest of the orders on the exchange. The «cancel on first deal» parameter will cancel the remaining orders placed by the algorithm when the first position opened by an order placed by this algorithm is closed (with a take profit or stop loss).

  • Cancel delay : the delay until an unexecuted order or multiple orders placed by the algorithm are canceled.
  • Do not cancel if executed: disables canceling the order grid when the first order is executed.
  • Cancel on first deal: cancel anorder or a grid of orders when the TP/SL is executed.

Multiple orders

Specify the number of additional orders, the distance at which they will stand apart from each other, and the percentage and ratio of increase of each subsequent order, if you want to place a grid of orders rather than one order when a signal is detected. Auto join TP/SL as an option, in order to get a single merged position as a result of the grid of orders.

  • Relative to: you can select the type of increase for each subsequent order in the grid. If you select from First, then with the parameter «Increase each subsequent order by» for example 100, each subsequent order will be increased by 100% of the first order. Example — 100, 200, 300, 400. And when selecting from Previous Order, each next order will be increased by 100% of the previous order. Example — 100, 200, 400, 800.
  • Count: sets the number of orders in the grid. Not counting the first order.
  • Distance: sets the percentage distance between orders in the grid.
  • Size increase: increase the size of each subsequent order in the grid. The value is specified in percent.

Take profit

Specify the Percentage of the entry price for which the Take Profit will be set. Select the order type for Take Profit, we recommend Limit, which will also mean the Real order type.

  • Percentage: sets the distance from the price (at which the order was executed) to Take Profit as a percentage.
  • Order Type: sets the type of Take Profit order to be placed by the algorithm. You can read more about the order type in the documentation of the Exchange itself.

Auto price down

Specify the periodicity (Timer) of take profit price lowering, the step, in percentage of the current price, and the threshold, limit, where the auto-reduction will stop. This functionality will help close a trade with a smaller profit where it was not possible to take the expected profit.

  • Timer: sets the delay in seconds until the Take Profit starts to decrease to the current price (the same value will be used for both the first step and all subsequent steps).
  • Step: sets the percentage value of the Take Profit approach step to the initial price.
  • Limit: sets the lowest limit, as a percentage of the initial order, to which Take Profit will drop and stop.

Stop loss

Specify in percent of the entry point the level of loss at which the application will close the trade. Spread is an addition to the value of stop loss level, which will help to avoid slippage. The order type recommended is Market — Virtual, which will work in combination with a real take profit. For larger order sizes, it makes sense to choose alternative order types such as Real, Stock Stop Loss or Limit type. Delay can be used when trading low-liquidity markets in a volatile, low-fill stack, in order to exclude false stop loss triggers in an empty stack, immediately after opening a trade.

  • Percentage: sets the distance from the price (at which the order was executed) to the Stop Loss as a percentage.
  • Spread: determines the additional distance from the Order Book spread where the Limit order will be placed to ensure execution once the price reaches the Stop-Loss level
  • Delay: Thedelay of placing a Stop Loss in seconds, after the original order is executed.
  • Order type: sets the type of Stop Loss order to be placed by the algorithm. You can read more about the order type in the documentation of the Exchange itself.

Trailing stop (following the price)

The function of shifting the stop loss to the profitable (lower) side, if the price has changed in a positive direction. Spread — a buffer that will ignore small price changes or price spread play and move the stop loss only if the price has moved by a value greater than the Trailing Stop Loss Spread.

  • Spread: value in percent of price movement, in the profitable direction from the initial price, after traveling which, the Stop Loss will be placed at the distance specified in the parameter «Stop Loss -> Percentage», calculated from the new current price.

Second stop-loss

Enables/disables a special Stop Loss function that cancels the original Stop Loss and places a new one after the price moves in a profitable direction relative to the side of the position by a certain amount. Thus, if the function is enabled, the second Stop Loss will cancel the initial Stop Loss and, once price reaches the distance of the second SL trigger, place a new Stop Loss at a distance from this level equal to the distance of the second SL. For example: if the trigger of the second SL is 0.5% and the percentage of the distance of the second SL is 0.2%, then once price reaches the second SL’s trigger of 0.5%, the second Stop Loss will be placed at a distance of 0.3% (0.5% — 0.2%). The second SL can also be assigned a trailing function that will allow it to track the current price at a distance equal to the trailing spread (similar to the trailing function of the initial stop loss).

  • Trigger distance: a value in percent of price movement, when reached, the trigger will work and set a new Stop Loss (by the specified percentage of the «Second Stop Distance» parameter) to replace the first one. This parameter can be used to move the Stop Loss to breakeven, when reaching half of the distance to Take Profit.
  • Percentage: the distance in percentage from the price at the moment of triggering the «Second Stop Trigger» to the new Stop Loss, replacing the old one.
  • Second Stop Trailing: enabling the option — Trailing SL (following the price) for the second Stop Loss.
  • Trailing Stop Spread: value in percent of price movement, in the opposite direction from the initial price. At which Stop Loss will follow the current price by the specified distance in the parameter «Second Stop Loss  -> Percentage».

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *