| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 283 online users. » 0 Member(s) | 283 Guest(s)
|
| Latest Threads |
An official Gekko service...
Forum: Announcements
Last Post: tanvirai
11-20-2025, 12:18 PM
» Replies: 113
» Views: 291,895
|
Gekko development status ...
Forum: Announcements
Last Post: erectilenovus
11-17-2025, 11:36 AM
» Replies: 753
» Views: 1,769,929
|
Gekko 0.6 released
Forum: Announcements
Last Post: soniyathakur
11-02-2025, 12:21 PM
» Replies: 129
» Views: 380,502
|
Gekko with malware spotte...
Forum: Announcements
Last Post: cofffee124
10-30-2025, 09:56 AM
» Replies: 216
» Views: 346,537
|
New Gekko UI in the works
Forum: Announcements
Last Post: cofffee124
09-04-2025, 08:12 AM
» Replies: 186
» Views: 390,879
|
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 159,148
|
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 31,847
|
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 70,998
|
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 87,758
|
Is there any way to make ...
Forum: Custom Systems
Last Post: seorun
10-05-2021, 08:20 AM
» Replies: 42
» Views: 134,772
|
|
|
| Example strategy request |
|
Posted by: Henry151 - 07-06-2018, 11:20 PM - Forum: Strategy Development
- Replies (2)
|
 |
Hello all,
I am hoping somebody can help me out by drafting an example strategy, that just shows how to use gekko-broker to make partial orders; i.e. to signal "buy with only 10% of portfolio." Unless I misunderstand, I believe that this should now be possible, with v0.6 and gekko broker, but I don't understand yet how it would be implemented.
Thanks in advance for any assistance, I'm sure others will benefit from this as well!
--Henry
|
|
|
|
| GekkoGA Parallel questions |
|
Posted by: PatTrends - 07-06-2018, 07:24 PM - Forum: Third Party Software
- Replies (2)
|
 |
Hey all,
I'm attempting to use the run-ga-parallel.js script but after running it for a while I don't get any results. I can see in terminal that its changing the parameters with each run, and the epochs are stacking up, but it always returns "profit 0$" at the top and this at the bottom...
Quote:Other metrics of global maximum:
Global maximum so far:
false
As far as I can tell, no errors are being generated and the same strategy works via CLI, Web UI, and the standard GekkoGA.
Also (might be related), but can someone explain the "writer" parameters? I assume it writes the results to the specified path, but I can't get this to work either.
Code: "writer": {
"enabled": true,
"logpath": "logs/test"
},
Thanks,
PT
|
|
|
|
| New properly install ubuntu terminal |
|
Posted by: cantthink19 - 07-05-2018, 07:20 PM - Forum: Technical Discussion
- Replies (1)
|
 |
I started gekko being a butthead and going straight for the windows install since the windows 10 seemed a bit lengthy, I come to find out I need bash support for running xFFFFF strategies. I get the ubuntu but still have node.js and im having trouble adding api keys on the new process can any point me in the right direction and help me firgure out if my ip is banned since i tried to run two different gekkos from the same ip?
|
|
|
|
| Webinterface disconnected on V0.6.1 |
|
Posted by: vultureonline - 07-05-2018, 01:34 PM - Forum: Technical Support
- Replies (3)
|
 |
I installed Gekko 0.6.1 on my Raspberry Pi but I'm unable te get the webinterface running.
I installed all the files via git (from the installation instructions) and edited the config-file in the web/vue/public dir.
This file is exactly as it was when in version 0.5 that was working great.
Is there any more configuration to do?
The error I get is when Gekko is running and I browse to the webinterface (on port 3000) is:
Disconnected
Something happened to either Gekko or the connection. Please check the terminal where Gekko is running or your network connection.
This message is shown when the UI is unable to open a websocket connection with the Gekko Server.
This is my UIconfig.js file:
const CONFIG = {
headless: true,
api: {
host: '0.0.0.0',
port: 3000,
timeout: 120000 // 2 minutes
},
ui: {
ssl: false,
host: '192.168.1.221',
port: 3000,
path: '/'
},
adapter: 'sqlite'
}
if(typeof window === 'undefined')
module.exports = CONFIG;
else
window.CONFIG = CONFIG;
Any help?
|
|
|
|
| how to set a stop loss? |
|
Posted by: bashbash - 07-05-2018, 09:21 AM - Forum: Strategy Development
- No Replies
|
 |
Set up using mfi and macd it has more profitable trades than losses, however the losses are very big. this during a bearish market. Need help with setting a percentage stop loss.
|
|
|
|
| Installing on Windows 7 Issue |
|
Posted by: Orpheus2 - 07-05-2018, 06:47 AM - Forum: Technical Support
- Replies (5)
|
 |
Hello,
I am trying to install Gekko on Windows 7. Off of the bat i noticed the code shown below wasnt pointing correctly to what I downloaded. I had to path to "gekko-develop" in the file path.
Code: cd Downloads
cd gekko-stable
cd gekko-stable
Once I use that path I am able to install, then I am able to run
Code: npm install --only=production
After the above step when I try to install "Gekko Broker's dependencies" I get the error listed below.
C:\Gekko\Gekko Unzip>cd gekko-develop
C:\Gekko\Gekko Unzip\gekko-develop>npm install --only=production
up to date in 7.002s
C:\Gekko\Gekko Unzip\gekko-develop>cd exchange
C:\Gekko\Gekko Unzip\gekko-develop\exchange>npm install --only=production
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\2nd Laptop\AppData\Roaming\npm-cache\_logs\2018-07-05T06_3
0_47_322Z-debug.log
I am able to Install Tulip Indicators. I do Have an issue starting Gekko, and i get the error listed below.
C:\Gekko\Gekko Unzip\gekko-develop\exchange>node gekko --ui
module.js:549
throw err;
^
Error: Cannot find module 'C:\Gekko\Gekko Unzip\gekko-develop\exchange\gekko'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Any help would be appreciated,
Thanks!
Or[heus2
|
|
|
|
| Generate binance-markets.json |
|
Posted by: docdrow - 06-27-2018, 09:27 PM - Forum: Third Party Software
- Replies (5)
|
 |
Hey all,
I'm sure someone out there has already done this, or perhaps Gekko will eventually acquire the ability to do this. For now though I've whipped up this little program that will generate binance-markets.json for you.
Code: /* generate binance-markets.json for Gekko
* Written by George Shearer --- doc@drow.org
* Notes: There's not much error checking here, I just threw this together because I got tired of manually updating the file.
* I hope others can benefit from this.
*
* Thank you Mike van Rossum and all other Gekko contributors
*
* You can build this on most any modern linux platform:
*
* gcc -Wall -s -o genmarkets genmarkets.c -lcurl -ljson-c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <json-c/json.h>
#include <curl/curl.h>
#define SUCCESS 0
#define FAIL 1
#define OUTPUT_FILE "binance-markets.json"
#define BINANCE_URL "https://api.binance.com/api/v1/exchangeInfo"
#define MAX_MARKETS 4000
#define MAX_CURRENCIES 50
#define MAX_ASSETS 2000
struct market
{
char currency[10];
char asset[10];
double min_price;
double min_qty;
double stepsize;
double min_notional;
int currency_precision;
int asset_precision;
} markets[MAX_MARKETS];
struct currency
{
char currency[10];
} currencies[MAX_CURRENCIES];
struct asset
{
char asset[10];
} assets[MAX_ASSETS];
struct curl_fetch_st {
char *payload;
size_t size;
};
int total_currencies = 0;
int total_assets = 0;
int total_markets = 0;
/* callback for curl fetch */
size_t curl_callback (void *contents, size_t size, size_t nmemb, void *userp) {
size_t realsize = size * nmemb; /* calculate buffer size */
struct curl_fetch_st *p = (struct curl_fetch_st *) userp; /* cast pointer to fetch struct */
/* expand buffer */
p->payload = (char *) realloc(p->payload, p->size + realsize + 1);
/* check buffer */
if (p->payload == NULL) {
/* this isn't good */
fprintf(stderr,"ERROR: Failed to expand buffer in curl_callback");
/* free buffer */
free(p->payload);
/* return */
return(-1);
}
/* copy contents to buffer */
memcpy(&(p->payload[p->size]), contents, realsize);
/* set new buffer size */
p->size += realsize;
/* ensure null termination */
p->payload[p->size] = 0;
/* return size */
return(realsize);
}
/* fetch and return url body via curl */
CURLcode curl_fetch_url(CURL *ch, const char *url, struct curl_fetch_st *fetch) {
CURLcode rcode; /* curl result code */
/* init payload */
fetch->payload = (char *) calloc(1, sizeof(fetch->payload));
/* check payload */
if (fetch->payload == NULL) {
/* log error */
fprintf(stderr, "ERROR: Failed to allocate payload in curl_fetch_url");
/* return error */
return CURLE_FAILED_INIT;
}
/* init size */
fetch->size = 0;
/* set url to fetch */
curl_easy_setopt(ch, CURLOPT_URL, url);
/* set calback function */
curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, curl_callback);
/* pass fetch struct pointer */
curl_easy_setopt(ch, CURLOPT_WRITEDATA, (void *) fetch);
/* set default user agent */
curl_easy_setopt(ch, CURLOPT_USERAGENT, "libcurl-agent/1.0");
/* set timeout */
curl_easy_setopt(ch, CURLOPT_TIMEOUT, 5);
/* enable location redirects */
curl_easy_setopt(ch, CURLOPT_FOLLOWLOCATION, 1);
/* set maximum allowed redirects */
curl_easy_setopt(ch, CURLOPT_MAXREDIRS, 1);
/* fetch the url */
rcode = curl_easy_perform(ch);
/* return */
return rcode;
}
int
do_curl(const char *url, char **storage)
{
CURL *curl_handle;
CURLcode curl_result;
struct curl_fetch_st curl_fetch;
struct curl_fetch_st *cf = &curl_fetch;
curl_handle = curl_easy_init();
curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 20L);
curl_result = curl_fetch_url(curl_handle, url, cf);
curl_easy_cleanup(curl_handle);
/* check return code */
if (curl_result != CURLE_OK || cf->size < 1)
{
fprintf(stderr, "do_curl(): Error grabbing '%s': %s", url, curl_easy_strerror(curl_result));
return(1);
}
/* check payload */
if (cf->payload != NULL) {
*storage = cf->payload;
return(SUCCESS);
} else {
fprintf(stderr, "do_curl(): Error storing payload from '%s'\n",url);
return(FAIL);
}
}
void
add_currency(char *currency)
{
int x = 0;
for(;x < total_currencies && x < MAX_CURRENCIES;x++)
if(!strcmp(currencies[x].currency, currency))
return;
total_currencies++;
strncpy(currencies[x].currency, currency, 10);
}
void
add_asset(char *asset)
{
int x = 0;
for(;x < total_assets && x < MAX_ASSETS;x++)
if(!strcmp(assets[x].asset, asset))
return;
total_assets++;
strncpy(assets[x].asset, asset, 10);
}
int
get_binance_info(void)
{
char *data;
json_object *bjson;
enum json_tokener_error jerr = json_tokener_success;
printf("Connecting to %s ... ",BINANCE_URL); fflush(stdout);
if(do_curl(BINANCE_URL, &data))
{
puts("failed");
return(FAIL);
}
puts("success");
bjson = json_tokener_parse_verbose(data, &jerr);
free(data);
if(jerr == json_tokener_success)
{
json_object *symbols;
if((symbols = json_object_object_get(bjson, "symbols"))!=NULL)
{
int x;
total_markets = json_object_array_length(symbols);
for(x = 0; x < total_markets && x < MAX_MARKETS; x++)
{
json_object *tmpmkt = json_object_array_get_idx(symbols, x);
json_object *filters;
strncpy(markets[x].currency, json_object_get_string(json_object_object_get(tmpmkt, "quoteAsset")), 10);
markets[x].currency_precision = atoi(json_object_get_string(json_object_object_get(tmpmkt, "quotePrecision")));
add_currency(markets[x].currency);
strncpy(markets[x].asset, json_object_get_string(json_object_object_get(tmpmkt, "baseAsset")), 10);
markets[x].asset_precision = atoi(json_object_get_string(json_object_object_get(tmpmkt, "baseAssetPrecision")));
add_asset(markets[x].asset);
if((filters = json_object_object_get(tmpmkt, "filters"))!=NULL)
{
int y, numfilters = json_object_array_length(filters);
for(y = 0; y < numfilters; y++)
{
json_object *tmpfilter = json_object_array_get_idx(filters, y);
const char *filter_type = json_object_get_string(json_object_object_get(tmpfilter, "filterType"));
if(!strcmp(filter_type, "PRICE_FILTER"))
markets[x].min_price = atof(json_object_get_string(json_object_object_get(tmpfilter, "minPrice")));
else if(!strcmp(filter_type, "MIN_NOTIONAL"))
markets[x].min_notional = atof(json_object_get_string(json_object_object_get(tmpfilter, "minNotional")));
else if(!strcmp(filter_type, "LOT_SIZE"))
{
markets[x].min_qty = atof(json_object_get_string(json_object_object_get(tmpfilter, "minQty")));
markets[x].stepsize = atof(json_object_get_string(json_object_object_get(tmpfilter, "stepSize")));
}
}
}
}
printf("Loaded %d markets\n",total_markets);
}
}
json_object_put(bjson);
return(SUCCESS);
}
void
gen_gekko_markets(const char *output)
{
int x = 0;
FILE *fp = fopen(OUTPUT_FILE, "w");
fprintf(fp, "{\n \"currencies\": [");
for(; x < total_currencies; x++)
{
if(x)
fprintf(fp, ",");
fprintf(fp, " \"%s\"", currencies[x].currency);
}
fprintf(fp, " ],\n \"assets\": [");
for(x = 0; x < total_assets; x++)
{
if(x)
fprintf(fp, ",");
fprintf(fp, " \"%s\"", assets[x].asset);
}
fprintf(fp, " ],\n \"markets\": [\n");
for(x = 0; x < total_markets; x++)
{
char fmt[500], temp[100];
if(x)
fprintf(fp, ",\n");
strcpy(fmt, " {\n \"pair\": [\n \"%s\",\n \"%s\"\n ],\n \"minimalOrder\": {\n \"amount\": %f,\n \"price\": %");
sprintf(temp, "0.%df", markets[x].asset_precision);
strcat(fmt, temp);
strcat(fmt, ",\n \"order\": %f\n }\n }");
fprintf(fp, fmt, markets[x].currency, markets[x].asset, markets[x].min_qty, markets[x].min_price, markets[x].min_notional);
}
fprintf(fp, "\n ]\n}\n");
fclose(fp);
}
int
main(int argc, char *argv[])
{
memset((void *)markets, 0, sizeof(struct market) * MAX_MARKETS);
memset((void *)currencies, 0, sizeof(struct currency) * MAX_CURRENCIES);
memset((void *)assets, 0, sizeof(struct asset) * MAX_ASSETS);
if(get_binance_info() == SUCCESS)
{
printf("Generating gekko file \"%s\" ...", OUTPUT_FILE); fflush(stdout);
gen_gekko_markets(OUTPUT_FILE);
puts("done");
exit(SUCCESS);
}
exit(FAIL);
}
|
|
|
|
| [SHARE] PSAR Indicator and Strat |
|
Posted by: PatTrends - 06-27-2018, 05:22 PM - Forum: Strategy Development
- No Replies
|
 |
Hey all,
I've really been enjoying Gekko lately and thought I would share a PSAR Indicator/Strat I wrote.
PSAR, by itself, is an awful strategy - particularly in consolidating markets. The included strategy is provided more as an example, and simply buys and sells on trend reversals. That said, PSAR is a great way to set dynamic stop-losses (as opposed to static values or percentage-based trailing stop-losses).
While I didn't specifically port the Tulip code, I did verify my indicator generates the same results. I also heavily commented the indicator so newer users can try to figure out what its doing. If you can improve my code, let me know!
PSAR.toml
Code: acceleration = 0.02
maximum = 0.2
persistence = 2
strategies/PSAR.js
Code: // PSAR strat
// PT 06/26/18
// let's create our own method
var method = {};
// prepare everything our method needs
method.init = function() {
this.name = 'PSAR';
this.inTrade = false;
this.requiredHistory = 100;
// define the indicators we need
this.addIndicator('psar', 'PSAR', this.settings);
};
// what happens on every new candle?
method.update = function(candle) {
// nothing!
};
method.log = function(candle) {
// nothing!
};
method.check = function() {
var psar = this.indicators.psar;
var trend = psar.trend;
var trendDuration = psar.duration;
// var psarResult = psar.psar;
//Sell Signal
if(trend == "down" && trendDuration >= this.settings.persistence && this.inTrade){
this.advice('short');
this.inTrade = false;
}
//Buy Signal
if(trend == "up" && trendDuration >= this.settings.persistence && !this.inTrade){
this.advice('long');
this.inTrade = true;
}
};
module.exports = method;
indicators/PSAR.js
Code: //PSAR
//PT-06/26/2018
var Indicator = function(config) {
this.input = 'candle';
this.acceleration = config.acceleration;
this.accelerationStep = config.acceleration;
this.persistence = config.persistence;
this.maximum = config.maximum;
this.psar = null;
this.initPsar = null;
this.psarEpAcc = null;
this.extremePoint = null;
this.trend = null;
this.previousTrend = null;
this.duration = 0;
this.candleHistory = [];
};
Indicator.prototype.update = function(candle) {
this.candleHistory.push(candle);
if(this.candleHistory.length >= 3) {
//Define candles
// var candle = this.candleHistory[2];
var previousCandle = this.candleHistory[1];
var prevPreviousCandle = this.candleHistory[0];
//first run
if (this.psar === null) {
this.extremePoint = prevPreviousCandle.low;
this.psar = prevPreviousCandle.high;
this.previousTrend = 'down';
}
//PSAR EQUATION
this.psarEpAcc = (this.psar - this.extremePoint) * this.acceleration;
//PAST TREND LOGIC
if (this.previousTrend == 'down') {
//calculate initial psar
this.initPsar = Math.max((this.psar - this.psarEpAcc), previousCandle.high, prevPreviousCandle.high);
//calculate PSAR
this.psar = (candle.high < this.initPsar) ? this.initPsar : this.extremePoint;
//increase duration count
this.duration++;
}
if (this.previousTrend == 'up') {
//calculate initial psar
this.initPsar = Math.min((this.psar - this.psarEpAcc), previousCandle.low, prevPreviousCandle.low);
//calculate PSAR
this.psar = (candle.low > this.initPsar) ? this.initPsar : this.extremePoint;
//increase duration count
this.duration++;
}
//Define trend
this.trend = (this.psar > candle.close) ? 'down' : 'up';
//CURRENT TREND LOGIC
if(this.trend == 'down'){
//calculate Extreme point
this.extremePoint = Math.min(this.extremePoint, candle.low);
}
if(this.trend =='up'){
//calculate Extreme point
this.extremePoint = Math.max(this.extremePoint, candle.high);
}
//UPDATE LOGIC
//If the trend stays the same and the extreme point doesn't equal the previous extreme point and the acceleration factor is less than the maximum factor...
if (this.trend == this.previousTrend && this.extremePoint != this.previousExtremePoint && this.acceleration <= this.maximum) {
//Increment the acceleration value
this.acceleration += this.accelerationStep;
}
//If the trend stays the same and the extreme point value stays the same...
if (this.trend == this.previousTrend && this.extremePoint == this.previousExtremePoint) {
//Acceleration stays the same
}
// If the current trend doesn't equal the previous trend...
if (this.trend != this.previousTrend) {
//Set the acceleration to the initial value
this.acceleration = this.accelerationStep;
//reset duration count
this.duration = 0;
}
//set values/array for next run
this.previousExtremePoint = this.extremePoint;
this.previousTrend = this.trend;
this.candleHistory.shift();
}
};
module.exports = Indicator;
|
|
|
|
|