2017-12-07

Bitcoin System Trading Using Korbit API -Google translation

http://blog.nwsoft.co.kr/221116868162

Bitcoin system trading using Korbit API

A.
We implement a system trading automated trading system for bitcoin, compare the strengths and weaknesses of system trading of stocks or futures options, and measure the performance. We use Covert API and Google Apps Script as technical frames, and apply the Claude-Shannon's 50:50 rule and Kelly's formula 4% as the theoretical method for investment and asset management.

I.
System trading is already widely used in trading stocks or futures by automatically implementing program algorithms, and in recent years, robots equipped with machine learning and artificial intelligence algorithms are in the process of trading.
As a kind of investment assets, we will be able to trade by automating trading using bit coin, and we want to examine its advantages and disadvantages and achievements.


R.
There are many researches on how to develop indicators using system trading.
101 In the article called "Formulaic Alphas", the logic that is being used in practice is introduced.
  https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2701346

M.
1. Korbit API was used.
   https://apidocs.korbit.co.kr/

2. We minimized development time by using Google Sheet Apps-script.
   https://developers.google.com/apps-script/overview

3. 50:50 rule of Claude-Shannon
   Assuming that cash assets and investment assets are always 50:50, cash assets will have the basic logic of buying if the investment assets are sales orders, cash assets and investment assets.

4. Kelly's formula
   Knowing the dividend and loss rate that can be gained from a single investment, we calculate the ratio of the investment amount that maximizes the return on investment without bankruptcy.
    Kelly's Creterion K = (Wp - Lq) / pq (where W: odds, L: loss, p:

E.
I implemented the logic with the Apps-script of Google Sheet and set the trigger to execute the order once a day.
   if (condition == "tradeBuy") {
    if (testlive) order ("buy", "btc_krw", prices.bid, constants.minBtcOrder * kellyqty, tokens.accesstoken);
    tradeLog2Sheet (condition, prices.bid, constants.minBtcOrder * kellyqty, balances);
    return;
  } else if (condition == "tradeSell") {
    if (testlive) order ("sell", "btc_krw", prices.ask, constants.minBtcOrder * kellyqty, tokens.accesstoken);
    tradeLog2Sheet (condition, prices.ask, constants.minBtcOrder * kellyqty, balances);
    return;
  }

D.
There are limitations in that it is impossible to use many functions of system trading tools provided by brokerage firms, and therefore there is a limit to limit and simplest logic.
In order to utilize supplementary indices, it is necessary to invest a lot of time and effort, and algorithms will be complicated.
The advantage is that BitCoin system trading can be continued 24/7 trading without interruption, which is convenient because it does not have to deal with daily login manually compared to mainstream securities.

C.
1. During the first month or so, the automated trading system has achieved more than 20% of the investment.
TradeLogLive ### #. ### ### 6438500 6434500 121.23%

2. The log of the transaction is as follows. At first, the number of buyers continues to increase, but the ratio of investment assets continues to rise and the ratio of assets to cash is exceeded.

datetime cond price qty
2017-09-10 20:51:24 tradeBuy 4730000 #. ###
2017-09-11 7:37:54 tradeBuy 4840500 #. ###
2017-09-12 7:37:55 tradeBuy 4783000 #. ###
2017-09-13 7:37:54 tradeBuy 4755500 #. ###
2017-09-14 7:37:53 tradeBuy 4553500 #. ###
2017-09-15 7:37:54 tradeBuy 3689000 #. ###
2017-09-16 7:37:55 tradeBuy 4230000 #. ###
2017-09-17 7:37:54 tradeBuy 4161000 #. ###
2017-09-18 7:37:54 tradeBuy 4107000 #. ###
2017-09-19 7:37:57 tradeBuy 4426000 #. ###
2017-09-20 7:37:54 tradeBuy 4408500 #. ###
2017-09-21 7:37:54 tradeBuy 4411000 #. ###
2017-09-22 7:37:56 tradeBuy 4120500 #. ###
2017-09-23 7:37:58 tradeBuy 4160500 #. ###
2017-09-24 7:37:57 tradeBuy 4236500 #. ###
2017-09-25 7:37:58 tradeBuy 4206000 #. ###
2017-09-26 7:37:56 tradeBuy 4318500 #. ###
2017-09-27 7:37:58 tradeBuy 4363500 #. ###
2017-09-28 7:38:00 tradeSell 4589500 - #. ###
2017-10-01 7:37:56 NoTrade 4951000 0
2017-10-03 10:51:22 tradeSell 5028500 - #. # # #
2017-10-04 7:37:57 NoTrade 4898000 0
2017-10-05 7:37:58 NoTrade 4936000 0
2017-10-06 7:37:57 NoTrade 5005000 0
2017-10-07 7:37:57 NoTrade 5027000 0
2017-10-08 7:37:57 NoTrade 5240000 0
2017-10-09 7:37:58 tradeSell 5231500 - #. ###
2017-10-10 7:37:56 NoTrade 5520000 0
2017-10-11 7:37:57 NoTrade 5535000 0
2017-10-12 7:37:59 NoTrade 5547000 0
2017-10-14 10:29:35 tradeSell 6431000 - #. ###

During the trading period, the price of the bitcoin is changed from 4,700,000 won to 6,430,000 won. I think I need to track how much I boosted during the downward trend.

CryptoTrader for Android

Try new android version of the automatic trading system
Get it on Google Play

No comments:

Post a Comment