Skip to content

Commit

Permalink
Fixed okcoin create market buy order.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritoanst committed Aug 21, 2017
1 parent 8f3c69f commit 4aee45a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ ccxt.wiki/
package-lock.json
exchanges.json
ccxt.sublime-workspace
.idea
yarn.lock
12 changes: 9 additions & 3 deletions ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -11827,12 +11827,18 @@ var okcoin = {
let order = {
'symbol': this.marketId (market),
'type': side,
'amount': amount,
};
if (type == 'limit')
if (type == 'limit') {
order['price'] = price;
else
order['amount'] = amount;
} else {
if (order.type == 'buy') {
order['price'] = params;
} else {
order['amount'] = amount;
}
order['type'] += '_market';
}
let response = await this.privatePostTrade (this.extend (order, params));
return {
'info': response,
Expand Down

0 comments on commit 4aee45a

Please sign in to comment.