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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 39,322
» Latest member: DishisdesignJewellery
» Forum threads: 926
» Forum posts: 6,383

Full Statistics

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

Latest Threads
An official Gekko service...
Forum: Announcements
Last Post: tanvirai
11-20-2025, 12:18 PM
» Replies: 113
» Views: 291,525
Gekko development status ...
Forum: Announcements
Last Post: erectilenovus
11-17-2025, 11:36 AM
» Replies: 753
» Views: 1,767,671
Gekko 0.6 released
Forum: Announcements
Last Post: soniyathakur
11-02-2025, 12:21 PM
» Replies: 129
» Views: 380,253
Gekko with malware spotte...
Forum: Announcements
Last Post: cofffee124
10-30-2025, 09:56 AM
» Replies: 216
» Views: 345,943
New Gekko UI in the works
Forum: Announcements
Last Post: cofffee124
09-04-2025, 08:12 AM
» Replies: 186
» Views: 390,389
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 159,104
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 31,834
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 70,982
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 87,716
Is there any way to make ...
Forum: Custom Systems
Last Post: seorun
10-05-2021, 08:20 AM
» Replies: 42
» Views: 134,722

 
  Whats the correct way to pass information from plugin to indicator
Posted by: emjayar - 09-10-2019, 10:52 AM - Forum: Technical Discussion - No Replies

Hi there,

I have an async plugin that loads some information that is to be used by an indicator. So the indicator depends on that plugin. 

How to correctly pass information from plugin to the indicator in this framework without having to resort to global variable hackery?

Thanks!

Cheers,


M


  Plugin execution order
Posted by: emjayar - 09-10-2019, 10:24 AM - Forum: Technical Discussion - No Replies

Hi there,

I'd like to create a plugin that acts as an advisor to my strategy. So ideally it should be updated before the strategy gets updated. This way the plugin might decide to fire off an event to which the strat is subscribed and then in the update of the strategy it uses the result of the plugin.

However I noticed that plugins seem to be updated after the strat update() and check() methods. I can add some hackery in the code to change execution code for particular plugins, but chances are that I'm probably doing something wrong. 

So the question is: how to properly setup some sort of plugin that advises the main strategy, so that the main strategy can use that result in its check() or update() method?

Thanks!



M


  How to retrieve candle size for strategy
Posted by: PGTART - 09-09-2019, 11:02 PM - Forum: Strategy Development - Replies (3)

I would like to make my strategies less depent on time intervals.
EA a max price swing between 5 minutes is statistically smaller then with 60 minute candles.

So when i use constants in my math i'd like to scale them by a factor of candle size  ea :

candlesize
-------------   *   constant
60

How can  i retrieve  candlesize inside the strategy ?


Star VmaPredict2.js (new)
Posted by: PGTART - 09-09-2019, 04:02 PM - Forum: Strategy Development - Replies (87)

Its a new strategy based upon volume prediction and moving averages.
Still tweaking it around, it started with reasonable profit chances.
Continous tweeking and I got to version 5 (and more), at which under the right settings high profits where made. 

It can be found here https://github.com/PGTBoos/GekkoStrategies (where you find other strategies from me as well).

By now the code base has grown large over 300 lines, while simple to maintain and to extend.
You free to use or test it, however in return i'd like you to post the settings file (and what you where trading) in return here
Let me now your tweaking results or code alterations, your highest scores.  
Because i cannot code and test at the same time.

Also I like to point out that it logs to console
And the code base is realy handy to use as a template.
Its a code template i will stick too

A default TOML is included as well for every version.
Once a version is made i dont extend it, some version behave different so you can get different results with each version.
One might stick to a certain version, or use the latest version. (generally speaking later is often better).

(the strategy may require a bit longer time I testedit  against 2 and 7 months)


Star Looking for a dev to integrate gekko into our trading terminal
Posted by: kodjima33 - 09-07-2019, 01:33 PM - Forum: Technical Discussion - No Replies

Hey guys! We are looking for a backend developer who has experience in:
-gekko 
-node.js 
-postgreSQL.
I am a product owner in Fund Platform - software for crypto fund managers. We have an algotrading feature so that customers can connect their exchanges and write algorithms using gekko.



Hope we can find somebody here.  I am really sorry for an off-topic post. 
 My telegram is: @ceofundplatform


Star Looking for a dev to integrate gekko into trading terminal
Posted by: kodjima33 - 09-07-2019, 01:31 PM - Forum: General Discussion - Replies (1)

Hey guys! We are looking for a backend developer who has experience in:
-gekko 
-node.js 
-postgreSQL.
I am a product owner in Fund Platform - software for crypto fund managers. We have an algotrading feature so that customers can connect their exchanges and write algorithms using gekko.


Hope we can find somebody here.  I am really sorry for an off-topic post. 
 My telegram is: @ceofundplatform


  My idea -- I need your input on a simple/basic code
Posted by: db071 - 09-03-2019, 06:03 AM - Forum: Strategy Development - Replies (17)

Hi all,

I am active in the forums here, so I'm posting this as a last resort at not being able to find anything else.

I am not much of a coder.  So my question is this:

Is there a pre-existing strategy for this, or can someone provide be with basic code layout for a .js strategy and .toml config please?

I simply need this as a building block.

SO!

I need to code a strategy that will sell at exactly 1.48% profit from last buy price on GDAX (coinbase pro).  After that sell, I need it to buy at -1.48% of the current price.  And so on, and so forth.

Any ideas?


Star New strategy : RSI_BULL_BEAR_ADX_PINGPONG_PEEKTREND
Posted by: PGTART - 09-02-2019, 02:19 PM - Forum: Strategy Development - Replies (11)

I extended  a strategy  named "RSI_BULL_BEAR_ADX_PINGPONG" with _PEEKTREND

You can find the code originally written by Tommie Hansen and Rafel Martin (CC-BY-SA 4.0)
And adjusted by me here :   https://github.com/PGTBoos/GekkoStrategies

About    _PeeKtrend
Most stoploss functions I've seen just get out of the market if the price is below a percentage or a fixed amount, of the original bought price.
Well, I'm no great fan of that, there is nothing wrong about going short, (as it can allow for a new long from a lower start).
However I don't want to go down the whole ride again, or just less of it.

So PeekTrend keeps track of the highest price since you went long. 
The highest price named MaxPeekClose is calculated as :     ( candle.close * closeRatio + candle.high *highRatio) / (closeRatio+HighRatio)
Then short depends upon  candle.close < MaxPeekClose * peekPercentage + peekShift
This is logged to the gekko console as well as escaped failing trend with some additional data.
I log that to console since if it happens to frequent the other code wont kickin there should be some balance between this and that to get it good working.

If no short happens then the original code continuous trading
   (the greens are on top of the TOML file )

The above math still can loose you money as its not a HODL, but one might escape earlier.
If sudden price spikes happen (but you missed them) and shortly after the price falls deep.
Then the peeks raised the upper bar and so you can have some part of the peak (instead of the deep fall).
Where the original code didn't.


at the bottom of the post, there is a screenshot of the code in a market that went slightly down the TOML provided was unaltered
So under the same conditions, you get the same.

Oh well but essentially this is where you come in !!!!
Please  test it, find better settings or alter it, and let others now here  
For those who want to alter the code
I placed a small note in the check function maybe you can help me with that.


I could improve PeekTrend function even more if somehow I could retrieve the price at which a long was really buying coins, ea not the last close.
So if you know how to let me know, please.

side note, I noticed the code can be configured to work well with various time ranges.

[Image: RSI_BULL_BEAR_ADX_PINGPONG_PEEKTREND.PNG]



(oh and wow after a lot of hacking managed to run GEKKO normally on windows without BASH ! ... see other threads here for that ).


  Importing data
Posted by: Kocojambo - 08-30-2019, 04:44 AM - Forum: Technical Discussion - Replies (1)

Hello everyone, I ran into a problem, when i`m start download of any data, this process is too slowly and i can`t resume it. Therefore there are many unfinished databases that I cannot connect with each other. Who can help with this? I need to either connect the downloaded databases or make it possible to continue downloading the next day.


Star CSV candle logging and more !!, code giveaway
Posted by: PGTART - 08-28-2019, 04:09 PM - Forum: Strategy Development - Replies (22)

Although things can be logged in the databases
There still a lot of people in love with spreadsheets (excel, calc, etc)
So i made a comma value logger, that can easily be integrated in your own strategies.

  • A filename is automatically generated (based upon when you started), or it can be set manual
    In the later case, previous files with such a name would be deleted.
  • It logs candles numbered with date time info, close low high  etc etc
  • If you wish you can add additional values to your log file, in the update function add them as extralog (be sure to coma seperate them).
  • And since you investigating strategies you can also optionally prefix the filename, in the refresh call.
  • Also if you like headers in your file there is an option to set them as well.

  • Different linebreaks for linux vs Windows ea \n vs \r\n\  (for the notepad users )
  • The data collumns C,D,E,F can be directly put in LibreOffice Calc stock chart !!  (they are in the right order   (code updated)
Here is my code :
which can be placed on top in your own strategies code

Code:
var fs = require('fs');
var CVCandleLogger =
{
    linebreaktype:'',
    CandleNr:0,
    firstrun: true,
    stratname: '',
    filename: '',
    // one could log additional commma seperated info (like math results or buy sell info, using extralog)
    update: function (candle, extralog = '',stratname='') {
        this.CandleNr++;

        if (this.filename === '') //base it upon creation time if no filename was givven
        {
            var today = new Date();
            var dd = String(today.getDate()).padStart(2, '0');
            var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
            var yyyy = today.getFullYear();
            var hh = String(today.getHours()).padStart(2, '0');
            var mm = String(today.getMinutes()).padStart(2, '0');
            today = yyyy + '-' + mm + '-' + dd + ' ' + hh + mm;
            this.filename = stratname + ' log ' + today + '.log';
        }

        if (this.firstrun) {
            var isWin = process.platform === "win32";
            if(isWin)this.linebreaktype='\r\n';else this.linebreaktype='\n';

            fs.access(this.filename, (err) => {
                if (!err) {
                    console.log('previous log file name existed, deleting it');
                    fs.unlink(this.filename);
                }
                console.log('New candle data log :', this.filename);
            });
            this.firstrun = false;
        };
        var moment = String(candle.start);
        console.log(moment);
        var timestamp = moment.substring(0, moment.lastIndexOf(' GMT'));
        
        var logline = this.CandleNr+','+ timestamp + ',' + candle.open + ',' + candle.close +','+ candle.high + ',' + candle.low + ','  + candle.vwp + ',' + candle.volume + ',' + candle.trades
        if (extralog !== '') logline = logline + ',' + extralog;
        logline=logline+this.linebreaktype;
        fs.appendFile(this.filename, logline, function (err) {if (err) throw err;});
    },

    writeheader: function(extralog='',stratname='')
    {
        if (this.filename === '') //base it upon creation time if no filename was givven
        {
            var today = new Date();
            var dd = String(today.getDate()).padStart(2, '0');
            var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
            var yyyy = today.getFullYear();
            var hh = String(today.getHours()).padStart(2, '0');
            var mm = String(today.getMinutes()).padStart(2, '0');
            today = yyyy + '-' + mm + '-' + dd + ' ' + hh + mm;
            this.filename = stratname + ' log ' + today + '.log';
        }
        if (this.firstrun) {
            fs.access(this.filename, (err) => {
                if (!err) {
                    console.log('previous log file name existed, deleting it');
                    fs.unlink(this.filename);
                }
                console.log('New candle data log :', this.filename);
            });
            this.firstrun = false;
        };

        logline ='CandleNr, date,time, open , close,high ,low,vwp ,volume , trades' ;
        if (extralog!=='')logline=logline+','+extralog;
        fs.appendFile(this.filename, logline, function (err) {if (err) throw err;});
    }

};

if you put above code on top in your strategy just below :  var config=require('../core/util/js').getconfig();

then only one line is enough to get you started with it

    /* CHECK */
    check: function (candle) {

        CVCandleLogger.update(candle); //minimal sample  find the log outputs in your gekko folder !

 ...
..

oh and the function CVCandlelogger.writeheader();
can be placed in your init part of your strategy, its not required but might be handy for excel / calc.