Title: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on July 02, 2011, 08:56:34 PM I made a simple trading client for the mtgox trading api a while back: https://github.com/molecular/traidor
I gave it an overhaul and I thought I'd share it, maybe someone likes it. Features:
https://i.imgur.com/yBkRQ.png (http://imgur.com/yBkRQ) To get started, first checkout the code: Quote #> git clone git://github.com/molecular/traidor.git #> cd traidor then prepare config-file and start traidor: Quote #> cp traidor.conf.sample traidor.conf #> edit traidor.conf #> python traidor.py The most important commands: Quote
Note: you must use a decimal point (".") when entering the <price> of an order. If you dont, <price> is interpreted as an index in the depth table (1st column "[IDX]") and the order is placed just above/below the price at that index. If you use and like it, consider a small donation to 1Ct1vCN6idU1hKrRcmR96G4NgAgrswPiCn Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 08, 2011, 08:23:03 AM during the last weeks I made quite a few improvements to traidor:
Any suggestions or bug reports always welcome. Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: GamblingPurveyor on August 09, 2011, 06:04:54 PM Storing the password in traidor.conf is insecure. An alternative is needed. Perhaps the password could be read from the TTY if the user doesn't provide it in traidor.conf.
Also, the program should check the $LINES and $COLUMNS environment variables every time it updates the screen, instead of having to set it manually with the d menu option. Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 09, 2011, 08:31:26 PM Storing the password in traidor.conf is insecure. An alternative is needed. Perhaps the password could be read from the TTY if the user doesn't provide it in traidor.conf. True. I will switch to using api-key, like goxsh does, with encrypted secret. Password authentication will be switched off for the api at some point anyhow. Your suggestion is a good way to deal with it in the meantime. If I get around, I'll implement that. Also, the program should check the $LINES and $COLUMNS environment variables every time it updates the screen, instead of having to set it manually with the d menu option. That's a good suggestion. Will probably implement that. Thanks for your feedback! Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: ffuentes on August 09, 2011, 08:42:42 PM I hope this script don't betray me!
Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: GamblingPurveyor on August 09, 2011, 09:07:17 PM WTF? I just noticed that this program uses the sound card to make strange "ticking" noises.
Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 09, 2011, 10:24:02 PM I hope this script don't betray me! The source code is right there to check. I'm sure if I inserted malicious code, it'd be reported here quite quickly. Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 10, 2011, 09:24:42 AM WTF? I just noticed that this program uses the sound card to make strange "ticking" noises. Yeah, that's the "ClickBot". I should probably make that optional or start it by command. btw, you can also set an alarm using the TriggerBot: Quote mtgox | x BTC | y USD #> tb >= 12.5 ps alarm.wav Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 10, 2011, 09:25:36 AM Storing the password in traidor.conf is insecure. An alternative is needed. Perhaps the password could be read from the TTY if the user doesn't provide it in traidor.conf. Also, the program should check the $LINES and $COLUMNS environment variables every time it updates the screen, instead of having to set it manually with the d menu option. Hmm, I tried reading $LINES from os.environ, it's not in there. while "echo $LINES" in bash works, "env | grep LINES" doesn't show it either. Any hint for me? Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: GamblingPurveyor on August 10, 2011, 11:27:02 PM After leaving this program running for 6-8 hours, I found this:
Code: mtgox | 0 BTC | 0.00458 USD | [h]elp #> Fatal Python error: (pygame parachute) Segmentation Fault Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: infested999 on August 15, 2011, 12:35:04 PM What version of python should I be using?
Code: jonny@netbook:~/traidor$ python traidor.py Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 15, 2011, 05:32:28 PM What version of python should I be using? Code: jonny@netbook:~/traidor$ python traidor.py The problem is you're missing wx tooklit, which I don't actually use currently anyways, so I commented out the import. Do a "git pull" and try again. Python 2.6.7 should work, 3.2 also, probably. I have 2.6.6 Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: infested999 on August 15, 2011, 07:22:17 PM What version of python should I be using? Code: jonny@netbook:~/traidor$ python traidor.py The problem is you're missing wx tooklit, which I don't actually use currently anyways, so I commented out the import. Do a "git pull" and try again. Python 2.6.7 should work, 3.2 also, probably. I have 2.6.6 Thanks, that worked. When I use the "gui" command I get this. Code: mtgox | 0 BTC | x.xxxxx USD | [h]elp #> gui Is this error just for me, or is the feature just not implemented yet? Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on August 15, 2011, 07:56:22 PM When I use the "gui" command I get this. Is this error just for me, or is the feature just not implemented yet? No, gui is not implemented and doesn't have high priority at all. First comes support for other exchanges, then probably some bots. Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: GamblingPurveyor on August 18, 2011, 03:56:31 AM Storing the password in traidor.conf is insecure. An alternative is needed. Perhaps the password could be read from the TTY if the user doesn't provide it in traidor.conf. Also, the program should check the $LINES and $COLUMNS environment variables every time it updates the screen, instead of having to set it manually with the d menu option. Hmm, I tried reading $LINES from os.environ, it's not in there. while "echo $LINES" in bash works, "env | grep LINES" doesn't show it either. Any hint for me? It turns out that $LINES and $COLUMNS are internal to BASH. The way you really get the size of the terminal is by sending the string "\x1b[18t" (hex: 1b, 5b, 31, 38, 74) to stdout. You'll get a response in the form of "\x1b[8;L;Ct" on stdin, where L and C are the lines and columns, respectively. To allow you to avoid having to send this sequence before every screen update, xterm will send your program the SIGWINCH signal every time the size of the window changes. Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: m3ta on August 22, 2011, 04:15:16 AM $ python -V
Python 2.7.1+ $ python traidor.py Traceback (most recent call last): File "./traidor.py", line 17, in <module> from websocket import WebSocket ImportError: Bad magic number in /btc/traidor/websocket/__init__.pyc Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: molecular on December 04, 2012, 08:50:19 PM $ python -V Python 2.7.1+ $ python traidor.py Traceback (most recent call last): File "./traidor.py", line 17, in <module> from websocket import WebSocket ImportError: Bad magic number in /btc/traidor/websocket/__init__.pyc dude, didn't even see this. try "git pull". Title: Re: traidor.py - command-driven text-mode trading client (mtgox) Post by: supert on April 04, 2013, 01:55:32 PM OS X 10.6.8
stock python, macports simplejson and pygame. Couldn't find a websockets in macports, assuming already there? I get Code: :~/data/bitcoin/bots/traidor$ python traidor.py Any ideas? |