Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

buying ETH on GDAX #628

Closed
brian000 opened this issue Mar 16, 2017 · 14 comments
Closed

buying ETH on GDAX #628

brian000 opened this issue Mar 16, 2017 · 14 comments
Labels

Comments

@brian000
Copy link

brian000 commented Mar 16, 2017

I'm running the development branch with default configuration (except GDAX API key) and a couple bucks for testing, however gekko doesn't seem to actually buy any ETH. It logs the attempted buy but eventually says the order wasn't filled, cancels it, and doesn't attempt to buy again. If I view GDAX in a browser, I don't see the order in my fills.

It doesn't seem to have any problems selling, but buying is problematic. I understand why after a minute it doesn't necessarily create a new buy order, as the price has probably changed, but the initial buy just never happens.

 2017-03-15 13:02:32 (INFO):     Attempting to BUY 0.07866869444150902 ETH at GDAX
 *CHOP*
 2017-03-15 13:03:33 (INFO):     BUY order was not (fully) filled, cancelling and creating new order

Anyone else seeing issues like this?

Edit: nodejs v7.7.2, commit 7988cce

@askmike
Copy link
Owner

askmike commented Mar 16, 2017

Strange.. Will have a look asap! After #611 I'll go over all bugs regarding exchange integrations.

@smurfy
Copy link
Contributor

smurfy commented Mar 17, 2017

The problem probably is post_only: true try disabling it.
it probably makes sense to default to false, while adding support i noticed the problem too, if you debug the error message the order has the status "rejected" while mentioning post_only.

@askmike feel free to mention me for gdax related problems so i'm aware of them.

@smurfy
Copy link
Contributor

smurfy commented Mar 17, 2017

Ah just noticed the default (if you remove post_only from the config) it actually defaults to false.
I also mentioned the reject problem at #564
If its NOT post_only what are you using ETH/USD or ETH/BTC (i only tested BTC/USD on sandbox and ETH/BTC on production)

@brian000
Copy link
Author

brian000 commented Mar 22, 2017

I'm using the ETH/USD pair, tried adding post_only: true to my config.trader. (Wasn't in the default config file.) The bot's off and running, I'll chime back in with a trip report once it tries to buy something.

Edit: no good, it did the same thing as my OP, it said it was attempting to buy but it never actually happened.

@boxofdeath
Copy link

I am having the same issue using ETH/BTC. However, it attempts to buy repeatedly.

@smurfy
Copy link
Contributor

smurfy commented Mar 22, 2017

@brian000 @boxofdeath post_only should false. If the problem still occur please tell me.
I will test the trader tonight with sandbox mode.

@brian000
Copy link
Author

brian000 commented Mar 22, 2017

Gave it a crack with post_only: false and it still doesn't buy. It tries, gives up, then keeps trying a couple more times, just like my initial report.

@boxofdeath
Copy link

my post_only is false as well. Still doing the same thing. Has no problem selling.

@smurfy
Copy link
Contributor

smurfy commented Mar 22, 2017

Has no problem selling.

ah! sorry i thought both selling and buying did not work.

@boxofdeath
Copy link

Nope now selling isn't working! I think it might have to do with the amount it is trying to buy or sell. I tried doing the exact trade in GDAX and it told me the amount was too precise. Possibly its a rounding issue?

@brian000
Copy link
Author

@boxofdeath I've seen that issue too, GDAX doesn't seem to like any more than six decimal places.

@developdaly
Copy link

@brian000 is that confirmed (I can't find any GDAX documentation on decimal limits)? If so, should we just modify this?

https://github.com/askmike/gekko/blob/stable/exchanges/gdax.js#L65

From:
amount: parseFloat(account.available);

To:
amount: parseFloat(account.available).toFixed(6);

@nourspace
Copy link
Contributor

I am getting the same error in almost all buying orders. I am on feature/ui-trader branch.

After debugging the response from GDAX, these not (fully) filled orders all have open state. Gekko treats them as failed and cancels them.

BUY order was not (fully) filled, cancelling and creating new order

I tried stopping the bot before it cancels the order and waited for some time. The order appeared on my GDAX account.

ORDER LIFECYCLE

The HTTP Request will respond when an order is either rejected (insufficient funds, invalid parameters, etc) or received (accepted by the matching engine). A 200 response indicates that the order was received and is active. Active orders may execute immediately (depending on price and market conditions) either partially or fully. A partial execution will put the remaining size of the order in the open state. An order that is filled completely, will go into the done state.

https://docs.gdax.com/#place-a-new-order

@nourspace
Copy link
Contributor

After some time running the trader, I started getting such errors. @developdaly it seems this is the case. I'm not sure where is the best place to fix this though.

I have tried changing Trader.prototype.getPortfolio and now running the trader again. I also changed both buy and sell in gdax.js

    var buyParams = {
        'price': price.toFixed(6),
        'size': amount,
        'product_id': this.pair,
        'post_only': this.post_only
    };
2017-07-17 09:29:58 (ERROR):	Error buying at GDAX: price too precise (0.02063999)
2017-07-17 09:30:03 (DEBUG):	Requested LTC/BTC trade data from GDAX ...
2017-07-17 09:30:04 (DEBUG):	Processing 2 new trades. From 2017-07-17 07:30:02 UTC to 2017-07-17 07:30:02 UTC. (a few seconds)
2017-07-17 09:30:04 (DEBUG):	calculated DEMA properties for candle:
2017-07-17 09:30:04 (DEBUG):		 long ema: 0.02069643
2017-07-17 09:30:04 (DEBUG):		 short ema: 0.02066635
2017-07-17 09:30:04 (DEBUG):		 diff: -0.14541
2017-07-17 09:30:04 (DEBUG):		 DEMA age: 561 candles
2017-07-17 09:30:04 (DEBUG):	we are currently in a downtrend @ 0.02063000 (-0.14541)
2017-07-17 09:30:06 (ERROR):	Error buying at GDAX: price too precise (0.02072999)
2017-07-17 09:30:06 (DEBUG):	GDAX returned an error, retrying..
2017-07-17 09:30:08 (DEBUG):	GDAX returned an error, retrying..
2017-07-17 09:30:08 (ERROR):	Error buying at GDAX: price too precise (0.02063999)
2017-07-17 09:30:16 (DEBUG):	GDAX returned an error, retrying..
2017-07-17 09:30:16 (ERROR):	Error buying at GDAX: price too precise (0.02072999)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants