Rejected Sell Trades Can Lose 10% Of Your Portfolio... Or More
Cool that you saw that about the portfolio issue. You're right. I didn't wait long enough for warm up to complete. I will give it a try. 

On a separate note, these silent rejection errors are definitely a pain. But even the ones that are not silent where it outputs a message to the console doesn't help unless you check the message. This block of code from trader.js starting at line 154 is a good example:

 if(this.order) {
   if(this.order.side === direction) {
     return'ignoring advice: already in the process to', direction);

   if(this.cancellingOrder) {
     return'ignoring advice: already cancelling previous', this.order.side, 'order');
   }'Received advice to', direction, 'however Gekko is already in the process to', this.order.side);'Canceling', this.order.side, 'order first');
   return this.cancelOrder(id, advice, () => this.processAdvice(advice));

I have gotten errors where direction is undefined or side is undefined and the trade is ignored. These variables stay undefined so subsequent sell trades are also ignored.
Quote:2019-01-17 17:41:33 (INFO): advice = short
2019-01-17 17:41:33 (INFO): ignoring advice: already cancelling previous undefined order
2019-01-17 17:41:53 (DEBUG): Requested ETH/USD trade data from GDAX ...
2019-01-17 17:41:53 (DEBUG): Processing 3 new trades. From 2019-01-17 17:41:50 UTC to 2019-01-17 17:41:50 UTC. (a few seconds)

I'm probably going to change these to throw {} and have PM2 restart Gekko. At least that will reset these undefined variables.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.

I made a video about this issue.

Ultimately, if you experienced a failed trade issue, it is your top priority to get it resolved.

In addition, during bear markets, you should have your strategy issue a sell call first when it starts. The reasoning is there are many other issues and errors, some even from the exchange you use, that will crash Gekko. When paired with PM2 to autorestart Gekko, this will immediately get rid of a potential bag if Gekko happen to crash when the trend turns against you (which is more likely to happen in bear trend) but before your strategy issues a sell signal. Just make sure to reverse this (or at least turn it off) when we finally get out of the bear market in 6 - 12 months.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.

I wrote up a much cleaner fix and made a pull request.

In the tests I ran, Gekko pretty much instantaneously recreate rejected trades, much faster than my old method of having the strategy re-issue a buy/sell order.

If you have Coinbase Pro and know how to access the sandbox, you should definitely test this code. It won't cost you any money and Coinbase Pro gives you $200,000+ fake money to play with in the sandbox. It's harder to run into this issue in the sandbox as the price barely moves compares to the real exchange, but I did come across it once and it worked!
If it isn't crypto, it isn't worth mining, it isn't worth speculating.

Forum Jump:

Users browsing this thread: