askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.07k stars 3.94k forks source link

[CCI] Bot not trading with GDAX #636

Closed albertolive closed 6 years ago

albertolive commented 7 years ago

Hi,

I'm using CCI method since Thursday and it hasn't trade it. When it is suppose to trade? How can I debug what's happening?

Thanks!

askmike commented 7 years ago

The first question is: did Gekko advice to make a trade? You can see this in your logs (advice is to xx).

albertolive commented 7 years ago

Hi,

Thanks for your response. My normal log is that:

2017-03-20T11:16:24.681299+00:00 app[worker.1]: 2017-03-20 11:16:24 (DEBUG):    Insufficient data available. Age:  63  of  90
2017-03-20T11:16:24.681378+00:00 app[worker.1]: 2017-03-20 11:16:24 (DEBUG):    ind:  false   63   90
2017-03-20T11:16:24.681552+00:00 app[worker.1]: 2017-03-20 11:16:24 (DEBUG):    Trend:  undefined  for  0
2017-03-20T11:16:24.683346+00:00 app[worker.1]: 2017-03-20 11:16:24 (INFO): (PROFIT REPORT) original simulated balance:  1070.22000 EUR
2017-03-20T11:16:24.683413+00:00 app[worker.1]: 2017-03-20 11:16:24 (INFO): (PROFIT REPORT) current simulated balance:   1070.10000 EUR
2017-03-20T11:16:24.683516+00:00 app[worker.1]: 2017-03-20 11:16:24 (INFO): (PROFIT REPORT) simulated profit:        -0.12000 EUR (-0.01121%)
2017-03-20T11:16:44.613191+00:00 app[worker.1]: 2017-03-20 11:16:44 (DEBUG):    Requested / trade data from GDAX ...
2017-03-20T11:16:44.678104+00:00 app[worker.1]: 2017-03-20 11:16:44 (DEBUG):    No new trades.
2017-03-20T11:17:04.631739+00:00 app[worker.1]: 2017-03-20 11:17:04 (DEBUG):    Requested / trade data from GDAX ...
2017-03-20T11:17:04.691039+00:00 app[worker.1]: 2017-03-20 11:17:04 (DEBUG):    No new trades.
2017-03-20T11:17:24.652296+00:00 app[worker.1]: 2017-03-20 11:17:24 (DEBUG):    Requested / trade data from GDAX ...
2017-03-20T11:17:24.701097+00:00 app[worker.1]: 2017-03-20 11:17:24 (DEBUG):    No new trades.
2017-03-20T11:17:44.672520+00:00 app[worker.1]: 2017-03-20 11:17:44 (DEBUG):    Requested / trade data from GDAX ...
2017-03-20T11:17:44.756110+00:00 app[worker.1]: 2017-03-20 11:17:44 (DEBUG):    Processing 1 new trades. From 2017-03-20 11:17:32 UTC to 2017-03-20 11:17:32 UTC.

But never I had anything related with advice

askmike commented 7 years ago

If you don't see any logs about advice it's not a problem with GDAX but with the strategy (Gekko never even tries to buy/sell) - assuming Gekko is properly able to watch the markets.

Can you post what market you were watching on GDAX? I will try to debug asap.

albertolive commented 7 years ago

Yes, I'm watching EUR-BTC. Thanks

justsux commented 7 years ago

Hey, guys!

I'm having a similar issue using CCI on Poloniex.

settings: ` config.watch = { exchange: 'Poloniex', currency: 'USDT', asset: 'ETH' }

config.tradingAdvisor = { enabled: true, method: 'CCI',
candleSize: 35,
historySize: 90,
adapter: 'sqlite', talib: { enabled: false, version: '1.0.2' } }

config.CCI = { constant: 0.015, history: 90, thresholds: { up: 150, down: -30, persistence: 0 } };

config.trader = { enabled: true, key: 'X', secret: 'X', username: '' }

`

Everything else pretty much set to default. Strategy found here and backtesting indicates around +70% for 3 months. "I understand..." set to true.

Issue: After two days of running - gekko made zero trades and I think it should be more "alive" using CCI? In fact here is a screenshot and I guess adviser says to buy but trader doesn't do so? screenshot_1466

What bothers me a bit is that CCI shows -1.34. Is that a kind of a profit indicator that shows that it's "no deal" considering the fee? Even though it simulates the profit no actual action made.

Oh, yeah, when gekko starts it shows my balance from Poloniex so I think that the API keys are all good.

Also, I haven't noticed any log files been generated.

Any ideas what could be the issue? Thanks!

askmike commented 7 years ago

Hey @justsux, this issue is just for people having problems with the GDAX exchange.

To answer your questions quickly:

What bothers me a bit is that CCI shows -1.34. Is that a kind of a profit indicator that shows that it's "no deal" considering the fee? Even though it simulates the profit no actual action made.

That number is the CCI that was calculated. Based on that number the CCI strategy determined to advice to do something or not (unrelated to funds or profits).

Oh, yeah, when gekko starts it shows my balance from Poloniex so I think that the API keys are all good.

Great, it looks like your trader is set up correctly.

Also, I haven't noticed any log files been generated.

Gekko logs everything to the console, so there are no other log files.

Any ideas what could be the issue?

Could you create a new issue so I can investigate? And in that issue please post a screenshot of gekko where it said to buy (or sell)?

justsux commented 7 years ago

Hey, @askmike !

Gekko logs everything to the console, so there are no other log files.

Oh, I see. I was thinking that it was the case but it looked a bit inefficient though; every time I reconnect to my screen, there is pretty much no way(?) to scroll through the log. So I thought maybe there is some debug.log that will omit all the common data and log only something beneficial.

I'll gather as many screenshots related to the case tomorrow and will create a new case. Thanks a lot for looking into the issue!

fxjkhr commented 7 years ago

I'm also having issues with the gdax plugin. gekko somehow fails to send orders sometimes, as I've seen successful trades but more often than I see something like this:

2017-06-08 17:07:18 (INFO):     Trader Received advice to go long. Buying  BTC

2017-06-08 17:07:18 (INFO):     We have new trading advice!
2017-06-08 17:07:18 (INFO):              Position: long
2017-06-08 17:07:18 (INFO):              Market price: 2799.97
2017-06-08 17:07:18 (INFO):              Based on market time: 2017-06-09 00:06:00

2017-06-08 17:07:18 (INFO):     Attempting to BUY 1.7846676034490017 BTC at GDAX
2017-06-08 17:07:19 (INFO):     Pushbullet Message Sent
2017-06-08 17:08:18 (INFO):     BUY order was not (fully) filled, cancelling and creating new order
2017-06-08 17:08:19 (INFO):     Attempting to BUY 1.7846676034490017 BTC at GDAX
2017-06-08 17:09:19 (INFO):     BUY order was not (fully) filled, cancelling and creating new order
2017-06-08 17:09:20 (INFO):     Attempting to BUY 1.7846676034490017 BTC at GDAX
2017-06-08 17:10:21 (INFO):     BUY order was not (fully) filled, cancelling and creating new order
2017-06-08 17:10:21 (INFO):     Attempting to BUY 1.7851585290577154 BTC at GDAX
2017-06-08 17:11:22 (INFO):     BUY order was not (fully) filled, cancelling and creating new order
2017-06-08 17:11:23 (INFO):     Attempting to BUY 1.7851967943443379 BTC at GDAX

Successful order submissions appear on gdax.com's open orders table, but these BUY orders don't appear. If I used the size 1.7851967943443379 directly in the exchange, I get the error-alert "size too precise".

I've tried what developdaly mentioned https://github.com/askmike/gekko/issues/628#issuecomment-304520603 but the problem still persists. I know portfolioManager.js does its own magic on it too so I'm not sure if that touches on the issue.

greenbigfrog commented 6 years ago

I think there's nothing important here anymore and this can be closed @askmike

askmike commented 6 years ago

I'm also quite sure this has been fixed in recent releases! If not please reopen.