[SHARE] GAB - Gekko Automated Backtests
(07-19-2018, 10:11 AM)Teo Wrote: I also have  trouble. Hope someone can help. 

Error that i getting in GAB:
Code:
12:49:39 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

View of this error from Gekko:
Code:
 <-- POST /api/backtest
 <-- POST /api/backtest
 <-- POST /api/backtest
 xxx POST /api/backtest 500 301ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (E:\gekkomy\node_modules\koa\lib\context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)

 xxx POST /api/backtest 500 302ms -

Well, I'll add a couple of small comments.
1. Variable $dirRoot should be moved to user.config.php. On the local server, the root is not correctly defined and it is better to specify it manually.
2. Will be better to add the trim() function to the array $ conf ['db']

And tommiehansen, thanks for your work.
Teo, I notice you're running under windows.  I've seen the curl error when I accidentally ran from MS Edge.  Going back to Chrome worked for me.
  Reply
(07-22-2018, 08:25 AM)martyc Wrote: Teo, I notice you're running under windows.  I've seen the curl error when I accidentally ran from MS Edge.  Going back to Chrome worked for me.

Thanks for the answer. 

I use Chrome, also tried Operа but receiving same error.
  Reply
(07-19-2018, 10:11 AM)Teo Wrote: I also have  trouble. Hope someone can help. 

Error that i getting in GAB:
Code:
12:49:39 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

View of this error from Gekko:
Code:
 <-- POST /api/backtest
 <-- POST /api/backtest
 <-- POST /api/backtest
 xxx POST /api/backtest 500 301ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (E:\gekkomy\node_modules\koa\lib\context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)

 xxx POST /api/backtest 500 302ms -

Well, I'll add a couple of small comments.
1. Variable $dirRoot should be moved to user.config.php. On the local server, the root is not correctly defined and it is better to specify it manually.
2. Will be better to add the trim() function to the array $ conf ['db']

And tommiehansen, thanks for your work.

Am having the same issue.
i think it's either related to the date or the request to the /api/backtest
  Reply
(03-21-2018, 12:01 PM)tommiehansen Wrote: GAB
Gekko Automated Backtets

*** THIS IS BETA ***
If something does not work, it simply does not work since time hasn't existed yet to get it working.

Updated 14 april 2018 with MySQL as new option.

---

Why

I needed a way to run backtests for Gekko in a 'brute-force' manor automated and with multi-threading.
I also needed a way to compare all these runs and get extra data such as win percent etc.

-

Prerequisites (required)

1. Gekko installed and working
2. Webserver + PHP (preferrably 7.1+) with cURL and PDO SQLite or PDO MySQL/MariaDB
3. A user with write access

If you do not understand any of this it will be very hard to run this tool.
You can try googling for things such as install apache php 7.2.

-

How-to

0. Copy+Paste system/user.config.sample.php and rename the new file to user.config.php
1. Open user.config.php and make sure the $server variable is pointing at your Gekko install e.g. http://localhost:3000
2. Go to your-localhost/gab/ and see if it works.
3. Run something..
4. After you got some runs click 'View runs' in the menu and check results

--

Multi-server mode
If you're a nerd you can also use multi-server mode by specifying an array of servers instead of just one in your user.config.php like this:

$server = [
  'http://localhost:3000',
  'http://my-other-server:3000',
  'http://my-third-server:3000',
];

If your Gekko-files are not in sync on all these servers it will fail miserably though.
Setting an array will randomly use one of the servers to run a strategy.

In this case it's 3 so setting threads to e.g. 6 will usually mean 2 threads will run on each of these servers.
Do note that e.g. Chrome has a max concurrent connections @ 6 so in order to increase max-threads (and have it actually run in paralell) you would need to either force higher max concurrent connections or randomize/create subdomains for post.php (and remove any CORS restrictions).

-

Dynamic parameters
GAB uses dynamic parameters, these work for all strategy paramers. Example, RSI BULL/BEAR:


Code:
# SMA
SMA_long = 100:1000,100
SMA_short = 10:90,10

# BULL
BULL_RSI = 5:20,5
BULL_RSI_high = 70:90,5
BULL_RSI_low = 40:60,5

# BEAR
BEAR_RSI = 5:20,5
BEAR_RSI_high = 40:60,5
BEAR_RSI_low = 10:30,5


The format is <FROM>:<TO>,<STEPPING>.
This means that e.g. 10:20,5 will generate the range: 10,15,20
The params are inclusive meaning that odd stepping e.g. 5:15,10 will become 5,10,15 - the first and last of range is always kept.

-

Screens

Runner (select.php): https://i.imgur.com/kcXXMdW.png
Results (view.php): https://i.imgur.com/CPhvDEl.png

-

Donate

People keeps asking about this so i'll just leave it here for future reference:

BTC: 15cZUi7VvmCQJLbPXYYWChHF3JpsBaYDtH
ETH: 0xe03c5eb9DF93360e3Bcfcd13012B7DeebbED6923

-

Download

Go to: https://github.com/tommiehansen/gab/
or just clone: https://github.com/tommiehansen/gab.git

i have one issue for now . i want to test BNB as Asset and BTC as currency . and i already imported data for the last year . but it always show BTC as asset and BNB as currency . i imported only 1 data which is BNB as asset and BTC as currency but always show the reverse . how can i fix that ?
  Reply
(07-30-2018, 01:50 PM)deadheadtn Wrote:
(07-19-2018, 10:11 AM)Teo Wrote: I also have  trouble. Hope someone can help. 

Error that i getting in GAB:
Code:
12:49:39 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

View of this error from Gekko:
Code:
 <-- POST /api/backtest
 <-- POST /api/backtest
 <-- POST /api/backtest
 xxx POST /api/backtest 500 301ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (E:\gekkomy\node_modules\koa\lib\context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)

 xxx POST /api/backtest 500 302ms -

Well, I'll add a couple of small comments.
1. Variable $dirRoot should be moved to user.config.php. On the local server, the root is not correctly defined and it is better to specify it manually.
2. Will be better to add the trim() function to the array $ conf ['db']

And tommiehansen, thanks for your work.

Am having the same issue.
i think it's either related to the date or the request to the /api/backtest

Same here.

GAB:
Code:
21:34:11 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

Gekko:
Code:
uncaughtException TypeError: Cannot read property 'exchange' of undefined
   at Object.<anonymous> (/home/EBMMLuke/gekko/plugins/sqlite/handle.js:28:27)
   at Module._compile (module.js:653:30)
   at Object.Module._extensions..js (module.js:664:10)
   at Module.load (module.js:566:32)
   at tryModuleLoad (module.js:506:12)
   at Function.Module._load (module.js:498:3)
   at Module.require (module.js:597:17)
   at require (internal/module.js:11:18)
   at Object.<anonymous> (/home/EBMMLuke/gekko/plugins/sqlite/reader.js:6:14)
   at Module._compile (module.js:653:30)
 xxx POST /api/backtest 500 368ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (/home/EBMMLuke/gekko/node_modules/koa/lib/context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:189:7)

Anyone could solve this already? Appreciate your help!

Cheers, Luke
  Reply
I have been working for several hours now but unfortunately I can not solve this problem: No file for user configuration could be found.
yet the file is there and with the right name.

the webserver is Apache 2.4, php 7.2, curl is ok, sqlite is ok. By the way, GAB on my Raspberry works fine (though it's very slow) but on my windows pc, nothing to do ...

the message of sanitycheck is:

Warning: require (./ views / header.php): failed to open stream: No such file or directory in C: \ Apache24 \ htdocs \ gab \ system \ conf.php online 183
Fatal error: require (): Failed opening required './views/header.php' (include_path = '.; C: \ php \ pear') in C: \ Apache24 \ htdocs \ gab \ system \ conf.php online 183

Can anyone help me?
  Reply
(10-30-2018, 09:14 PM)Nigry Wrote: I have been working for several hours now ...

ok, after other hours of study (as written elsewhere, I'm not a programmer), I solved.


In "conf.php" I replaced the first line: $ dirRoot = dirname (__ FILE__);
with: $ dirRoot = 'C:/Apache24/htdocs/gab/';

then in "php.ini", I uncommented "extension = curl"

now GAB works perfectly, Wink

ps: Thanks to TommieHansen for the great works!
  Reply
(11-01-2018, 08:46 PM)Nigry Wrote:
(10-30-2018, 09:14 PM)Nigry Wrote: I have been working for several hours now ...

ok, after other hours of study (as written elsewhere, I'm not a programmer), I solved.


In "conf.php" I replaced the first line: $ dirRoot = dirname (__ FILE__);
with: $ dirRoot = 'C:/Apache24/htdocs/gab/';

then in "php.ini", I uncommented "extension = curl"

now GAB works perfectly, Wink

ps: Thanks to TommieHansen for the great works!

Oh.. The problem was (and still is) that you're actually trying to run it under Windows. What you're describing is a typhical problem with apache/php running on Windows.

You could have followed this guide:
https://github.com/tommiehansen/gekko_to...sl-install

And then simply could have installed php+apache (or nginx) using any simple guide such as this one: https://medium.freecodecamp.org/setup-a-...93ff28ae83

That would have saved you a bit of an headache and it is usually better to run stuff ... more "native" so to speak. Smile

Do also note that conf.php is not a user configuration file so it might be overwritten in the future updates.
Also note that GAB probably isn't working with Gekko 0.6x+ either though, simply haven't had time to update stuff.
  Reply
(10-08-2018, 07:48 PM)EBMMLuke Wrote:
(07-30-2018, 01:50 PM)deadheadtn Wrote:
(07-19-2018, 10:11 AM)Teo Wrote: I also have  trouble. Hope someone can help. 

Error that i getting in GAB:
Code:
12:49:39 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

View of this error from Gekko:
Code:
 <-- POST /api/backtest
 <-- POST /api/backtest
 <-- POST /api/backtest
 xxx POST /api/backtest 500 301ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (E:\gekkomy\node_modules\koa\lib\context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)

 xxx POST /api/backtest 500 302ms -

Well, I'll add a couple of small comments.
1. Variable $dirRoot should be moved to user.config.php. On the local server, the root is not correctly defined and it is better to specify it manually.
2. Will be better to add the trim() function to the array $ conf ['db']

And tommiehansen, thanks for your work.

Am having the same issue.
i think it's either related to the date or the request to the /api/backtest

Same here.

GAB:
Code:
21:34:11 Runner.php ERROR: Running config via curl_post() did not return data.
url: http://localhost:3000/api/backtest | curl status: 500

Gekko:
Code:
uncaughtException TypeError: Cannot read property 'exchange' of undefined
   at Object.<anonymous> (/home/EBMMLuke/gekko/plugins/sqlite/handle.js:28:27)
   at Module._compile (module.js:653:30)
   at Object.Module._extensions..js (module.js:664:10)
   at Module.load (module.js:566:32)
   at tryModuleLoad (module.js:506:12)
   at Function.Module._load (module.js:498:3)
   at Module.require (module.js:597:17)
   at require (internal/module.js:11:18)
   at Object.<anonymous> (/home/EBMMLuke/gekko/plugins/sqlite/reader.js:6:14)
   at Module._compile (module.js:653:30)
 xxx POST /api/backtest 500 368ms -

 Error: non-error thrown: [object Object]
     at Object.onerror (/home/EBMMLuke/gekko/node_modules/koa/lib/context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:189:7)

Anyone could solve this already? Appreciate your help!

Cheers, Luke


This is due to the update from 0.5 to 0.6 where the API for Gekko changed and thus GAB would need to be updated.
  Reply
(04-14-2018, 08:12 PM)gekko2yuno Wrote:
(04-14-2018, 04:46 PM)tommiehansen Wrote: Major update

MySQL (InnoDB) is now an option that can be used instead of SQLite and code has been re-written to use this, if set, wherever possible.

Why? Because if running massive runs with 10+ threads etc SQLite simply is too prone to errors (and corruption) and isn't a great choice for say 30-100 000+  runs, something that is quite feasible when running 10+ threads and date ranges that span just 3-4 months.

So this became somewhat of a problem and has been solved by letting the user choose MySQL as the database.
Requires the user to set this up in its user.config.php (see new sample.config.php).

Using MySQL is also now the recommended way to run Gabby if you aren't just testing things out.

---

This also introduces a breaking change -- the naming scheme for the database names (SQLite as well) has changed.
This mean that any old runs/database you have for SQLite will now not show up at all since GAB will not recognize these as valid databases (or it will error out).

To solve this use the included tool Compatibility Fix. Currently this will rename your SQLite databases to the new naming scheme automatically.
You'll find it under <your install directory>/tools e.g. localhost:80/gab/tools

to update do:
git pull

or to install the new version to an entirely different dir create a new one and do:
git pull https://github.com/tommiehansen/gab.git

The database name is not required in     Example for mysql: '127.0.0.1:3306,TommieHansenIsTheBest,MySuperPassword' ?
I am getting error:

MySQL db connection test
FAIL Could not connect to MySQL database, error message:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No address associated with hostname
  Reply


Forum Jump:


Users browsing this thread: