askmike / gekko

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

Trading question #609

Closed Jorman closed 7 years ago

Jorman commented 7 years ago

Hi, I'm using gekko with poloniex and DOGE, CCI indicator with candlesize 1min and historysize 100. I'm not so good on trading, but the backtest for last months is ok. So now the price of doge is 16 or 17 satoshi, not a big deal I know 😃

Btw, this is the result with some hours of gekko:

2017-03-05 08:59:56 (DEBUG):    calculated CCI properties for candle:
2017-03-05 08:59:56 (DEBUG):             Price:                  1.7e-7
2017-03-05 08:59:56 (DEBUG):             CCI tp:         0.00000016
2017-03-05 08:59:56 (DEBUG):             CCI tp/n:       0.00000017
2017-03-05 08:59:56 (DEBUG):             CCI md:         0.00000001
2017-03-05 08:59:56 (DEBUG):             CCI:    -100.33
2017-03-05 08:59:56 (DEBUG):    Trend:  oversold  for  1
2017-03-05 08:59:56 (INFO):     Trader Received advice to go long. Buying  DOGE

2017-03-05 08:59:56 (INFO):     We have new trading advice!
2017-03-05 08:59:56 (INFO):              Position: long
2017-03-05 08:59:56 (INFO):              Market price: 1.6e-7
2017-03-05 08:59:56 (INFO):              Based on market time: 2017-03-05 07:58:00

2017-03-05 08:59:56 (INFO):     (PROFIT REPORT) original simulated balance:      100.00000 BTC
2017-03-05 08:59:56 (INFO):     (PROFIT REPORT) current simulated balance:       99.10270 BTC
2017-03-05 08:59:56 (INFO):     (PROFIT REPORT) simulated profit:                -0.89730 BTC (-0.89730%)
{"status":1,"request":"facd5364fab0bf99751f8ba7fdea5977"}
2017-03-05 08:59:57 (INFO):     Attempting to BUY 15575.058823529413 DOGE at Poloniex
2017-03-05 09:00:16 (DEBUG):    Requested / trade data from Poloniex ...
2017-03-05 09:00:17 (DEBUG):    Processing 1 new trades. From 2017-03-05 07:59:57 UTC to 2017-03-05 07:59:57 UTC. (a few seconds)
2017-03-05 09:00:36 (DEBUG):    Requested / trade data from Poloniex ...
2017-03-05 09:00:37 (DEBUG):    Processing 1 new trades. From 2017-03-05 08:00:21 UTC to 2017-03-05 08:00:21 UTC. (a few seconds)
2017-03-05 09:00:37 (DEBUG):    calculated CCI properties for candle:
2017-03-05 09:00:37 (DEBUG):             Price:                  1.6e-7
2017-03-05 09:00:37 (DEBUG):             CCI tp:         0.00000017
2017-03-05 09:00:37 (DEBUG):             CCI tp/n:       0.00000017
2017-03-05 09:00:37 (DEBUG):             CCI md:         0.00000000
2017-03-05 09:00:37 (DEBUG):             CCI:    -12.33
2017-03-05 09:00:37 (DEBUG):    Trend:  nodirection  for  0
2017-03-05 09:00:37 (INFO):     (PROFIT REPORT) original simulated balance:      100.00000 BTC
2017-03-05 09:00:37 (INFO):     (PROFIT REPORT) current simulated balance:       105.29662 BTC
2017-03-05 09:00:37 (INFO):     (PROFIT REPORT) simulated profit:                5.29662 BTC (5.29662%)
2017-03-05 09:00:56 (DEBUG):    Requested / trade data from Poloniex ...
2017-03-05 09:00:56 (DEBUG):    Processing 1 new trades. From 2017-03-05 08:00:41 UTC to 2017-03-05 08:00:41 UTC. (a few seconds)
2017-03-05 09:00:59 (INFO):     BUY was successfull

And this is what happen on poloniex:

DOGE/BTC    Buy Exchange    0.00000017  15575.05882352  38.93764706 DOGE (0.25%)    0.00264775 BTC  2017-03-05 07:59:57
DOGE/BTC    Sell    Exchange    0.00000016  16589.89191176  0.00000664 BTC (0.25%)  0.00264774 BTC  2017-03-05 01:02:36
DOGE/BTC    Buy Exchange    0.00000017  16631.47058823  41.57867647 DOGE (0.25%)    0.00282734 BTC  2017-03-04 22:12:16

As you can see, buy at 16 and sell at 17 😱 not good!!!

Any idea of why? Maybe is my fault?

askmike commented 7 years ago

The idea is that Gekko tries to predict trends (price is going up, or price is going down). You are using the CCI method, which Gekko will use to identify these trends. Gekko will always buy/sell based on the advice, regardless if it is making profit or not.

If you are not understanding why your method is not working for you I'll propose to do a few things:

askmike commented 7 years ago

Feel free to keep the conversation going, but I'm closing this as I don't see this as an issue with Gekko.

Jorman commented 7 years ago

Tnx for you support askmike! Like I said maybe is my problem, I'm pretty new on all this

I used the ui interface to collect 3 months of data from poloniex on btc/doge, so I do a backtest, always on ui interface, with the same value, candle size 1 and history 100 and believe or not, the backtest was good! You can try if you want, here you can see the test of 4 days https://s15.postimg.org/sr7cafy7f/backtest.png

Now I'll read the CCI documentations, but that I don't get is: Why the backtest say good profit and when I ran the real trade gekko to trade as opposed. You see buy at 17 and sell at 16. Now I read and I try without do real trade, but for me now this remain strange.

Do you have any idea?