Bitcoin Forum
May 25, 2024, 12:02:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Trying to create BTC-e Trading bot using google scripts  (Read 1074 times)
erpage (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 17, 2015, 03:35:17 AM
Last edit: March 18, 2015, 01:48:54 AM by erpage
 #1

Hello. I am interested in creating my own trading bot for the btc-e exchange. I can program a little but let me worry about that. The thing I don't understand is how the api works. The documentation gives you this:
"https://btc-e.com/tapi" (I'm just showing you the url, I'm not trying to link you to anywhere)

I was able to create a small script in google sheets that retrieves the info from that page and inserts it into a cell so actually getting the info won't be a problem. I just don't understand what else I am supposed to put in the URL. I don't understand the documentation on btc-e. How do insert the key/secret? How do I give Parameters?

I would assume it would be as simple as giving me a sample URL with a made up key and secret, but the fact that they didn't do that tells me that it isn't that simple. Is this correct? If not, could someone give me an example?

Disclaimer: I don't expect this bot to actually be good, I just thought it would be a fun project. Also programming the actual algorithm won't be a problem. I do have experience with that. I just don't know how to get it to communicate with the api.

Thank you for reading!

Edit: I am using javascript
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
March 17, 2015, 01:02:18 PM
 #2

What language are you using?

Here's a good example with PHP straight from btc-e

http://pastebin.com/8fbMCguM

Just put in your info and uncomment the last line by removing the forward slashes.
Comment
Code:
//$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));
Uncomment: This will buy $1 USD worth when BTC is worth $100
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));

This will buy $5 USD worth when BTC is worth $300
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 5, 'rate' => 300));


erpage (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 18, 2015, 01:48:17 AM
 #3

What language are you using?

Here's a good example with PHP straight from btc-e

http://pastebin.com/8fbMCguM

Just put in your info and uncomment the last line by removing the forward slashes.
Comment
Code:
//$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));
Uncomment: This will buy $1 USD worth when BTC is worth $100
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));

This will buy $5 USD worth when BTC is worth $300
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 5, 'rate' => 300));



Thanks for the reply. I am using Javascript. Sorry I guess I should have mentioned that. I don't really know how to translate that code to javascript though which is the biggest issue I've been having with all the examples.

Could I just get an example url that the bot would be sending? What in an example situation would go after "https://btc-e.com/tapi/"?
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
March 18, 2015, 04:43:08 AM
 #4

What language are you using?

Here's a good example with PHP straight from btc-e

http://pastebin.com/8fbMCguM

Just put in your info and uncomment the last line by removing the forward slashes.
Comment
Code:
//$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));
Uncomment: This will buy $1 USD worth when BTC is worth $100
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));

This will buy $5 USD worth when BTC is worth $300
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 5, 'rate' => 300));



Thanks for the reply. I am using Javascript. Sorry I guess I should have mentioned that. I don't really know how to translate that code to javascript though which is the biggest issue I've been having with all the examples.

Could I just get an example url that the bot would be sending? What in an example situation would go after "https://btc-e.com/tapi/"?

BTC-e's trade API requires you to do a HMAC SHA512 hash of your post data. As far as I know javascript does not do HMAC SHA512 hashes. Did you look at some of the language examples available? https://btc-e.com/api/documentation

erpage (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 18, 2015, 03:00:20 PM
 #5

What language are you using?

Here's a good example with PHP straight from btc-e

http://pastebin.com/8fbMCguM

Just put in your info and uncomment the last line by removing the forward slashes.
Comment
Code:
//$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));
Uncomment: This will buy $1 USD worth when BTC is worth $100
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 100));

This will buy $5 USD worth when BTC is worth $300
Code:
$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 5, 'rate' => 300));



Thanks for the reply. I am using Javascript. Sorry I guess I should have mentioned that. I don't really know how to translate that code to javascript though which is the biggest issue I've been having with all the examples.

Could I just get an example url that the bot would be sending? What in an example situation would go after "https://btc-e.com/tapi/"?

BTC-e's trade API requires you to do a HMAC SHA512 hash of your post data. As far as I know javascript does not do HMAC SHA512 hashes. Did you look at some of the language examples available? https://btc-e.com/api/documentation

Oh okay. Well that's disappointing. The reason I wanted to do it with javascript was because I wanted to make it in google sheets because it allows you to set up a timer that will trigger the script every set interval of time which would mean it would run off of google's servers for free and I wouldn't have to keep my computer running it. Also Since it's google sheets I could have it store the data in a spreadsheet. Damn so there is no way to get it to work in javascript?
arunka71
Sr. Member
****
Offline Offline

Activity: 410
Merit: 257


View Profile
March 18, 2015, 06:13:04 PM
 #6

I would help you with java. One or your options could be a raspberry pi. That is something I want to test.
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!