Skip to content

Commit

Permalink
FIX bot only buying. FIX status message always saying sell
Browse files Browse the repository at this point in the history
  • Loading branch information
Ike-Clinton committed Sep 17, 2017
1 parent f90b095 commit b380c77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tutorials/t005_alertTrader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions tutorials/t005_alertTrader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}`);
});
}

Expand Down

0 comments on commit b380c77

Please sign in to comment.