Author

Topic: learning mtgox API (Read 1518 times)

newbie
Activity: 2
Merit: 0
May 30, 2013, 04:58:35 PM
#18
hi everyone. sorry for poor english. i'm trying to move to 1st API vers. our clien(Java). when i'm trying to submint an order with params
type - bid
amount_int - 10000000
price_int - 2500000000
server returns "" string
how i can see magicnumber thats server uses to divide by amount and price is 10^6 (i tryed 10^4 too - in result was "too low amount")
can u help?
newbie
Activity: 4
Merit: 0
May 09, 2013, 06:35:44 AM
#17
Geeze, whats the point of having a "newbie" forum...  There is a lot of documentation to go through and it takes those of us with smaller programming vocabularies a lot to get through it all. I solved my problem, so for anyone else having the same issue I read the "FM"...

here is some good background on the request module and has a specific section on passing parameter in a url with a keyword argument.  You then need to urlencode your parameters.
 
http://docs.python-requests.org/en/latest/index.html

legendary
Activity: 1050
Merit: 1000
You are WRONG!
May 07, 2013, 12:04:31 PM
#16
I am also having a problem trying to pass my parameters as such

https://mtgox.com/api/1/BTCUSD/private/order/add?type=ask&amount_int=100000000&price_int=2500000

I am using python, does anyone know what the solution here is?

Thanks
yup! RTFM!
newbie
Activity: 14
Merit: 0
May 06, 2013, 10:56:28 PM
#15
I have a question, is there anyway to have a bot send out a notification when the EMA lines cross? I'm sure you guys are initiating buys and sells via EMA (maybe not) but if you are, could you just have it send a notification without trading at all? I know you spend a lot of time and effort in your code but if someone has this functionality, I would greatly appreciate it. You can even delete all the rest of the code, I would just want to be notified when the EMA lines cross. Thanks.
+1
newbie
Activity: 40
Merit: 0
May 06, 2013, 10:04:28 PM
#14
I have a question, is there anyway to have a bot send out a notification when the EMA lines cross? I'm sure you guys are initiating buys and sells via EMA (maybe not) but if you are, could you just have it send a notification without trading at all? I know you spend a lot of time and effort in your code but if someone has this functionality, I would greatly appreciate it. You can even delete all the rest of the code, I would just want to be notified when the EMA lines cross. Thanks.
newbie
Activity: 4
Merit: 0
May 06, 2013, 09:08:00 PM
#13
I am also having a problem trying to pass my parameters as such

https://mtgox.com/api/1/BTCUSD/private/order/add?type=ask&amount_int=100000000&price_int=2500000

I am using python, does anyone know what the solution here is?

Thanks
full member
Activity: 146
Merit: 100
In da Jungle!
March 30, 2013, 12:21:27 PM
#12
Is there a really simple "excel" - style api handling program, or is it all raw C or Python or what is everybody doing to do this?

Where do I get started with an easy API programing BOT creation tool?
full member
Activity: 148
Merit: 100
March 28, 2013, 04:38:15 PM
#11
Shoot me a PM and I will send you some of my code that I use.  I am at work right now and therefore do not have access to my code.

I currently have 14 bots running that trade bitcoin based on different parameters.  So I do have quite a bit of experience with this.

I would be happy to walk you through it.
newbie
Activity: 2
Merit: 0
March 28, 2013, 02:13:35 AM
#10
legendary
Activity: 1050
Merit: 1000
You are WRONG!
newbie
Activity: 29
Merit: 0
March 27, 2013, 06:39:05 AM
#8
Hi,

I'm trying to extract the amount of cash I have in my wallet and put it into a variable.

I'm using :
Code:
var_export(mtgox_query('1/generic/private/info'), true);

Which captures information, but I can't for the life of me work out how to separate the resulting arrays into variables. Can anyone help?

i.e. I want:
Code:
array (
  'result' => 'success',
  'return' =>
  array (
'USD' =>
     array (
        'Balance' =>
        array (
          'value' => '0.00',
        ),

to become:
Code:
$wallet_cash_balance = 'Balance'

Can anyone educate me???

The main problem that i'm having is that there are multiple arrays embedded, and so I can't find any useful php code examples online.
newbie
Activity: 2
Merit: 0
March 03, 2013, 02:43:34 PM
#7
I'm using java. What does the actual final url look like?
full member
Activity: 120
Merit: 100
March 03, 2013, 07:31:38 AM
#6
OK i figured out how to do it, someone should update the wiki


that's, funny. I'm having the exact same problem right now. let me know if you get anywhere with it.


I'm using php so a market order for .v1 would be the same as the example shown here (https://en.bitcoin.it/wiki/MtGox/API/HTTP) except instead of:

var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));

it would be something like

var_dump(mtgox_query('1/BTCUSD/private/order/add', array('type' => 'bid', 'amount_int' => 100000000, "price_int" => 1500000) ) );
legendary
Activity: 1050
Merit: 1000
You are WRONG!
newbie
Activity: 2
Merit: 0
March 03, 2013, 06:34:39 AM
#4
that's, funny. I'm having the exact same problem right now. let me know if you get anywhere with it.
full member
Activity: 120
Merit: 100
March 03, 2013, 06:24:10 AM
#3
OK thanks. I figured i'd have some of the syntax wrong.

It's frustrating that there's so little information available, and the wiki gives details but no examples of how to pass multiple variables. I can learn but i need examples!  Grin

I'm still getting the error, maybe i will post to dev forum, i thought it was too basic tbh.
legendary
Activity: 2087
Merit: 1015
March 03, 2013, 01:13:35 AM
#2
I don't personally have much experience with the mtgox api however I do see that your url's are wrong. Rather than ?'s between parameters you must use an &

As such:

https://mtgox.com/api/1/BTCUSD/private/order/add?type=ask&amount_int=100000000&price_int=2500000
full member
Activity: 120
Merit: 100
March 02, 2013, 08:35:02 PM
#1
Hi i am trying to learn how to use the mtgox api but am struggling with some things.

I have managed to make some basic api calls, but am unsure how to pass parameters when it is necessary.


for example to submit an order the wiki says:

###
Submit an order

https://mtgox.com/api/1/BTCUSD/private/order/add

parameters:

    type (bid|ask) (easier to remember: bid == buy, ask == sell)
    amount_int
    price_int (can be omitted to place market order)

submits an order and returns the OID and info about success or error
###


I tried:

https://mtgox.com/api/1/BTCUSD/private/order/add?type=ask?amount_int=100000000?price_int=2500000

But im just getting error:

"Invalid parameter "type" (should be ask or bid)"


(Also in INT is 100000000 = 1BTC?)
Jump to: