The resource loading... loading...

Earn 80 Times in 5 Days — Power of High Frequency Strategy

Author: Ninabadass, Created: 2022-04-13 10:06:35, Updated: 2022-04-14 17:04:43

In the past two months, an account called print(money) has been very popular, for it earned hundreds of times of profit on Binance Perpetual Swap, and the screenshot of his account income can often be seen in various communication groups. The profit curve that barely had a drawdown has made many people jealous, and some people doubted its authenticity. But my five-day experience from October 23rd to 27th has verified that a high-frequency strategy can earn such a dramatic rate of return in high-volatility markets.

My Experience:

It took me about two days to write the strategy, and one day to make adjustment; It officially started to run on Binance Perpetual Swap on October 23rd. Compared to the initially recharged 100USDT, I earned 8800USDT on the 27th, with a return rate of more than 80 times, and there was almost no drawdown during the period. The total return rate has reached the 15th place in Binance history return ranking list, and ranked the second place in October’s return ranking list. Due to the questionable statistics of Binance, the ranking should actually be higher. img img

A Little Tip:

Not all markets and dates are suitable for high-frequency strategies, and the conditions for running high-frequency bots are very rigorous. There are several conditions as follows.

1.High-Frequency Market Friendly

In the past 5 days, FIL perpetual contracts were only traded on Binance. The market was very chaotic when FIL was just launched. The price spread between the perpetual price and the spot price once reached more than 30%, resulting in serious differences between long and short in FIL. The open price on the 16th fell from 60 all the way to 26, and then started to rebound, and once again fell to 19 and rebounded to 37. The days with high trading volume ranked third among all trading pairs, only after the established BTC and ETH, which is a golden opportunity for high-frequency trading. It’s a pity that I didn’t get the bot ready for the first time, and I missed the first few days, but I managed to catch up with the market quotes on 24th and 25th, and most of the return came from this period. After 27th, the price spread gradually decreased, the top funding rate disappeared, the trading volume shrank, and it became more difficult for the strategy to make profits.

There are similar opportunities for a period of time when SUSHI/YFI/YFII/UNI was initially launched, with both great volatility and trading volume, and print(money) seized these opportunities. When these currency symbols could no longer make profits, FIL appeared again. In the two opportunities of making profits, one is the hot concept of DEFI, and the other is the high-profile FIL. Under the current circumstances, it will take a long time to wait for the next opportunity

img

2.Trading Fee Rate

High-frequency strategies are very sensitive to handling fees. The minimum fee for the return of 0.00002 from Binance maker is not high. Although the return is very small, it can be understood as free of the handling fee. Therefore, that revived a batch of old high-frequency strategies from the time of spot without handing fee. Of course, if the market fluctuates wildly, the handling fee is relatively less important.

3.High Frequency

The most famous feature of high-frequency bots is their extremely high frequency. When the market changed rapidly, my strategy, most of time, finished opening and closing positions within 100ms.

4.Winning Rate

High-frequency strategies need to make accurate judgments on the short-term trend of the market, and the higher the winning rate, the larger the order volume, and the larger the short-term trading volume, the larger the order volume. Due to the large trading volume and high-frequency trading, FIL has a high accuracy of trend prediction within a few seconds. Similarly, the fierce differences between long and short give the maker the opportunity to establish corresponding positions and close positions. This is different from the early spot high-frequency strategy. Now the maker has a rebate, but the taker still has a high handling fee, so it can only pend an order. Imagine that if everyone is bullish in a short time, the high-frequency strategy will not be able to trade the maker buy order due to the taker fee, and thus will not be able to make a profit. If there is no trend at all in the market, the maker order can be traded but the probability of making a profit is not high. Therefore, the current high-frequency strategy requires that the market has a general trend to ensure a high winning rate, and there must be local long-short differences to ensure a large number of trades.

When the market went smooth, the winning rate of my strategy was above 80%, and the profit-loss ratio was greater than 1. When there was no obvious trend in the market, the long-term winning rate was also above 65%, and the profit-loss ratio was lower than 1.

5.Volume of High Frequency Strategy

The volume of a high-frequency strategy is obviously not high. Due to the large leverage of perpetual contract, a volume of 100u can also operate a fund more than 2000u, so the high-frequency strategy can start with a small amount of fund. But the overall net profit is not too big. The specific volume depends on the trading volume in the market.

6.Risk

Where a position is opened, there are risks. Well, the advantage of high-frequency strategy is that the number of trades is very high, and the loss of one time can be quickly made up by executing 10 more trades, and the drawdown is very small when the period is lengthened. The bigger the position, the greater the risk. Therefore, it is not possible to increase the position without limit. There must be a certain negative feedback mechanism. If there are more positions, increase the close amount and reduce the open amount, so as to ensure that the time of holding positions is short. If there are positions, and it is just against the trend, there will be a big loss, so the strategy is designed to judge the direction to ensure that positions are opened on the side of the trend in a dramatic rise or drop, which further reduces the risk at the cost that the short-term trend is not clear, and you will have small loss frequently.

About My Strategy

Principle: Get the recently executed trades, depth and the current position, judge the trend according to trades, and determine the volume of opening position according to the trading volume. If the trend is a rise, open long positions with maker, and close long positions at the same time. If you hold short positions right now, close them all first. The operation of a drop trend is in the similar way.

The ideas of high-frequency strategies are very consistent. My strategy this time draws on the ideas of the high-frequency strategy in 2014 and the OKCoin profit harvest bot strategy that I previously disclosed. The source code of these two strategies can be found on FMZ platform. If you thoroughly understand both strategies, there will be no secret for you in high-frequency trading.

Structure: The strategy uses an asynchronous structure (refer to the advanced tutorial in FMZ “Forums”). There is no source code here, just a simple description of the used functions, not a complete code that can be run, nor does it involve core logic. The APIs all use REST protocol and do not use websockets. The server is in Tokyo, which leads to lower latency.

// set trading pair and leverage
var pair = Symbol+'USDT'
exchange.SetCurrency(Symbol+'_USDT')
exchange.SetContractType("swap")
exchange.IO("api", "POST", "/fapi/v1/leverage", "symbol="+pair+"&leverage="+5+"&timestamp="+Date.now())

// basic trading precision limits 
var price_precision = null
var tick_size = null
var amount_precision = null 
var min_qty = null

var exchange_info = JSON.parse(HttpQuery('https://fapi.binance.com/fapi/v1/exchangeInfo'))
for (var i=0; i<exchange_info.symbols.length; i++){
   if(exchange_info.symbols[i].baseAsset == Symbol){
       tick_size = parseFloat(exchange_info.symbols[i].filters[0].tickSize)
       price_precision = exchange_info.symbols[i].filters[0].tickSize.length > 2 ? exchange_info.symbols[i].filters[0].tickSize.length-2 : 0
       amount_precision = exchange_info.symbols[i].filters[1].stepSize.length > 2 ? exchange_info.symbols[i].filters[1].stepSize.length-2 : 0
       min_qty = parseFloat(exchange_info.symbols[i].filters[1].minQty)
   }
}

function updatePosition(){//obtain positions, Symbol as trading pair, adding the trading pair parameter not returning the full currency symbol can reduce API occupation once 
    position = exchange.IO("api", "GET","/fapi/v2/positionRisk","timestamp="+Date.now()+"&symbol="+Symbol+"USDT")
}
function updateTrades(){// obtain the recent trades 
    trades = exchange.IO("api", "GET","/fapi/v1/trades","limit=200&timestamp="+Date.now()+"&symbol="+Symbol+"USDT")
}
function updateDepth(){// obtain the depth 
    depth = exchange.IO("IO", "api", "GET","/fapi/v1/depth","timestamp="+Date.now()+"&symbol="+Symbol+"USDT")
}

function onTick(){
    updateDepth() 
    updateTrades() 
    updatePosition() 
    makeOrder() // calculate the order price and amount, and then make orders
    updateStatus() // update the status information
}

//main loop, with sleep time of 100ms, and the loop delay is usually within 30ms 
function main() {
    while(true){
        if(Date.now() - update_loop_time > 100){
            onTick()
            update_loop_time = Date.now()
        }
        Sleep(1)
    }
}

This strategy is too demanding on the market, and is not profitable most of the time, and also has little volume. If everyone actively share this article on Weibo, WeChat group, WeChat Moments and other platforms, and the views over 100,000, I will consider renting it to let everyone experience the actual operation, and even disclose the source code of the strategy under this article in the future. Follow FMZ on WeChat, send “Binance”, and our administrator will invite you into FMZ Binance communication group on WeChat.


More