Bitcoin Forum
July 30, 2024, 03:20:25 AM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 »  All
  Print  
Author Topic: ncurses based MtGox live monitor and trading-bot-framework  (Read 33821 times)
toffoo
Sr. Member
****
Offline Offline

Activity: 408
Merit: 261



View Profile
March 25, 2013, 01:04:09 AM
 #21

Congratulations and thank you to prof7bit (I've tried many CLI-type tools posted here and this is probably the best) and also to MagicalTux because the new beta streaming socket.io feed is FINALLY the first real improvement in reliability since pretty much ever.  You can get it with something like this:

Code:
goxtool.py --protocol=socketio-beta

I am on Mac and can confirm it is working really good.

I believe new Mac OS X versions ship with python v2.7 installed.

Along with prof7bit's code you need to install this pycrypto package from here:

https://pypi.python.org/pypi/pycrypto

which of course will not install unless you have XCode installed, because it needs to compile something.  If you don't want to install or don't have XCode you can also download a Command Line Only Tools package which can also compile/install this if you register as an Apple Developer.

If you can post us some boilerplate examples on how to use strategy.py I will certainly tip your donation address if I manage to make any money autotrading with this thing.

wumpus
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
April 01, 2013, 10:49:13 AM
 #22

Ha, bravo. Looks great.

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
01BTC10
VIP
Hero Member
*
Offline Offline

Activity: 756
Merit: 503



View Profile
April 01, 2013, 04:23:42 PM
 #23

What is missing?

Code:
~/goxtool$ ./goxtool.py 
Traceback (most recent call last):
  File "./goxtool.py", line 30, in <module>
    import goxapi
  File "/home/r2d2/goxtool/goxapi.py", line 34, in <module>
    from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher

~/goxtool$ ./goxtool.py --add-secret
Traceback (most recent call last):
  File "./goxtool.py", line 30, in <module>
    import goxapi
  File "/home/r2d2/goxtool/goxapi.py", line 34, in <module>
    from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher

~/goxtool$ python --version
Python 2.7.3
toffoo
Sr. Member
****
Offline Offline

Activity: 408
Merit: 261



View Profile
April 01, 2013, 04:30:32 PM
 #24


Along with prof7bit's code you need to install this pycrypto package from here:

https://pypi.python.org/pypi/pycrypto


01BTC10
VIP
Hero Member
*
Offline Offline

Activity: 756
Merit: 503



View Profile
April 01, 2013, 04:36:05 PM
 #25


Along with prof7bit's code you need to install this pycrypto package from here:

https://pypi.python.org/pypi/pycrypto

Working thanks very much!
refer_2_me
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
April 02, 2013, 03:50:02 AM
 #26

Hi, this looks great. I am trying to get started writing some custom trading strategies, but I am having some trouble figuring out the API. Could you post some sample strategy files for me to work off of? I'm not looking for your secret strategy, but rather a more in depth framework, i.e. where does the code for deciding to buy/sell go etc.

Thanks again for this great looking tool!

BTC: 1reFerkRnftob5YvbB112bbuwepC9XYLj
XPM: APQpPZCfEz3kejrYTfyACY1J9HrjnRf34Y
ScarecrowMagick
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
April 05, 2013, 01:24:13 AM
Last edit: April 05, 2013, 03:01:40 AM by ScarecrowMagick
 #27

So far this looks awesome. How long does it take for Account: No Info (yet)  to update, or am I doing something wrong?

Nevermind, I had a dificulty with my key entry. All is awesome now.

Scarecrowmagick
JWU42
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


View Profile
April 12, 2013, 01:28:14 AM
Last edit: April 12, 2013, 01:49:25 AM by JWU42
 #28

I keep getting

Code:
Account: No info (yet)

EDIT - Seems using
Code:
--protocol socketio
didn't work to ever get account info.

ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
April 12, 2013, 12:32:30 PM
 #29

I keep getting

Code:
Account: No info (yet)

EDIT - Seems using
Code:
--protocol socketio
didn't work to ever get account info.

You need to create a GOX API Key if you want to see your account info.  If you just want to display market conditions you don't need to do this:

To use the trading features do the following:

./goxtool.py --add-secret

This will ask you for your MtGox API key and secret, you get them at the mtgox website, copy and paste key and secret, supply a passphrase which will be used to encrypt the secret. Then it will write the encrypted secret to goxtool.ini and exit. The next time you start ./goxtool.py it will ask for the passphrase to access the API secret and then all trading functions will be enabled, you will see your own orders in the orderbook and in the chart and your account balance at the top of the terminal.


░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
JWU42
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


View Profile
April 12, 2013, 12:36:47 PM
 #30

Seriously think I didn't do that first  Grin

The issues all related to the API being down for the first bit after the re-start last night.

Using

Code:
./goxtool.py --protocol socketio --use-http

got it working as it fetched account data via HTTP instead of the API.

fnordfnordfnord
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
April 13, 2013, 03:01:18 AM
 #31

This is rad thanks prof7bit. Now if Mtgox will just handle their business.
fnordfnordfnord
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
April 14, 2013, 03:37:16 AM
Last edit: April 14, 2013, 03:50:43 AM by fnordfnordfnord
 #32

New ticker

http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast

http://www.reddit.com/r/Bitcoin/comments/1c9npl/mtgox_fast_ticker_last_only_no_rate_limit_1second/
fujiwara
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
April 15, 2013, 08:27:23 AM
 #33

Great! I even managed to set it up. But what about strategy.py - any examples?
dutt
Member
**
Offline Offline

Activity: 135
Merit: 10



View Profile WWW
April 15, 2013, 07:19:54 PM
 #34

prof7bit, the people demand bitfloor support Grin

prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
April 16, 2013, 03:03:42 PM
 #35

Great! I even managed to set it up. But what about strategy.py - any examples?

Here is an example: https://gist.github.com/prof7bit/5395900

Read everything below carefully and don't run it if you not 100% understand what it does and what its implications are, including temporary loss when BTC price goes down! I'm not giving any support or guarantee for this, its only example code, I'm using it myself but I'm not going to give support for any trading bot code, you can only run a trading bot if you 100% understand what it does!


* Save the above file in _balancer.py (I'm using underscores because these filenames are in .gitignore)

* Update goxtool to the very latest version (important because there is a new slot in strategy.py!)

* Then start goxtool:

./goxtool.py --strategy=_balancer.py --protocol=socketio --use-http

* bring your account into 50/50 balance manually (exactly half of the money in USD, other half in BTC at current price, use a pocket calculator to have really exact numbers, then cancel all open orders)

* Then press p (this will place 2 orders above and below price. If they seem wrong press c to cancel them again and find the error. if anything is wrong press c to cancel orders and effectively stop the bot)

The bot will trade if one of the orders has been filled, it will then cancel the other one and place two fresh orders above and below last trade price. The bot will maintain a 50/50 ratio of your USD and BTC account balances. Please read about portfolio rebalancing to understand the implications and why you would want (or not want) to do this. This should only be regarded as exemplary code, study it to learn how to use the trading API, don't just run it blindly. I repeat: I will not be responsible for any damage you do to your money!

If you look closely you will see that it is working around some limitations of the gox streaming API. Trade messages and user_order messages will not arrive in the order we would ideally like to have, I cannot trigger any action from within slot_trade() because at this time the number of open orders will not yet have been updated (fortunately the wallet *will* be updated already), so I need to jump through one additional hoop. If you design a bot yourself then print debug output until you understand the exact order in which the messages arrive and which information is available at which time.

ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
April 16, 2013, 03:59:07 PM
 #36

Thanks for this prof7bit.  Taking a look now.

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
infebious
Newbie
*
Offline Offline

Activity: 20
Merit: 0



View Profile
April 17, 2013, 02:24:39 AM
 #37

I just sent a donation your way!  Thanks for this it's exactly what I needed.   Grin
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
April 17, 2013, 06:23:34 PM
 #38

I just sent a donation your way!  Thanks for this it's exactly what I needed.   Grin
As did I.... 

I was able to make some money, nothing huge, but sent it your way for all your hard work.

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
JWU42
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


View Profile
April 17, 2013, 06:45:12 PM
 #39

Just another friendly mention that a Bitfloor "version" would be of interest.  If there needs to be a minimum pledged let us know as I am fairly sure it can be accomplished.

prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
April 17, 2013, 07:34:42 PM
 #40

Just another friendly mention that a Bitfloor "version" would be of interest.  If there needs to be a minimum pledged let us know as I am fairly sure it can be accomplished.

I have thought about this too already. Its just a matter of time. But since its GPL maybe someone else who is faster than me can fork it and make a bitfloor version, maybe with some refactoring it might even be possible later to combine both into one tool again. Its not imposible its just some work that needs to be done and time to put into it and I also have so many other unfinished things that occasionally need my attention, I wish I could fork myself into many parallel processes to get more stuff done ;-)

Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 »  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!