-
Notifications
You must be signed in to change notification settings - Fork 28
Getting started
-
Make sure you have Python installed. Right now this code isn't compatible with Python3, so if you need to install Python, make sure to get the latest 2.x version (which at the moment is 2.7.4.
-
Get the source code; the easiest way to do that is to download these two files:
-
Extract these two files to wherever you like on your machine (like maybe C:\temp).
-
Open a command window (Windows+R, type "cmd" and hit enter)
-
In the command window, change to where you extracted the btce-api source code:
cd C:\temp\btce-api-master
-
Install the btce-api library into your Python setup (note that you might have to type C:\Python27\python instead of python depending on what your Python installer did):
python setup.py install
-
In the command window, change to where you extracted the btce-bot source code:
cd C:\temp\btce-bot-master
-
Install the btce-bot library into your Python setup:
python setup.py install
-
You'll need a file containing your key and secret data from BTC-e:
- Go to your "profile" page and click the "API keys" button.
- If you don't already have a key, give it whatever name you like in the "Create Key" field and click "Create"
- Check the "info" box if you just want to collect market data with the key; check "trade" as well if you want to execute trades.
- Click "Save"
- Create a new text file wherever you like on your computer (for example, I might use C:\Users\Alan\My Documents\btce-keys.txt).
- Copy the "Key" and "Secret" fields into your text file, one on each line, and then add a third line with "1" in it. You should end up with a file that has three lines looking something like this in it (you don't need any spaces before or after anything on these lines, or any blank lines, and of course your key and secret will be completely different):
GZGQE3IY-8WHYJANV-S5DSYB5Z-BERG3J79-8K8NSSP6 a034b00c827a84400956d697a7da0a216cb6cde9818ccf5346b3e0979a34fdfa 1
- Save this file and close the text editor, but remember where you saved it.
-
In the command window, go to the sample bot directory:
cd C:\temp\btce-bot-master\samples
-
Run the sample bot; it will want to know where your keys file is, and the prices you want to buy and sell at (in this case, I'm pointing it to my text file created in step 8, and I want to buy LTC at $4.00, and sell at $4.10--the sample only does LTC-USD trades, but you can look for "ltc_usd" in hello-world-bot.py and replace it with whatever pair you'd like to trade):
python hello-world-bot.py "C:\Users\Alan\My Documents\btce-keys.txt" 4.0 4.1
When you run the bot this way, it will tell you what trades it would like to make, but it won't actually make any trades. To run and make real trades, you have to add the --live-trades argument to the command:
python hello-world-bot.py "C:\Users\Alan\My Documents\btce-keys.txt" 4.0 4.1 --live-trades
And that should be it!