Bitcoin Forum
June 22, 2024, 02:49:21 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: HFT scripts on the kraken API.  (Read 115 times)
zeronomicoin (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
July 16, 2019, 03:52:34 PM
Last edit: July 17, 2019, 10:27:44 AM by zeronomicoin
 #1


Gains depend with invested volume.
Someday there are more than 10 tx. Some other, the program places sell price upper the rate of the day and there is no tx (HFT risks...). That's why we have to check in order to run another "instance" with a different "standard deviation", and eventually increase time-lags between bids.
It can become a full time job, with 1 bitcoin investment, even at 6000$ we can easily make 700$ to 10 times more a day !


$ ./randomtimebuyfirst
Usage : ./randomtimebuyfirst <pair> <volume> <standard deviation> (randomtime <min> <max>)
$ ./randomtimebuyfirst XXBTZEUR 0.0198 132 120 1400


Here first order is to buy 0.0198 BTC 132EUR lower than actual rate (at runtime).
Following order is to sell 0.0198 BTC 132EUR upper than begin price.

Check price randomly between 120 sec. and 23 min.
We can set 0.5 to 0.501 sec. if relevant ...

We receive an email with last transaction details.


OSZBNZ-VYO5N-E4C4PR  opened 2019-06-22 14:36:43  closed 2019-06-22 14:36:43 (UTC)
   status : closed
   fee : 0.4
   expiretm : 0
   descr :
      leverage : none
      ordertype : market
      price : 0
      close :
      pair : XBTEUR
      price2 : 0
      type : buy
      order : buy 0.01980000 XBTEUR @ market
   vol : 0.01980000
   closetm : 1561214203.35
   trades : TIVM4H-DO4NA-CVCGXK
   misc :
   starttm : 0
   limitprice : 0.00000
   price : 9120.6
   cost : 180.5
   reason : None
   userref : 0



Next trade :


OOA4UG-UIU42-CYB3AE  opened 2019-06-22 15:00:07  closed 2019-06-22 15:00:07 (UTC)
   status : closed
   fee : 0.4
   expiretm : 0
   descr :
      leverage : none
      ordertype : market
      price : 0
      close :
      pair : XBTEUR
      price2 : 0
      type : sell
      order : sell 0.01980000 XBTEUR @ market
   vol : 0.01980000
   closetm : 1561215607.56
   trades : TGNJHW-DUPP5-JUWNM6
   misc :
   starttm : 0
   limitprice : 0.00000
   price : 9461.8
   cost : 187.3
   reason : None
   userref : 0



When a "loop" (first we buy, then sell) is done, volume can be increased.


Another script adjusts "standard deviation" at each new rate (very risky ... but ...  Smiley
Time between each price check is set here at 15.5 sec.


$ ./time_rtsellfirst
Usage : ./time_rtsellfirst <pair> <volume> <standard deviation> <time check (sec.)>


$ ./time_rtsellfirst XXBTZUSD 0.1 2.1 15.5

   BEGIN PRICE 10520.7USD
   Volume 0.1

10510.1  sell at 10522.8
10520.7  sell at 10512.2
{u'error': [u'EOrder:Insufficient funds']}
sell 0.1 at 10520.7USD

email sent

0 transaction(s)

   2019-07-16 17:35:54
10510.1  buy at 10518.6
{u'error': [u'EOrder:Insufficient funds']}
buy 0.1 at 10510.1USD

email sent

0 transaction(s)

   2019-07-16 17:36:03

   BEGIN PRICE 10557.3USD
   Volume 0.10050

10557.3  sell at 10559.4
10557.3  sell at 10559.4
10557.3  sell at 10559.4
10557.3  sell at 10559.4
10555.4  sell at 10559.4
10555.4  sell at 10557.5
10550.5  sell at 10557.5
10555.4  sell at 10552.6
{u'error': [u'EOrder:Insufficient funds']}
sell 0.10050 at 10555.4USD

email sent

0 transaction(s)

   2019-07-16 17:38:06
10549.1  buy at 10555.2
{u'error': [u'EOrder:Insufficient funds']}
buy 0.10050 at 10549.1USD

email sent

0 transaction(s)

   2019-07-16 17:38:16

   BEGIN PRICE 10549.1USD
   Volume 0.10100

10550.0  sell at 10551.2
...

It checks market price, then it can sell at (from) 10551.2 but if it's upper, it will sell upper ...
You see ?


$ ./randomtimebuyfirst XXBTZEUR 0.03951 140 120 1400


        BEGIN PRICE 9556.7EUR
        Volume 0.03951

9556.7  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 994.49 sec. (11:51:40)
9558.1  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 1378.85 sec. (12:14:40)
9560.9  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 1193.14 sec. (12:34:33)
2019-07-16 12:14:40
9544.8  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 869.70 sec. (12:49:03)

... <snip> ...

9470.1  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 679.57 sec. (14:47:04)
9495.8  buy at 9416.7
next bid : 0.03951 at 9416.7 EUR in 733.52 sec. (14:59:18)
9385.9  buy at 9416.7
{'error': [], 'result': {'descr': {'order': 'buy 0.03951000 XBTEUR @ market'}, 'txid': ['ODQUIL-2NTZZ-ZBILSN']}}
buy 0.03951 at 9385.9EUR

email sent

ODQUIL-2NTZZ-ZBILSN  opened 2019-07-16 12:59:20  closed 2019-07-16 12:59:20 (UTC)
        refid : None
        userref : 0
        status : closed
        reason : None
        opentm : 1563281960.7044
        closetm : 1563281960.7186
        starttm : 0
        expiretm : 0
        descr :
                pair : XBTEUR
                type : buy
                ordertype : market
                price : 0
                price2 : 0
                leverage : none
                order : buy 0.03951000 XBTEUR @ market
                close :
        vol : 0.03951000
        vol_exec : 0.03951000
        cost : 370.9
        fee : 0.9
        price : 9390.0
        stopprice : 0.00000
        limitprice : 0.00000
        misc :
        oflags : fciq
        trades : TDZOOK-2ZBTT-QRLJUX

1 transaction(s)

        2019-07-16 14:59:27
9385.9  sell at 9696.7
next bid : 0.03951 at 9696.7 EUR in 552.00 sec. (15:08:40)
2019-07-16 14:59:28

...





$ ./closed_orders 1

OVG6EB-DF6LJ-VUC45L  opened 2019-07-15 20:22:55  closed 2019-07-15 20:22:55 (TZ)
   status : closed
   fee : 0.9
   expiretm : 0
   descr :
      leverage : none
      ordertype : market
      price : 0
      close :
      pair : XBTEUR
      price2 : 0
      type : sell
      order : sell 0.03951000 XBTEUR @ market
   vol : 0.03951000
   closetm : 1563214975.8
   trades : TOF7JP-JW2QG-QHJRHZ
   misc :
   starttm : 0
   limitprice : 0.00000
   price : 9549.0
   cost : 377.2
   reason : None
   userref : 0
   vol_exec : 0.03951000
   oflags : fciq
   refid : None
   stopprice : 0.00000
   opentm : 1563214975.78

ODQUIL-2NTZZ-ZBILSN  opened 2019-07-16 14:59:20  closed 2019-07-16 14:59:20 (TZ)
   status : closed
   fee : 0.9
   expiretm : 0
   descr :
      leverage : none
      ordertype : market
      price : 0
      close :
      pair : XBTEUR
      price2 : 0
      type : buy
      order : buy 0.03951000 XBTEUR @ market
   vol : 0.03951000
   closetm : 1563281960.72
   trades : TDZOOK-2ZBTT-QRLJUX
   misc :
   starttm : 0
   limitprice : 0.00000
   price : 9390.0
   cost : 370.9
   reason : None
   userref : 0
   vol_exec : 0.03951000
   oflags : fciq
   refid : None
   stopprice : 0.00000
   opentm : 1563281960.7

2 transaction(s)



You can let HFT bots platforms like Cryptohopper or Haasbot play with your API key, or run your own and doing it yourself !



Contact  <zeronomicoin@gmail.com> (641CE2E33060003C)

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!