Skip to content

Instantly share code, notes, and snippets.

@GuntharDeNiro
Last active April 23, 2021 13:06
Show Gist options
  • Save GuntharDeNiro/c942fc5d466351806537b1ec92c2684f to your computer and use it in GitHub Desktop.
Save GuntharDeNiro/c942fc5d466351806537b1ec92c2684f to your computer and use it in GitHub Desktop.
const closePosition = function(amount,exchange,pair) {
let price = memory.ledger[exchange][pair].Bid;
return memory.exchanges[exchange]
.cancelOrderSTOP(0, pair, 'Close', amount, price, price, price, (data) => {
console.log(data)
}) .catch((e) => {
if (e.message == 'Exchange_Timeout') {
console.log(exchange, 'timeout');
} else {
console.log('\r\n', e);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment