A statistical arbitrage strategy based on bit-currency spreads

Source: Internet
Author: User

Arbitrage strategy is a common strategy in quantitative trading, which is favored by quantitative traders because of its stability and unaffected by price. Especially in the digital asset market, because of its no price and 24-hour uninterrupted trading characteristics, each trading platform will often have a large difference, very suitable for programmatic transactions. Traditional arbitrage is a very simple, relatively risky strategy, and below shares a statistical arbitrage strategy with a certain risk but a higher return on traditional arbitrage.

The basic idea of statistical arbitrage is to study and analyze the historical data of the relationship between a group of related prices by means of statistical analysis tools, this paper studies the stability of the relation in history, estimates its probability distribution, determines the extreme region of the distribution, that is, the negative domain, when the price relationship in the real market enters the negative domain, It is considered that this kind of price relationship can not be maintained for a long time, and arbitrage has higher success probability. –
Mbalib

Note: Statistical arbitrage is only for the stability of the price relationship, those without stability of the price relationship of the arbitrage risk is very large. Whether the price relationship is stable directly determines whether the statistical arbitrage can be established, so when the historical data of the price relationship is statistically analyzed, it is first to verify that the price relationship is stable in historical data. If a set of price relations is stable, there must be a certain equilibrium relationship maintenance mechanism, once the price relationship deviates from the equilibrium level, the maintenance mechanism will play a role, and the price relationship can be pulled back to equilibrium level quickly or slowly. Therefore, to analyze the stability of a set of price relations, we need to qualitatively determine whether there is such a balance relationship maintenance mechanism, and then the historical data for statistical analysis to verify that the relationship between the maintenance mechanism through qualitative analysis is indeed in the history of the role. –
Mbalib

Note that statistical arbitrage is a risky strategy, which is different from the "risk-free arbitrage" we normally understand.

This paper analyzes the difference between the spot RMB currency price and the Okcoin spot RMB price, analyzes whether the difference is to maintain a stable equilibrium relationship (that is, the steady-state process is mentioned in the stochastic process), and then obtains the conclusion that the difference is a steady-state process. On the basis of this conclusion, this paper designs a system prototype for statistical arbitrage of the difference value, and analyzes the source code realization of the system, which can be used for reference to the friends who want to do the bit-currency spread arbitrage.

Co-integration analysis

We buy a price of the fire money and Okcoin price for cointegration analysis, draw the following curve:

We are on the price difference (the fire currency to buy a minus okcoin sell a price difference), draw the following curve:

We have an ADF check on the spreads (the difference between the Okcoin and the price of a sale) and the results are as follows:

The cointegration p is a very small number, so we can determine that there is a very good cointegration between the two, and the statistical arbitrage strategy can be used on this price difference. The specific idea is: when the price difference is positive (and deviate from the average to a certain extent), we can buy Bitcoin from the Okcoin (the price is okcoin for one price), then sell the same amount of Bitcoin (the price is a price for the fire currency) from the currency of fire, and when the spreads shrink to close to 0 o'clock, We did a reverse operation on the operation just now.
So, if the price difference (the price of a coin to buy a minus okcoin) is negative (and the deviation from the average to a certain extent), it means that the price of the ignition currency is lower than the okcoin, this time, we need to sell the price of the fire currency and Okcoin buy a price for cointegration analysis, Draw the following curve:

We calculate the price difference (okcoin to buy a minus the difference of the price of the fire currency) to draw the following curve:

The results of the ADF check are as follows:

This co-integration value is still a very small number, so we can determine that there is a very good cointegration between the two, and the statistical arbitrage strategy can also be used on this price difference. Especially when the price difference is positive (and deviations from the average to a certain range), we can buy Bitcoin from the currency (the price is for the fire currency), then sell the same amount of Bitcoin from the Okcoin (the price for Okcoin to buy a price); When the spreads shrink to close to 0 o'clock, We did a reverse operation on the operation just now.

Thus, a two-way spread arbitrage model comes out.

Second, the source code realization

Please refer to Wequant Open source project.

Iii. how to hedge against the risk of spot-currency position

(1) Calculate the cash platform of the total market value of the bit currency + Futures platform bitcoin margin market value

Note that you need to take into account the total market value of the Bitcoin in all the spot platforms, such as when you make bricks on the okcoin and on the floor, and you need to figure out the total market value of the bitcoin you hold on the two-spot platform (in terms of fiat money, such as RMB).

(2) Select the lever multiples of the futures platform, such as 5 times times

(3) The result of hedging must be: short position of the Futures platform (currency calculation) = Margin market value of futures platform * open ratio * leverage ratio = Cash Platform Bitcoin Total market value + Futures platform bitcoin margin market value

The above is the basic idea of statistical arbitrage, but still want to emphasize any investment risks, please be sure to do their own, more scientific methods to control risk.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.