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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 20,937
» Latest member: lmktrading62
» Forum threads: 1,541
» Forum posts: 7,744

Full Statistics

Online Users
There are currently 240 online users.
» 0 Member(s) | 240 Guest(s)

Latest Threads
Gekko development status ...
Forum: Announcements
Last Post: kontho
Yesterday, 11:51 AM
» Replies: 811
» Views: 552,227
An official Gekko service...
Forum: Announcements
Last Post: lovelylula
Yesterday, 09:24 AM
» Replies: 86
» Views: 142,735
Gekko with malware spotte...
Forum: Announcements
Last Post: Lana15
05-03-2024, 06:24 PM
» Replies: 136
» Views: 94,970
New Gekko UI in the works
Forum: Announcements
Last Post: dejaoffice
04-25-2024, 10:44 AM
» Replies: 137
» Views: 159,060
Gekko 0.6 released
Forum: Announcements
Last Post: sabinaholt
03-27-2024, 12:10 PM
» Replies: 104
» Views: 218,908
How to Soft Reset or Hard...
Forum: General Discussion
Last Post: lucifar
10-07-2021, 07:18 PM
» Replies: 22
» Views: 40,021
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 83,017
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 15,366
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 35,119
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 46,193

 
  How to add the new ico for the binance stock exchange
Posted by: ankasem - 02-11-2018, 06:36 PM - Forum: Binance - No Replies

hi all
How to add the new ico for the binance stock exchange
thank you


  binance usdt eth coin for trading
Posted by: ankasem - 02-11-2018, 02:38 PM - Forum: Binance - Replies (3)

hi all



There is a responsibility to those who use the binance stock exchange


I have eth in my wallet


Can gekko usdt start as eth (for tradebot)


otherwise I should convert it to eth usdt

thank you


  Indicators based on HIGH and LOW values
Posted by: chbinder - 02-11-2018, 12:25 PM - Forum: Strategy Development - Replies (2)

Hi all,

first of all, after having some issues with older gekko versions the current one is working like a charm. Thanks for all the great work!

I created some strategies that work fine and sure, after successfully testing more deeply I will share those here...

For my next "project" I want to create a trading strategy that works great in FOREX markets to verify if it can be used for crypto currencies, too. This strategy is based on two SMAs with the same period but calculated based on the HIGH and LOW values of the candles.

And that's why I kindly ask the community to point me to the right direction:

As I've seen all indicators (gekko, talib, tulip) are calculated based on the CLOSE values (please correct me if I'm wrong). 

Is there a way to do what I explained above? If yes, how can this be achieved?

Many thanks for your support.

Best regards,
Christian


  talib candle recognition
Posted by: zappra - 02-11-2018, 11:14 AM - Forum: Strategy Development - Replies (2)

Hello! First post  Big Grin

I'd like to know if it's possible to use ta-lib's candle recognition in Gekko?

Best,
z


  Running gekko on a ubuntu server with apache
Posted by: SettusBlake - 02-10-2018, 08:35 PM - Forum: Technical Discussion - Replies (20)

Hello!

My knowledge of linux, apache and nodejs is not that great.
But has someone a good detail description for me, how I can run it on an apache server (linux)?


Question Default included CCI strat values wrong? Or i did not understand something...
Posted by: piactif - 02-10-2018, 05:45 PM - Forum: General Discussion - Replies (4)

Hi Mike and others, and first really thank you for the great work on Gekko bot and its additions !

Perhaps i misunderstood something, and perhaps somebody could explain why the CCI results are not the same as i can see on tradingview with the same settings.

Here is what i did to verifiy gekko CCI indicator value against Tradingview CCI value on same period : 

1/ Choose a pair (NEO/ETH) on an exchange (BINANCE) and import 1 month data

2/ Choose an indicator (CCI), a candle size (4 hours) and history size (20 everywhere, so supposed to be 20 * 4hours candle if i'm right)

3/ Make the corresponding graph on tradingview :

[Image: Capture_du_2018_02_10_18_13_32.png]

4/ Just modify the CCI.js strat file to write date and cci value in a csv file on each candle :

Code:
       log.debug('\t', 'CCI:\t\t', cci.result.toFixed(2));
   grreadtime = candle.start.toDate();
   outtxt = grreadtime+","+0+","+cci.result.toFixed(2)+","+"-"+"\n";
    fsw.appendFileSync(this.fname, outtxt, encoding='utf8');

5/ Launch backtest (UI or CLI) and compare values to see they not correspond

examples :
  • on 2018-02-05 5:00, tradingview CCI was -58, but for Gekko it was -93 !?
  • on 2018-02-06 5:00, tradingview CCI was -176, but for Gekko it was -38 !?
  • on 2018-02-07 9:00, tradingview CCI wast +170, but for Gekko it was +134


Thanks if somewhone can explain me why or what i did wrong, all is configured with 4hours candle, 20 history : or prhaps on Tradingview it is 20 DAYS history ?
So to have same results in Gekko i should put 280 (4*6*20) to have 20 days ?


  [HELP] StochRSI_MACD_BB start no trades
Posted by: johnnash - 02-10-2018, 12:47 PM - Forum: Strategy Development - No Replies

Hi friends, I'm looking for someone who can help me with the implementation of my first gekko strategy. I managed to add all the necessary files to the gekko directory so that I do not give an error once started. the problem is that the bot makes zero trade.
[node version:9.5.0 ; npm version:5.6.0; gekko version:0.5.12]
these are the files I used:


This is BB.js (/strategies/indicators/)

Code:
// no required indicators
// Bollinger Bands - Okibcn implementation 2018-01-02
// hand0722 customized 2019-01-09

var Indicator = function(BBSettings) {
this.input = 'price';
this.settings = BBSettings;
// Settings:
// TimePeriod: The amount of samples used for the average.
// NbDevUp: The distance in stdev of the upper band from the SMA.
// NbDevDn: The distance in stdev of the lower band from the SMA.
this.prices = [];
this.diffs = [];
this.age = 0;   // age = Warm Up Period
this.sum = 0;
this.sumsq = 0;
this.upper = 0;
this.middle = 0;
this.lower = 0;
}

Indicator.prototype.update = function(price) {

var tail = this.prices[this.age] || 0; // oldest price in window
var diffsTail = this.diffs[this.age] || 0; // oldest average in window

this.prices[this.age] = price;
this.sum += price - tail;
this.middle = this.sum / this.prices.length; // SMA value

// your code:
// this.diffs[this.age] = (price - this.middle);
// customized code (see formula), we have to build a math.pow:
this.diffs[this.age] = Math.pow((price - this.middle), 2);

// your code:
// this.sumsq += this.diffs[this.age] ** 2 - diffsTail ** 2;
// customized code:
this.sumsq += this.diffs[this.age] - diffsTail;

// your code:
// var stdev = Math.sqrt(this.sumsq) / this.prices.length;
// customized code (see formula), we have to build a math.sqrt over the whole expression:
var stdev = Math.sqrt(this.sumsq / this.prices.length);

this.upper = this.middle + this.settings.NbDevUp * stdev;
this.lower = this.middle - this.settings.NbDevDn * stdev;

this.age = (this.age + 1) % this.settings.TimePeriod;

}
module.exports = Indicator;


This is StochRSI_MACD_BB.js in / strategies /:

Code:
/*

 StochRSI - SamThomp 11/06/2014

 (updated by askmike) @ 30/07/2016

*/
// helpers
var _ = require('lodash');
var log = require('../core/log.js');

var RSI = require('./indicators/RSI.js');

// let's create our own method
var method = {};

// prepare everything our method needs
method.init = function() {
    this.interval = this.settings.interval;

 this.trend = {
   direction: 'none',
   duration: 0,
   persisted: false,
   adviced: false
 };

 this.requiredHistory = this.tradingAdvisor.historySize;

 // define the indicators we need
    this.addIndicator('rsi', 'RSI', { interval: this.interval });
    this.addIndicator('macd', 'MACD', this.settings);
    this.addIndicator('bb', 'BB', this.settings.bbands);
    this.RSIhistory = [];
}

// what happens on every new candle?
method.update = function(candle) {
    this.rsi = this.indicators.rsi.result;

    this.RSIhistory.push(this.rsi);

    if(_.size(this.RSIhistory) > this.interval)
        // remove oldest RSI value
        this.RSIhistory.shift();

    this.lowestRSI = _.min(this.RSIhistory);
    this.highestRSI = _.max(this.RSIhistory);
    this.stochRSI = ((this.rsi - this.lowestRSI) / (this.highestRSI - this.lowestRSI)) * 100;
    
    
}

// for debugging purposes log the last
// calculated parameters.
method.log = function(candle) {
 var digits = 8;

    log.debug('calculated StochRSI properties for candle:');
    log.debug('\t', 'rsi:', this.rsi.toFixed(digits));
    log.debug("StochRSI min:\t\t" + this.lowestRSI.toFixed(digits));
    log.debug("StochRSI max:\t\t" + this.highestRSI.toFixed(digits));
    log.debug("StochRSI Value:\t\t" + this.stochRSI.toFixed(2));
    //MACD

    var macd = this.indicators.macd;
    var diff = macd.diff;
    var signal = macd.signal.result;
       var BB = this.indicators.bb;
    var price = candle.close;
    var macddiff = this.indicators.macd.result;
       //BB
       var BB = this.indicators.bb;
      //BB.lower; BB.upper; BB.middle are your line values
   
    var MACDsaysBUY = macddiff > this.settings.thresholds.up;
    var MACDsaysSELL = macddiff <= this.settings.thresholds.down;
    var StochRSIsaysBUY = this.stochRSI < this.settings.thresholds.low;
    var StochRSIsaysSELL = this.stochRSI >= this.settings.thresholds.high;
    var BBsayBUY=price >= (BB.middle-(BB.middle-BB.lower)/4);
    var BBsaySELL=price <= BB.lower; //>= BB.upper || price <= BB.lower

    log.debug('calculated MACD properties for candle:');
    log.debug('\t', 'short:', macd.short.result.toFixed(digits));
    log.debug('\t', 'long:', macd.long.result.toFixed(digits));
    log.debug('\t', 'macd:', diff.toFixed(digits));
    log.debug('\t', 'signal:', signal.toFixed(digits));
    log.debug('\t', 'macdiff:', macd.result.toFixed(digits));

       log.debug('\t', 'BB.lower:', BB.lower.toFixed(digits));
    log.debug('\t', 'BB.middle:', BB.middle.toFixed(digits));
    log.debug('\t', 'BB.upper:', BB.upper.toFixed(digits));
    log.debug('\t', 'price', price.toFixed(digits));
    if(BBsayBUY) {
        log.debug('\t', 'BBsaysBUY');
    }
    if(MACDsaysBUY) {
        log.debug('\t', 'MACDsaysBUY');
    }
    if(StochRSIsaysBUY) {
        log.debug('\t', 'StochRSIsaysBUY');
    }
    if(BBsaySELL) {
        log.debug('\t', 'BBsaysSELL');
    }
    if(MACDsaysSELL) {
        log.debug('\t', 'MACDsaysSELL');
    }
    if(StochRSIsaysSELL) {
        log.debug('\t', 'StochRSIsaysSELL');
    }
    if(MACDsaysSELL && StochRSIsaysSELL) {
              log.debug('\t', 'StochRSIsaysSELL and MACDsaysSELL');
    }
    if(MACDsaysBUY && StochRSIsaysBUY && BBsayBUY) {
              log.debug('\t', 'MACDsaysBUY and StochRSIsaysBUY and BBsaysBUY');
    }
}

method.check = function(candle) {
    //MACD
    var macddiff = this.indicators.macd.result;
       //BB
       var BB = this.indicators.bb;
      //BB.lower; BB.upper; BB.middle are your line values
    var price = candle.close;
       //buy when stochRSI in low and MACD in up
    //short->sell, long->buy
   
    var MACDsaysBUY = macddiff > this.settings.thresholds.up;
    var MACDsaysSELL = macddiff <= this.settings.thresholds.down;
    var StochRSIsaysBUY = this.stochRSI < this.settings.thresholds.low;
    var StochRSIsaysSELL = this.stochRSI >= this.settings.thresholds.high;
    var BBsayBUY=price >= (BB.middle-(BB.middle-BB.lower)/4);
    var BBsaySELL=price <= BB.lower; //>= BB.upper || price <= BB.lower
       if(MACDsaysSELL && StochRSIsaysSELL) {
        // new trend detected
        if(this.trend.direction !== 'high')
            this.trend = {
                duration: 0,
                persisted: false,
                direction: 'high',
                adviced: false
            };

        this.trend.duration++;

        log.debug('In high since', this.trend.duration, 'candle(s)');

        if(this.trend.duration >= this.settings.thresholds.persistence )
            this.trend.persisted = true;

        if(this.trend.persisted && !this.trend.adviced) {
            this.trend.adviced = true;
            this.advice('short');
        } else
            this.advice();

    }
    //buy when stochRSI in high and MACD in low    
    else if(MACDsaysBUY && StochRSIsaysBUY && BBsayBUY) {

        // new trend detected
        if(this.trend.direction !== 'low')
            this.trend = {
                duration: 0,
                persisted: false,
                direction: 'low',
                adviced: false
            };

        this.trend.duration++;

        log.debug('In low since', this.trend.duration, 'candle(s)');

        if(this.trend.duration >= this.settings.thresholds.persistence)
            this.trend.persisted = true;

        if(this.trend.persisted && !this.trend.adviced) {
            this.trend.adviced = true;
            this.advice('long');
        } else
            this.advice();

    } else {
        // trends must be on consecutive candles
        this.trend.duration = 0;
        log.debug('In no trend');

        this.advice();
    }

}

module.exports = method;

and this is  toml in / config / strategies /:

Code:
interval = 14
short = 12
long = 26
signal = 9

[bbands]
TimePeriod = 20
NbDevDn = 2
NbDevUp = 2
persistence_upper = 10
persistence_lower = 10  

[thresholds]
low = 20
high = 80
down = 0.1
persistence = 2



Attached Files
.png   Schermata 2018-02-10 alle 13.53.42.png (Size: 66.99 KB / Downloads: 59)

  Gekko encountered an error and can't continue
Posted by: ankasem - 02-10-2018, 12:38 PM - Forum: Binance - No Replies

hi all

RECEIVED ERROR IN GEKKO 1991000840668331


Gekko encountered an error and can't continue


Gekko encountered an error and can't continue

Error:

[binance.js] Response code 401

Meta debug info:

Gekko version: v0.5.12
Nodejs version: v8.9.4
----------------------------  
terminal image
 


what is this


----------------------
Binance -API available-trade bot experiment-


hi
IP Access Restriction: Restrict access to trusted IPs only (Recommended)
IP Access Restriction: Restrict access to trusted IPs only (Recommended)
rope changed


self catering


  Genetic "algo"
Posted by: tommiehansen - 02-10-2018, 01:32 AM - Forum: Feature Requests - Replies (19)

Implement a genetic algo.

It may sound complex but is basically this:

1. Allow settings to be ranges of min/max so instead of this in the 'Parameters' (UI) @ backtest:

short = 20
long = 50

...it could instead be this:

short = 20,40:5
long = 50,100:10


where X,Y = min/max
and :Z = stepping (in what amounts of steps this value should be changed; this since one woulnd't want to change every possible value by e.g. 1)

Above would simply translate to:

short = min: 20, max: 40, stepping: 5
long = min: 50, max: 100, stepping: 10

2. If there's ranges etc: Run backtests and change value(s) each time (if not, just do a regular backtest)
3. Have the ability to define max amount of runs (where -1 = infinite (or until number of tests runs out); custom setting that works for all strategies e.g. ga_runs = -1

4. Output best performing results -or- output the results that beat the market in some sorted .log or .csv (the latter for easy import/manipulation in 3rd party app e.g. Excel or whatever)

5. Output runs to the log() (so that one know what's happening etc...)

Doable in a reasonably amount of time?
Problem is that the GA-stuff that exist now is tedious, doesn't really work, requires other stuff that doesn't work etc etc ... (tl;dr -- tedious).


Exclamation Need help with trading bot functionality
Posted by: BitPerson - 02-09-2018, 10:26 PM - Forum: Technical Support - Replies (4)

Hey there!

I developed my working strategy and I like how it works good sometimes.

Here there are some problems with my usage of Gekko (trading bot with API from exchanges):

1) I save the last price I bought/sold like:


Code:
this.lastprice = candle.close;


This is a big problem when you buy/sell at a price xx% (where xx is big) higher/lower from the price that triggered the advice.

Example: 
Advice: buy @0.00015 -> lastprice = 0.00015 but then it buys @0.00019 -> sell @0.00017 -> I expect +0.00002 but I'm like -0.00002. 

Is there a solution? Is there the possibility to get the last price traded instead of the way I use?

2) I also would like to stop orders repetition (for example: if there's a long advice when price is 0.00015 and then price goes to 0.00030 while the order is not yet satisfied, I would like to cancel the order, not changing it to buy @0.00030). Is it possible?

3) Am I right to use advices (this.advice("long"); / this.advice("short")Wink even if I'm using trading bot and not paper trader? Or is it possible to use something more useful? For example:

3.a) Is it possible to suggest prices instead of using the best to buy/sell?

3.b) Is it possible to force some (or any, but I would prefer just some) order to "taker" instead of "maker" (market price usage) in Gdax?



Sorry for my bad english, hope everything is clear!   Tongue 
Sorry if there is an obvious solution but I'm not a developer  Sad 


Thank you for your software and your time, you already made a fantastic work!