Briefly talk about how to move bricks

Briefly talk about what moving bricks are and how to move them

Moving bricks is to use the difference in price differences between exchanges to arbitrage, generally divided into two types, soft bricks and hard bricks. Hard moving bricks is to buy and sell at the same time on exchanges where the price difference is too large, and then withdraw the purchased coins to the selling exchange, withdraw cash from the selling exchange, and then recharge on the buying exchange, and so on. .


Generally, hard bricks move ether or bitcoin, and move to high-priced exchanges (such as mercado) through low-priced exchanges (such as BTCE). Go back and forth until you feel you have earned enough.


But you also need to understand that there is a reason why the price of an exchange deviates from the market price, such as being too low. Either the fee is too high, the withdrawal time is too long, or the trustworthiness of the exchange is too low. This is also a risk that must be taken for hard moving, and if you are unlucky and encounter a big drop when moving bricks, but the exchange takes too long to withdraw coins and you cannot withdraw them, which leads to losses, which is called hit the foot.


Then, you have already read the principle of hard moving, it is very simple (the previous article also talked about how to make money with Bitcoin). Next, I will focus on the following soft moves.

The idea of ​​a soft move is that the price difference between exchanges fluctuates within a certain range, so I only buy low and sell high when the price difference is too large, and then reverse the operation after the price reversal exceeds the handling fee.


for example:

We looked at the prices at 18:42 and 3:00 am on July 24th and found that at 18:42, Huobi time was 18276, and BTCtrade was 18230. At 3 am, Huobi is 18272, and btctrade is 18424.


Then, since the handling fee is 0.02, and the two exchanges are 0.04, the calculation shows that as long as the price difference is higher than 70 yuan, then it is earned.


Then, we add that at 18:42, we will sell 1 Bitcoin on Huobi, and at the same time buy 1 Bitcoin on btctrade, at 3:00 in the morning, we will buy 1 Bitcoin on Huobi and sell 1 Bitcoin on btctrade Coin, operated twice, the handling fee is about 140 yuan, but the arbitrage is about 200 yuan, that is, excluding the handling fee, these two steps of soft bricks have increased the assets in our account by about 60 yuan.


Then, using software to monitor the price difference between exchanges, analyze the approximate relative fluctuations, and then buy low and sell high within the fluctuation, it is a soft move:

Multiple exchanges can be monitored at the same time, resulting in more arbitrage in a short period of time.

After finding the volatility, wait for the opportunity to close the position:

Then this is equivalent to a back and forth, which is also a soft brick.


Next, I will talk about the mathematical principles that I used in the following soft brick mover before version 1.5. (Currently updated to version 2.2, but I will definitely not tell you the principle of the new functions added in the latest version, ha ha ha ha ha... I will draw inferences from the old version.)


For a period of time, assuming 2 exchanges, we assume that the candlestick between the 2 exchanges looks like this:

Then, we simply do a price subtraction between the two exchanges and we get a line like this:

Simply make a moving average:

Then, it is easy to see that it is enough to operate at these points marked. For example, point A sells on A, buys on B, buys on B, and sells on B. And so on.


But in fact, the problem is, we only have the previous information, but no later information, how to find the marked points? We can make two more averages, moving up the percentage of fees and moving down the percentage of fees:

at any point in time. If we find that the blue line is crossed above, we will sell on exchange A and buy on exchange B, and if we find that the blue line is crossed below, we will buy on exchange A and sell on exchange B.

 

It's still easy to understand here, right? If only here, the average programmer can already write exploit code. But in order to expand profits, we have to think about a few questions:

 

How much to sell, how much to buy? How to control the volume of buying and selling? How reliable are our predictions about future price inversions? To what extent will previous information affect the current spread judgment? If I do this behavior, what is the probability that my payoff will be maximized? What is the market depth, what if my pending order exceeds the depth? What if my pending order is unilateral due to network delay?

 

Well... I definitely won't answer the question all at once, let's think about a question first, why can we be sure that the price difference on the exchange will reverse, instead of widening?

 

The answer is simple, because someone moved the bricks hard. However, there is a delay in the time between hard-moving bricks and coins, and those who earn hard-bricks do not know each other's hard-bricks, which will cause the actual brick-moving volume to be greater than the arbitrage space, so if the price difference between exchanges is too large, it will definitely be pulled back. . And it will pull back more (of course there are many reasons, but this one is easy to understand).

 

Therefore, the price difference between exchanges will not get bigger and bigger, because to a certain extent, someone will definitely move it back by hard-moving bricks.

 

Moving back is moving back, but how much is moving back?

 

There is no way to be as sure as the answer just now. Everyone uses different methods. I am currently using the method of information reinforcement learning for the previous period of time to speculate on the price range in the future. I won't write the formula (it doesn't make sense to write it...) I will continue to use my soul painter to draw it to express the following! for example:

Based on the learning information of the previous period of time, we assume that we obtain a 90% probability of the spread on the MM point. The area where the next price appears should be an interval similar to this (brown area), that is, the interval where the spread appears. So, what is the use of this predicted interval?


If we have traded before, we can make a certain judgment based on the currency and funds in our hands, as well as the trend range of the relative price difference with this 90% probability. In the next period of time, whether we will It is believed that he will wear it (underwear). This determines whether the MM point should be bought (sold).

 

This position is not easy to understand... I will change it to a MM point, and everyone will understand. Suppose we are now making predictions at point D:

Because of the information spread for a long period of time before the study, the price difference is increasing, and the machine judges that the pressure of the spread to rise is great, and the pressure to fall is not so great, and at this time, it is judged on the moving average, and it is a favorable point to buy. Then, we can think that at this point, there is a high probability that the operation can be profitable, so the operation of buying on exchange A and selling on exchange B is executed.

 

So, in theory, it works, but in practice?

 

The income of moving bricks is the income that the machine records every selling and buying operation and finally calculates the income. It can be found that it is indeed effective. We intercept a part of the transaction record, which also shows that our transaction is increasing the total assets in our account:

I randomly intercepted a few pictures of trading behavior, and found that it was bought on this exchange yesterday, and it should be sold on this exchange today. As the saying goes, the way of heaven is good for reincarnation...


Of course, when choosing multiple exchanges, I used the matching design algorithm of game theory to optimize the transaction order and improve the return (for this interest, you can search for the Gale Shapley algorithm and the top loop matching algorithm, although my code is actually a bit In and out, but the principle is the same.) Selecting multiple exchanges can effectively increase the transaction frequency in the case of a large amount of funds. We can approximately think that the tradable lines of n exchanges are ( n!/( 2 *(n-2)!) ), that is to say, adding one more exchange increases the chance of arbitrage by n*(n-3)/(n-2), which greatly improves the returns. However, if there are too many lines, the memory of the hosting computer is also higher. Otherwise, the optimal ask and bid will not be grabbed for pending orders due to the increase in calculation time. This is also a problem.


Then this is the income information from July 15th to 20th (5 exchanges, in theory, there are 10 arbitrage lines), among which, because of the small increase in profits, you don’t need to look at it, just look at the profit of moving bricks.

The initial capital is: 17581.26 The initial currency is: 1.66 The net value is 41819.1702 The current capital is 19058.71 The current currency is 1.69

It can be found that the recorded returns are indeed positive. The money and coins in the account have increased, and the behavior of the brick mover has indeed made us profit.



Then, after understanding these principles, you can already make a brick mover that can brush money. However, there are still many things to consider in the actual process. In addition to the few questions I have raised before, I also need to consider how to reduce risks, what is the competition between different currencies, and how the behavior of the opponent will affect me. You should update the information at any time. It is still updated once in a while, and at other times, it relies on short-term predictions (the network delay is much greater than the computing time of the computer). Should I use more efficient asynchronous operations or single-threaded processing that is less prone to smashing the foot?


In the actual process, the profit loss caused by a problem may be only a few thousandths, but the risk progression is in the form of an exponential, and the stacking is very serious. And many of these problems are difficult to find without a real listing, so if you are interested in starting a money-based brick mover, be sure to set aside some money for trial and error, which is also necessary. When I tested the ETH on the original brick mover, I lost more than 2,000 yuan because ETH fell from 3,000 to 1,500 (but I made more than 10,000 when I tested BTC later...).


Old-fashioned voting:

Not to mention, the foreman called me to move the bricks.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324840593&siteId=291194637