xFFFFF / Gekko-BacktestTool

Batch backtest, import and strategy params optimalization for Gekko Trading Bot. With one command you will run any number of backtests.
MIT License
231 stars 85 forks source link

Update for Gekko 0.6.0 #35

Open askmike opened 6 years ago

askmike commented 6 years ago

I've released gekko 0.6 which has some differences in the API. See the following links for details:

bobychain commented 6 years ago

Indeed it seems to be not working anymore, profit[%] and profit/day[%] are both at 0.00.

jonathanday930 commented 6 years ago

I am getting that error too. @xFFFFF , are you planning on fixing this?

askmike commented 6 years ago

This is not my tool, maybe @xFFFFF can weigh in?

On Thu, Jul 12, 2018 at 1:37 PM, jonathanday930 notifications@github.com wrote:

I am getting that error too. @askmike https://github.com/askmike, are you planning on fixing this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xFFFFF/Gekko-BacktestTool/issues/35#issuecomment-404395031, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD4rRdZKduY8LCXJfEvXGl1omytRYks5uFuCRgaJpZM4VCYe6 .

-- PGP key at keybase.io/mikevanrossum https://keybase.io/mikevanrossum/key.asc

jonathanday930 commented 6 years ago

If I were to use the gekko version right before 0.6, do you think backtesting would still run ok? Im only going to use this installation for backtesting.

askmike commented 6 years ago

I think so yes, unless you run in any of the issues people have documented before.

On Thu, 12 Jul 2018, 13:57 jonathanday930, notifications@github.com wrote:

If I were to use the gekko version right before 0.6, do you think backtesting would still run ok? Im only going to use this installation for backtesting.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xFFFFF/Gekko-BacktestTool/issues/35#issuecomment-404398257, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD4aZYX_ejdxfiNVJsUQgJh-GKfZYks5uFuU5gaJpZM4VCYe6 .

gabrielrey37 commented 6 years ago

in lines 1280-1281 of backtest.pl

change my @profit = $grun =~ /(?<=simulated profit:\t\t )[0-9.-][0-9.-] $sets[1] ((.)(?=\%))/; my @yearly = $grun =~ /(?<=simulated yearly profit:\t )[0-9.-][0-9.-] $sets[1] ((.)(?=\%))/;

to my @profit= $grun =~ /(?<=profit:\t\t )(.?)(?=U)/; my @yearly = $grun =~ /(?<=simulated yearly profit:\t\t )(.?)(?=\n)/;

works for me

ianhord commented 6 years ago

@xFFFFF looks like a great tool. Thanks. I have just set it up and am running off the binaries as have been unable to get perl to run on my machine. I am getting the same zero values. Also getting some db errors - see below. Any chance someone can update the binaries?

[2018-08-05 16:38:54] Creating TOP STRATEGY table...
DBD::CSV::st execute failed: No such column 'DISTINCT strategy' at DBI/DBD/SqlEngine.pm line 1271.
 [for Statement "SELECT DISTINCT strategy, strategy_settings FROM tmp/tmp_datazfymo.csv"] at script/backtest.pl line 182.
DBD::CSV::st execute failed: No such column 'DISTINCT strategy' at DBI/DBD/SqlEngine.pm line 1271.
 [for Statement "SELECT DISTINCT strategy, strategy_settings FROM tmp/tmp_datazfymo.csv"] at script/backtest.pl line 182.
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: SQLITE_BUSY: database is locked
BTC-ARN Backtest is failed.
Can't use an undefined value as a HASH reference at script/backtest.pl line 729.
ianhord@dev-gekko:~/gekko$ events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: SQLITE_BUSY: database is locked
BTC-ELF Backtest is failed.
The storable module was unable to store the child's data structure to the temp file "/tmp/vxKqL7djSg/Parallel-ForkManager-4019-4755.txt":  can't create /tmp/vxKqL7djSg/Parallel-ForkManager-4019-4755.txt: No such file or directory at Parallel/ForkManager.pm line 84.
danibeni81 commented 6 years ago

I am also having this issue. I,ve changed the lines 1280-1281 of backtest.pl as suggested by gabrielrey37 above but the results look the same: Profit and Profit/day = 0.00 I am using Windows 10, Gekko v 0.6.2 and BackTestTool V0.7

danibeni81 commented 6 years ago

@jonathanday930 did you find a previous Gekko version that works with the latest BackTestTool? Is it sufficient for optimizing strategy parameters?

robmazur commented 6 years ago

@danibeni81 Here's what I use for profit variable that works: my @profit = $grun =~ /(?<=profit:\t\t )[0-9.\-][0-9.\-]* $sets[1] \((.*)(?=\%\))/;

danibeni81 commented 6 years ago

dear @robmazur thanks a lot!! it seems it works!!

Tronab commented 6 years ago

with 0.65 patch not working

suprnrdy commented 6 years ago

I removed one of the \t and it seems to be working. I modified the code on line 1280 to: my @profit = $grun =~ /(?<=profit:\t )[0-9.\-][0-9.\-]* $sets[1] \((.*)(?=\%\))/;

njandam commented 6 years ago

@suprnrdy thanks, it seems ok now.

im using Gekko v0.6.6

YuriyTigiev commented 6 years ago

I'm sharing my version of the string which should be updated (1280). I have tested and all works.
Gekko version: v0.6.6 Nodejs version: v8.12.0

Old string my @profit = $grun =~ /(?<=simulated profit:\t\t )[0-9.-][0-9.-] $sets[1] ((.)(?=\%))/;

The new string my @profit = $grun =~ /(?<=profit:\t\t\t\t )[0-9.-][0-9.-] $sets[1] ((.)(?=\%))/;

dominik-fr commented 6 years ago

Is there any "ultimate" solution to 0 % profit? I think I've checked every single proposal here yet still 0% profit persists :/ @YuriyTigiev Any other additional change is needed apart from change in 1280 line?

verbraucher commented 6 years ago

Maybe you're looking at mine, not a perfect regex, but it works for me (it extracts the percent of profit):

my @profit = $grun =~ /(?<=profit:\t\t\t\t )[0-9.-][0-9.-]* $sets[1] [(]?((.*)(?=%))[(]?/;

dominik-fr commented 6 years ago

Maybe you're looking at mine, not a perfect regex, but it works for me (it extracts the percent of profit):

my @profit = $grun =~ /(?<=profit:\t\t\t\t )[0-9.-][0-9.-]* $sets[1] [(]?((.*)(?=%))[(]?/;

@verbraucher Works like charm! Thanks!