askmike / bitstamp

Bitstamp REST API wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use buy_limit without limit price

tuloski opened this issue · comments

Hello, I see in the following code:

Bitstamp.prototype.buy = function(market, amount, price, limit_price, callback) {
  this._post(market, 'buy', callback, {
    amount: amount,
    price: price,
    limit_price: limit_price
  });
}

that the buy (and sell) API calls have a limit_price field, which is optional. I'm a little noob on js, but how can I do a buy order without putting the "limit_price" arg?
Can I just do "privateBitstamp.buy('btcusd', amount, price, console.log);"? Will the limit_price not be used in that case?

You can pass undefined, which will strip out the limit_price and not send it at all (that stripping happens here)