Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 20,731
» Latest member: bellabardot
» Forum threads: 1,541
» Forum posts: 7,732

Full Statistics

Online Users
There are currently 327 online users.
» 1 Member(s) | 326 Guest(s)
bellabardot

Latest Threads
New Gekko UI in the works
Forum: Announcements
Last Post: dejaoffice
Yesterday, 10:44 AM
» Replies: 137
» Views: 156,395
Gekko development status ...
Forum: Announcements
Last Post: zerzamilmu
04-20-2024, 11:39 AM
» Replies: 806
» Views: 536,228
An official Gekko service...
Forum: Announcements
Last Post: CaroleDennis
04-20-2024, 04:03 AM
» Replies: 85
» Views: 140,380
Gekko with malware spotte...
Forum: Announcements
Last Post: alisonagron
04-18-2024, 08:05 AM
» Replies: 130
» Views: 92,042
Gekko 0.6 released
Forum: Announcements
Last Post: sabinaholt
03-27-2024, 12:10 PM
» Replies: 104
» Views: 216,014
How to Soft Reset or Hard...
Forum: General Discussion
Last Post: lucifar
10-07-2021, 07:18 PM
» Replies: 22
» Views: 39,433
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 81,848
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 15,183
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 34,621
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 45,747

 
  Gekko only sell
Posted by: c00l - 12-11-2018, 07:51 PM - Forum: Technical Support - No Replies

Hi all,

using tradebot in a market BTC-USDT on Binance, Gekko worked well if I have BTC funds and 0 USDT (it starts to sell, than buy, etc.)
If I start with 100 USDT (for example) and 0 BTC it should buy BTC as first step but it won't buy anything.
Do Gekko only works if it starts with BTC funds? (So i should manually buy BTC and then start gekko??)

Thank you

Edit: I should to wait due to stategy... sorry!



Attached Files
.txt   gekkolog.txt (Size: 13.63 KB / Downloads: 5)

  [Question] Why does gekko synthesize candle from trades by itself.
Posted by: hitripley - 12-10-2018, 12:17 PM - Forum: General Discussion - Replies (16)

Instead of using APIs like fetch_ohlcv from exchange interfaces?

Synthesized candle works fine in realtime trader, speed is OK there, but it becomes an issue when backtesting with imported history data. I tried to import half a year's data from bitfinex and it took a whole night to complete. I guess it'll be slower if the rate limit is low for an exchange.

Could anyone explain what advantage it has to use synthesized candle from trades?


  TALIB RSI Required parameters
Posted by: batssmasher - 12-09-2018, 10:09 PM - Forum: Technical Support - Replies (1)

I am building new start using some talib indicators . but i couldn't find the complete parameters for RSI .

I want to use upper band at 80 and lower band at 20 with 5 length. but what i found in talib parameters is only optInTimePeriod

i tried adding 2  optInTimePeriod but it didn't work . also how can i add different length. how can i calculate rsi values using upper and lower band with my length ?


  It is normal for both synchronization time?
Posted by: mrpaiva - 12-09-2018, 06:03 PM - Forum: General Discussion - No Replies

I noticed that the bot gets a lot of time on syncing private data. It's normal?

Today the bot runs in docker with mongodb database.



Attached Files
.png   print-log.png (Size: 25.72 KB / Downloads: 1)

  Is there a way to disable sticky orders?
Posted by: vtms - 12-07-2018, 05:48 PM - Forum: Technical Discussion - Replies (7)

They ruin my strategy. Is there a way to just place normal limit orders at the exact price the strategy calls for without trying to be on top of order book and cancel when limit orders don’t fill? In fact, is there a way to issue your own limit orders at specified price as opposed to just waiting for candle to close?


  Gekko Dollar Cost Averaging Bot
Posted by: crypto49er - 11-30-2018, 10:22 PM - Forum: Third Party Software - Replies (7)

All,

I forked Gekko and modded it from a trading bot into a dollar cost averaging bot. 

https://github.com/crypto49er/gekko-DCA

I also made a video about it if you want to know which files I had to modify. Honestly, it was 3 files (including the config file) and adding a DCA strategy. But if you want to explore modifying your strategies with the ideas I describe below, it's worth a watch.

https://youtu.be/h2MEVp9lBqQ

I know dollar cost average might not be something that's interesting to members of this forum. But you can expand upon this in multiple ways (you still need to use Gekko to do the following, not Gekko-DCA):
-Set a limit on how much your bot trades (ex: you have $200 but only want the bot to trade $100)
-Layer your buys and sells (ex: Use 50% of your portfolio to buy at price A, and 50% to buy at price B, Sell 25% when the price hits your 1st target, sell the remaining 75% when it hits your 2nd target)
-Run multiple bots using one exchange API keys by locking each bot to a specific amount (add code in your strat to adjust the amount based on profit/losses so the bot always have a full balance to work with)

Those are just some of the ideas that I can think of off the top of my head, I'm sure there are plenty others. Love to hear what you guys think.


  gekko doesn't trade the whole amount
Posted by: crypt0r - 11-29-2018, 10:50 PM - Forum: Technical Support - Replies (8)

hi,

everything works fine for me so far  Big Grin

but i have just a question because my gekko doesnt use the whole amount of currency or asset.

for example i have 1000usd and gekko buys xrp but not for the whole 1000usd, so there is always 35-40usd rest.
or when selling back from xrp to usd gekko doesn't sell all xrp, so like about 90 xrp will stay.

is this maybe misconfiguration by me or it is like some security margin so gekko can be sure the amount is big enough so the order will not be canceled or something?  Huh

thanks


  The right way to use native trailing stop loss
Posted by: douglascrp - 11-28-2018, 03:50 PM - Forum: Technical Support - No Replies

Hello guys.

I am trying to adapt the native traling stop loss into some open source neural net based strategies, but the same problem described at https://steemit.com/gekko/@crypto49er/ge...esn-t-work happens. I mean, when the stop loss is triggered, the conditions to buy are satisfied, and the strategy advice to buy again.

In order to avoid that, I am trying to figure out how to put an extra condition, using timeout or any other kind of logic, in order to avoid the strategy to buy again.

The problem is that I am not able to find how to register my code to be notified when the trigger loss got triggered.

Can someone please provide me some sample code for this?

The strategy I am trying to adapt right now is this one https://github.com/zschro/gekko-neuralnet

Currently, my go long advice is defined as follows:




      if ('buy' !== this.prevAction && signal === false  && meanAlpha > this.settings.threshold_buy )
      {

        log.debug("");
        log.debug("**** Buy - Predicted variation: ",meanAlpha);
        if (!this.settings.stoploss_enabled) {
          return this.advice('long');
        } else {
          return this.advice({
            direction: 'long',
            trigger: {
              type: 'trailingStop',
              trailPercentage: this.settings.stoploss_trailPercentage
            }
          });
        }
      }

Thank you


  Playlist of all my Gekko Trading Bot videos
Posted by: crypto49er - 11-27-2018, 11:37 PM - Forum: Guides - Replies (3)

I have been creating videos on the Gekko Trading Bot since the beginning of this year. I covered everything from installing it on Windows, Mac, Linux, Docker, and backtesting, running various plugins like Telegram and Twitter. I'm sure some of you have watched some of my videos. I figured I probably should have a playlist of all the videos here so you can reference them at your leisure. 

https://www.youtube.com/playlist?list=PL...lPyy9Qa3aY

In addition, I get asked what Gekko topics I should cover next. I don't always respond to PMs (sorry, my inbox is inundated) so it might be better to leave a comment here and I will let you know if that is something that I will cover in a future video.


  [Share] RSI-BB-ADX with candlebatcher
Posted by: Gryphon - 11-27-2018, 09:37 AM - Forum: Strategy Development - Replies (30)

This is more a share of the method I'm using for candle batching than of the strategy, but as Tommies RSI strat is rather excellent and so widely known it seemed a good demonstrator.

This strategy runs on 1 minute candles and batches them in the update function. 
The less obvious bit is that instead of keeping one copy of each indicator, it keeps an array of each indicator as long as the candle size for that indicator. Each new minute candle, the next indicator in the array is updated and read. 
The upshot of this is that each minute there is an up to date result of the longer term indicator, allowing far more accurate entry and exit points checked every minute, instead of every 5, 10, 30, 60 etc minutes. This also makes a strategy less sensitive to start time - although it still makes more of a difference than I'd expect!

The timeframe for each indicator is also independent so different candle sizes can be used for bear and bull market indicators - however the indicator candle size and indicator period do become a little interchangeable as they're both changing the amount of time that the indicator is watching the market over.

Other benefits of running at 1 minute is that any stop losses or take profits that you might add can be checked that much more frequently, so are that much more useful at catching quick market movements.

Downsides:
> As with any strategy running on very short timeframes trying to tune it with GA style optimisers can results in huge profits with hundreds of trades per day that will perform absolutely miserably if ran live as the orders simply can't be filled. Tuning requires a little more understanding of what the strategy is doing and inputting sensible parameters.
> Gekko currently has a limitation on the number of candles it can pre-seed a strategy with of around 4000. When running at 1 minute, this is 2.7 days of history so you need to shrink those long SMAs


So - here's a quick example backtest from 6 months history on an alt, with Tommie's original strategy first, candlebatched second. Both have exactly the same parameters, as in the TOML file below.

Original:
[Image: DJkIwSX.png]

Candlebatched:
[Image: fBuUMVB.png]
Paper trading settings are at their defaults. These two are purely intended as a relative comparison. I obviously can't promise any results but hope it shows that there is potential!


I'm sharing this under the same CC-BY-SA 4.0 license that Tommie shared his under - I learnt a lot from that bit of code, so hopefully giving a little back.
Run the strategy in 1 minute candles in gekko and specify the candle sizes you want each indicator to run at with the timeframe parameter in the TOML.

TOML: Github

Code:
# SMA INDICATOR
SMA_long = 1000
SMA_short = 50
SMA_Timeframe = 10

# RSI BULL / BEAR
BULL_RSI = 10
BULL_RSI_high = 80
BULL_RSI_low = 45
BULL_RSI_Timeframe = 10

BEAR_RSI = 15
BEAR_RSI_high = 50
BEAR_RSI_low = 20
BEAR_RSI_Timeframe = 10

# MODIFY RSI (depending on ADX)
BULL_MOD_high = 5
BULL_MOD_low = -5
BEAR_MOD_high = 15
BEAR_MOD_low = -5

# ADX
ADX = 3
ADX_high = 70
ADX_low = 50
ADX_Timeframe = 10

Strategy: Github
Code:
/*
    Adapted to run on 1 Minute candles with candle batching
    by Gryphon/RJPGriffin Nov'18

    RSI Bull and Bear + ADX modifier
    1. Use different RSI-strategies depending on a longer trend
    2. But modify this slighly if shorter BULL/BEAR is detected
    -
    (CC-BY-SA 4.0) Tommie Hansen
    https://creativecommons.org/licenses/by-sa/4.0/
    -
    NOTE: Requires custom indicators found here:
    https://github.com/Gab0/Gekko-extra-indicators
    (c) Gabriel Araujo
    Howto: Download + add to gekko/strategies/indicators
*/

// req's
var log = require('../core/log.js');
var config = require('../core/util.js').getConfig();
var RSI = require('./indicators/RSI.js')
var ADX = require('./indicators/ADX.js')
var SMA = require('./indicators/SMA.js')


// strategy
var strat = {

 /* INIT */
 init: function() {
   // core
   this.name = 'RSI Bull and Bear + ADX M1';
   this.requiredHistory = config.tradingAdvisor.historySize;
   this.resetTrend();

   // debug? set to false to disable all logging/messages/stats (improves performance in backtests)
   this.debug = false;

   // performance
   config.backtest.batchSize = 1000; // increase performance
   config.silent = true; // NOTE: You may want to set this to 'false' @ live
   config.debug = false;

   //Add Custom Timeframe indicators
   //SMA
   this.maSlow = new SMA(this.settings.SMA_long);
   this.maFast = new SMA(this.settings.SMA_short)

   // RSI
   this.BULL_RSI = [];
   for (let i = 0; i < this.settings.BULL_RSI_Timeframe; i++) {
     this.BULL_RSI[i] = new RSI({
       interval: this.settings.BULL_RSI
     });
   }

   this.BEAR_RSI = [];
   for (let i = 0; i < this.settings.BEAR_RSI_Timeframe; i++) {
     this.BEAR_RSI[i] = new RSI({
       interval: this.settings.BEAR_RSI
     });
   }

   // ADX
   this.ADX = new ADX(this.settings.ADX);

   this.timeframes = {
     SMA: this.settings.SMA_Timeframe,
     SMA_Count: 0,
     BULL_RSI: this.settings.BULL_RSI_Timeframe,
     BULL_RSI_Count: 0,
     BEAR_RSI: this.settings.BEAR_RSI_Timeframe,
     BEAR_RSI_Count: 0,
     ADX: this.settings.ADX_Timeframe,
     ADX_Count: 0
   };

   // ADX
   this.addIndicator('ADX', 'ADX', this.settings.ADX);

   // MOD (RSI modifiers)
   this.BULL_MOD_high = this.settings.BULL_MOD_high;
   this.BULL_MOD_low = this.settings.BULL_MOD_low;
   this.BEAR_MOD_high = this.settings.BEAR_MOD_high;
   this.BEAR_MOD_low = this.settings.BEAR_MOD_low;


   // debug stuff
   this.startTime = new Date();

   // add min/max if debug
   if (this.debug) {
     this.stat = {
       adx: {
         min: 1000,
         max: 0
       },
       bear: {
         min: 1000,
         max: 0
       },
       bull: {
         min: 1000,
         max: 0
       }
     };
   }

   /* MESSAGES */

   // message the user about required history
   log.info("====================================");
   log.info('Running', this.name);
   log.info('====================================');
   log.info("Make sure your warmup period matches SMA_long and that Gekko downloads data if needed");

   // warn users
   if (this.requiredHistory < this.settings.SMA_long) {
     log.warn("*** WARNING *** Your Warmup period is lower then SMA_long. If Gekko does not download data automatically when running LIVE the strategy will default to BEAR-mode until it has enough data.");
   }

 }, // init()


 /* RESET TREND */
 resetTrend: function() {
   var trend = {
     duration: 0,
     direction: 'none',
     longPos: false,
   };

   this.trend = trend;
 },


 /* get low/high for backtest-period */
 lowHigh: function(val, type) {
   let cur;
   if (type == 'bear') {
     cur = this.stat.bear;
     if (val < cur.min) this.stat.bear.min = val; // set new
     else if (val > cur.max) this.stat.bear.max = val;
   } else if (type == 'bull') {
     cur = this.stat.bull;
     if (val < cur.min) this.stat.bull.min = val; // set new
     else if (val > cur.max) this.stat.bull.max = val;
   } else {
     cur = this.stat.adx;
     if (val < cur.min) this.stat.adx.min = val; // set new
     else if (val > cur.max) this.stat.adx.max = val;
   }
 },

 //Update all of the non gekko managed indicators here
 update: function(candle) {
   tf = this.timeframes;
   if (tf.SMA_Count >= tf.SMA) {
     this.maSlow.update(candle.close);
     this.maFast.update(candle.close);
     tf.SMA_Count = 0;
   } else {
     tf.SMA_Count++;
   }

   tf.BULL_RSI_Count = (tf.BULL_RSI_Count + 1) % (tf.BULL_RSI - 1);
   this.BULL_RSI[tf.BULL_RSI_Count].update(candle);


   tf.BEAR_RSI_Count = (tf.BEAR_RSI_Count + 1) % (tf.BEAR_RSI - 1);
   this.BEAR_RSI[tf.BEAR_RSI_Count].update(candle);

   if (tf.ADX_Count >= tf.ADX) {
     this.ADX.update(candle);
     tf.ADX_Count = 0;
   } else {
     tf.ADX_Count++;
   }
 },


 /* CHECK */
 check: function(candle) {
   // get all indicators

   var maSlow = this.maSlow.result,
     maFast = this.maFast.result,
     rsi,
     adx = this.ADX.result;

   // BEAR TREND
   // NOTE: maFast will always be under maSlow if maSlow can't be calculated
   if (maFast < maSlow) {
     rsi = this.BEAR_RSI[this.timeframes.BEAR_RSI_Count].result;
     let rsi_hi = this.settings.BEAR_RSI_high,
       rsi_low = this.settings.BEAR_RSI_low;

     // ADX trend strength?
     if (adx > this.settings.ADX_high) rsi_hi = rsi_hi + this.BEAR_MOD_high;
     else if (adx < this.settings.ADX_low) rsi_low = rsi_low + this.BEAR_MOD_low;

     if (rsi > rsi_hi) this.short();
     else if (rsi < rsi_low) this.long();

     if (this.debug) this.lowHigh(rsi, 'bear');
   }

   // BULL TREND
   else {
     rsi = this.BULL_RSI[this.timeframes.BULL_RSI_Count].result;
     let rsi_hi = this.settings.BULL_RSI_high,
       rsi_low = this.settings.BULL_RSI_low;

     // ADX trend strength?
     if (adx > this.settings.ADX_high) rsi_hi = rsi_hi + this.BULL_MOD_high;
     else if (adx < this.settings.ADX_low) rsi_low = rsi_low + this.BULL_MOD_low;

     if (rsi > rsi_hi) this.short();
     else if (rsi < rsi_low) this.long();
     if (this.debug) this.lowHigh(rsi, 'bull');
   }

   // add adx low/high if debug
   if (this.debug) this.lowHigh(adx, 'adx');

 }, // check()


 /* LONG */
 long: function() {
   if (this.trend.direction !== 'up') // new trend? (only act on new trends)
   {
     this.resetTrend();
     this.trend.direction = 'up';
     this.advice('long');
     if (this.debug) log.info('Going long');
   }

   if (this.debug) {
     this.trend.duration++;
     log.info('Long since', this.trend.duration, 'candle(s)');
   }
 },


 /* SHORT */
 short: function() {
   // new trend? (else do things)
   if (this.trend.direction !== 'down') {
     this.resetTrend();
     this.trend.direction = 'down';
     this.advice('short');
     if (this.debug) log.info('Going short');
   }

   if (this.debug) {
     this.trend.duration++;
     log.info('Short since', this.trend.duration, 'candle(s)');
   }
 },


 /* END backtest */
 end: function() {
   let seconds = ((new Date() - this.startTime) / 1000),
     minutes = seconds / 60,
     str;

   minutes < 1 ? str = seconds.toFixed(2) + ' seconds' : str = minutes.toFixed(2) + ' minutes';

   log.info('====================================');
   log.info('Finished in ' + str);
   log.info('====================================');

   // print stats and messages if debug
   if (this.debug) {
     let stat = this.stat;
     log.info('BEAR RSI low/high: ' + stat.bear.min + ' / ' + stat.bear.max);
     log.info('BULL RSI low/high: ' + stat.bull.min + ' / ' + stat.bull.max);
     log.info('ADX min/max: ' + stat.adx.min + ' / ' + stat.adx.max);
   }

 }

};

module.exports = strat;