Bitcoin Forum
May 07, 2024, 03:23:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 [6] 7 8 »  All
  Print  
Author Topic: goxtool bot: portfolio rebalancing  (Read 26522 times)
supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
August 21, 2013, 11:02:00 AM
 #101

I like this idea - have you considered writing the tool for bitstamp's API too? Their percentage of total bitcoin trading volume has risen a fair amount recently.

+1

I offer 0.2 btc bounty for this.

I know it's not much for the work but I hope others will add to it.
1715052180
Hero Member
*
Offline Offline

Posts: 1715052180

View Profile Personal Message (Offline)

Ignore
1715052180
Reply with quote  #2

1715052180
Report to moderator
1715052180
Hero Member
*
Offline Offline

Posts: 1715052180

View Profile Personal Message (Offline)

Ignore
1715052180
Reply with quote  #2

1715052180
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715052180
Hero Member
*
Offline Offline

Posts: 1715052180

View Profile Personal Message (Offline)

Ignore
1715052180
Reply with quote  #2

1715052180
Report to moderator
sturle
Legendary
*
Offline Offline

Activity: 1437
Merit: 1002

https://bitmynt.no


View Profile WWW
August 21, 2013, 12:11:31 PM
 #102

I like this idea - have you considered writing the tool for bitstamp's API too? Their percentage of total bitcoin trading volume has risen a fair amount recently.
+1

I offer 0.2 btc bounty for this.

I know it's not much for the work but I hope others will add to it.
Bitstamp's API is pretty bad, and the security is even worse.  You  send your username and password in every request.  No API keys and no grading of permissions.  If you are somehow tricked into sending a request to the wrong server, you just gave away your account.  MtGox's API is much better in all regards.  A request sent to the wrong server contains no information of any use to anybody.

Bitcurex has an API very similar to MtGox v0, btw.  Should be trivial to port.

Sjå https://bitmynt.no for veksling av bitcoin mot norske kroner.  Trygt, billig, raskt og enkelt sidan 2010.
I buy with EUR and other currencies at a fair market price when you want to sell.  See http://bitmynt.no/eurprice.pl
Warning: "Bitcoin" XT, Classic, Unlimited and the likes are scams. Don't use them, and don't listen to their shills.
Aido
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
October 24, 2013, 08:45:21 PM
 #103

I like this idea - have you considered writing the tool for bitstamp's API too? Their percentage of total bitcoin trading volume has risen a fair amount recently.

+1


Bitstamp's API is pretty bad, and the security is even worse.  You  send your username and password in every request.  No API keys and no grading of permissions.

Bitstamp have now implemented API keys

https://www.bitstamp.net/article/api-key-implementation/


Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
October 24, 2013, 08:48:52 PM
 #104

hmmm.. goxtool cross-exchange arbitrage... could be neat.
ruggero
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile WWW
November 23, 2013, 11:23:17 AM
 #105

I'm right now testing _balancer.py (the version from Github) and I only changed the DISTANCE parameter from 7 to 11.

Before starting I balanced the amount of BTC/$ in my account and made sure the order book was empty.

I start goxtools with the commandline ./goxtool.py --strategy=_balancer.py --protocol=websocket --use-http.

I push "p" and the bot places its two orders. Since last night the bot hit the higher threshold twice, and twice it canceled the remaining order and placed two new orders.
But apparently the script didn't place the new orders at distance 11 from where the BTC sale happened, but started placing them at the same sale/buy price of where the previous buy/sale happened, so that my balances were quickly being eroded by the fees.

So I stopped it for now and decided to ask first. Any ideas? Thanks!
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
November 23, 2013, 11:54:48 AM
 #106

but started placing them at the same sale/buy price of where the previous buy/sale happened

This should not happen. After a trade is filled the balances (as displayed in the status bar at the top) should be *immediately* updated, the new orders are calculated from the balances. I have currently no idea what might be the reason for the symptoms you describe. Are you running the very latest version of goxtool?

ruggero
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile WWW
November 23, 2013, 12:14:43 PM
 #107

Yes git cloned from the repository yesterday afternoon.

I decided to run a new test on my desktop computer (previous attempt was from a raspberry pi) from scratch, in a more controlled environment.

So I wiped everything from the RaspberryPi and git cloned goxtools and _balancer.py once again on a macmini (OSX 10.8.6).

I deleted the old API key on Gox, and made a new one. Also I made sure no pending orders were there.

I ran ./goxtools.py --add-secret and successfully registered my API key.

I edited _balancer.py so that the parameters state:
DISTANCE=11
FIAT_COLD=0
COIN_COLD=0

I launched goxtools: screen ./goxtool.py --strategy=_balancer.py --protocol=websocket --use-http

Within goxtools I balanced the BTC/$ amounts in my account using "b".
The balance was set on BTC 0.08513863 + USD 72.08415.

Then I pushed "p" and the orders were placed. "i" gives the following debug output:

2013-11-23 13:03:27,278:DEBUG:_balancer.Strategy:BTC difference at current price: -0.00055701
2013-11-23 13:03:27,281:DEBUG:_balancer.Strategy:Price where it would be balanced: 846.66796


And I'm waiting now for the trigger to hit either marker (753$~939$).

Have I missed anything?
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
November 23, 2013, 05:57:18 PM
 #108

Have I missed anything?

should work. The only thing that I could imagine causing problems are if the balance were too small (or the distance too small) so that the orders would be less than 0.01 BTC and this would not be allowed on MtGox. Then goxtool would round up to 0.01 BTC and that could cause it come out of balance too far. How large are the orders it has placed?

I'm running my balancer currently with $30k USD and 36 BTC, my order sizes are 1.79 and 1.98 currently (at 11% distance)

ruggero
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile WWW
November 23, 2013, 08:03:43 PM
 #109

When it happened it was with an order size of 0.03.
At the moment I have an order size of 0.01. Do you think I should increase it?
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
November 23, 2013, 08:16:11 PM
 #110

When it happened it was with an order size of 0.03.
At the moment I have an order size of 0.01. Do you think I should increase it?
Yes, either more money into the account or larger distance

ruggero
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile WWW
November 26, 2013, 10:25:58 AM
 #111

Hi again! Thanks for your reply.
After a couple of days of mining (and rescuing that little I managed to rescue from the BTC I had invested in mcxNOW fees) I added more balance to my Gox balance.

While I have distance still set to 11, I have now 1.08 BTC + 135 USD in Gox and 6 BTC + 6000 USD as cold balance.
The orders the script placed are now 0.35 for Selling BTC and 0.43 for Buying BTC.

And, yes, I unbalanced the cold wallet on purpose as I would like always to end up with a little more BTC than dollars.

I'll keep you posted if this time it works. Hopefully the price is gonna soon hit one of the triggers.

Thanks for your effort in creating goxtools, and if/when I make it work I'll be sure to send a donation your way with the first earnings!
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
November 26, 2013, 12:01:18 PM
 #112

I'll be sure to send a donation your way with the first earnings!
Please don't expect too much. If bitcoin price goes up from here and never comes back then you will increase the USD balance but at the same time decrease the BTC balance. You will still overall have more money than you had before but not in terms of BTC alone, and also less than if you had held 100% BTC all the time. You will see BTC denominated profits only if you stop the bot at around the same price where you started it, otherwise it mostly serves as an automated mechanism to keep your BTC exposure (and therefore your risk) at a constant level instead of letting it rise dangerously high with increasing price.

supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
November 29, 2013, 12:09:17 PM
 #113

I'll be sure to send a donation your way with the first earnings!
Please don't expect too much. If bitcoin price goes up from here and never comes back then you will increase the USD balance but at the same time decrease the BTC balance. You will still overall have more money than you had before but not in terms of BTC alone, and also less than if you had held 100% BTC all the time. You will see BTC denominated profits only if you stop the bot at around the same price where you started it, otherwise it mostly serves as an automated mechanism to keep your BTC exposure (and therefore your risk) at a constant level instead of letting it rise dangerously high with increasing price.

I second this. With backtesting, and in principle, the main function of the balancer is to reduce volatility at the expense of some upside. I.e. you will get less profit but smoother profit.

It does do well in mean-reverting markets though (such as in the recent crashes).
grbox2001
Member
**
Offline Offline

Activity: 119
Merit: 100


View Profile
December 10, 2013, 11:53:41 AM
 #114

I used to run this bot and I am curious how it did during all the recent market insanity.
whizter
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500


View Profile
December 10, 2013, 09:02:47 PM
 #115

I used to run this bot and I am curious how it did during all the recent market insanity.


This is what it should have done in the last 2 weeks: https://cryptotrader.org/backtests/fNnNrr3t7Yq5t57FD
You can see a small profit there.

        ███████████████████▄▄▄
        ████████████████████████▄▄
           ████████████████████████▄
    ▄▄▄▄▄▄▄██████████████████████████▄
    ███████████████       ▀▀███████████
        ███████               ██████████
        ███████                ██████████
████████   ████████             █████████
▀▀▀▀▀▀▀▀▄▄▄████████             █████████
        ███████████             █████████
    ████   ████████            ██████████
    ████   ████████           ██████████
        ███    ████       ▄▄███████████
    ▄▄▄▄███▄▄▄▄██████████████████████▀
    ███████████████████████████████▀
████    ████████████████████████▀▀
████    ███████████████████▀▀▀
DIMCOIN   
❱❱❱  facebook  ❱❱❱  twitter  ❱❱❱  Telegram  ❱❱❱
.The Future of Equity on The Blockchain.
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
December 10, 2013, 10:06:47 PM
 #116


fatal
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 11, 2013, 08:48:35 PM
 #117

Anyone having problems connecting to the api?

i'm getting:

2013-12-11 12:45:46,705:DEBUG:goxapi.WebsocketClient:trying plain old Websocket: wss://websocket.mtgox.com?Channel=depth.BTCUSD/ticker.BTCUSD ...
2013-12-11 12:45:46,964:DEBUG:goxapi.WebsocketClient:WebSocketConnectionClosedException  reconnecting in 1 seconds...
2013-12-11 12:45:47,966:DEBUG:goxapi.WebsocketClient:trying plain old Websocket: wss://websocket.mtgox.com?Channel=depth.BTCUSD/ticker.BTCUSD ...

piramida
Legendary
*
Offline Offline

Activity: 1176
Merit: 1010


Borsche


View Profile
December 11, 2013, 09:45:52 PM
 #118

yes, it does not work anymore. not just for this bot, for anyone.

i am satoshi
Aido
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
December 11, 2013, 09:51:15 PM
 #119

Yes, MtGOX API has been down for several hours now. DDoS apparently.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
whizter
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500


View Profile
December 11, 2013, 10:31:26 PM
 #120

it seems to work when you switch to socketio instead of websocket.

EDIT: no it doesn't update anything then.

        ███████████████████▄▄▄
        ████████████████████████▄▄
           ████████████████████████▄
    ▄▄▄▄▄▄▄██████████████████████████▄
    ███████████████       ▀▀███████████
        ███████               ██████████
        ███████                ██████████
████████   ████████             █████████
▀▀▀▀▀▀▀▀▄▄▄████████             █████████
        ███████████             █████████
    ████   ████████            ██████████
    ████   ████████           ██████████
        ███    ████       ▄▄███████████
    ▄▄▄▄███▄▄▄▄██████████████████████▀
    ███████████████████████████████▀
████    ████████████████████████▀▀
████    ███████████████████▀▀▀
DIMCOIN   
❱❱❱  facebook  ❱❱❱  twitter  ❱❱❱  Telegram  ❱❱❱
.The Future of Equity on The Blockchain.
Pages: « 1 2 3 4 5 [6] 7 8 »  All
  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!