Skip to content

Commit

Permalink
bittrex ceiling order type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 19, 2021
1 parent 3c7dcc7 commit b09f8ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/bittrex.js
Expand Up @@ -759,7 +759,16 @@ module.exports = class bittrex extends Exchange {
const isCeilingMarket = (uppercaseType === 'CEILING_MARKET');
const isCeilingOrder = isCeilingLimit || isCeilingMarket;
if (isCeilingOrder) {
request['ceiling'] = this.priceToPrecision (symbol, price);
let cost = this.safeFloat2 (params, 'ceiling', 'cost');
params = this.omit (params, [ 'ceiling', 'cost' ]);
if (cost === undefined) {
if (price === undefined) {
cost = amount;
} else {
cost = amount * price;
}
}
request['ceiling'] = this.costToPrecision (symbol, cost);
// bittrex only accepts IMMEDIATE_OR_CANCEL or FILL_OR_KILL for ceiling orders
request['timeInForce'] = 'IMMEDIATE_OR_CANCEL';
} else {
Expand Down

0 comments on commit b09f8ab

Please sign in to comment.