From b380c77162794a7ca47a16fbbf7dec732baab4a8 Mon Sep 17 00:00:00 2001 From: Ike-Clinton Date: Sun, 17 Sep 2017 10:49:59 -0400 Subject: [PATCH] FIX bot only buying. FIX status message always saying sell --- tutorials/t005_alertTrader.js | 4 ++-- tutorials/t005_alertTrader.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/t005_alertTrader.js b/tutorials/t005_alertTrader.js index 952fbc45..132a484d 100644 --- a/tutorials/t005_alertTrader.js +++ b/tutorials/t005_alertTrader.js @@ -46,7 +46,7 @@ GTT.Factories.GDAX.getSubscribedFeeds(options, [product]).then(function (feed) { GTT.Core.createPriceTrigger(feed, product, currentPrice.plus(spread)) .setAction(function (event) { pushMessage('Price Trigger', base + " price has risen and is now " + event.price + " " + quote + " on " + product + " on GDAX"); - submitTrade('buy', '0.01'); + submitTrade('sell', '0.01'); }); }); GTT.Core.createTickerTrigger(feed, product, false) @@ -64,7 +64,7 @@ function submitTrade(side, amount) { size: amount }; gdaxAPI.placeOrder(order).then(function (result) { - pushMessage('Order executed', "Order to sell 0.1 " + base + " placed. Result: " + result.status); + pushMessage('Order executed', "Order to" + order.side + " 0.1 " + base + " placed. Result: " + result.status); }); } function pushMessage(title, msg) { diff --git a/tutorials/t005_alertTrader.ts b/tutorials/t005_alertTrader.ts index a4d10024..365aac5d 100644 --- a/tutorials/t005_alertTrader.ts +++ b/tutorials/t005_alertTrader.ts @@ -51,7 +51,7 @@ GTT.Factories.GDAX.getSubscribedFeeds(options, [product]).then((feed: GDAXFeed) GTT.Core.createPriceTrigger(feed, product, currentPrice.plus(spread)) .setAction((event: TickerMessage) => { pushMessage('Price Trigger', `${base} price has risen and is now ${event.price} ${quote} on ${product} on GDAX`); - submitTrade('buy', '0.01'); + submitTrade('sell', '0.01'); }); }); GTT.Core.createTickerTrigger(feed, product, false) @@ -70,7 +70,7 @@ function submitTrade(side: string, amount: string) { size: amount }; gdaxAPI.placeOrder(order).then((result: LiveOrder) => { - pushMessage('Order executed', `Order to sell 0.1 ${base} placed. Result: ${result.status}`); + pushMessage('Order executed', `Order to ${order.side} 0.1 ${base} placed. Result: ${result.status}`); }); }