xFFFFF/Gekko-BacktestTool

$use_toml_files = 'no'; => You dont add strategy, pairs or warmups to configuration file.

bald123 opened this issue · 4 comments

I defined my pairs, strategies and warmups in the backtest-config.pl file. Then I decided to put the strategy configs in the JSON part of backtest-config.pl, so I set $use_toml_files = 'no';

It seems that when I set $use_toml_files = 'no', it doesn't read my pairs, strategies and warmups config anymore from the file and I get the following warning:
"You dont add strategy, pairs or warmups to configuration file."

How can I get this to work?

I encounter the same problem.
Using $use_toml_files = 'no' with the repository file produces the same error.
I have checked that my strategy was working correctly directly with Gekko.
I have defined the 3 variables but got "You dont add strategy, pairs or warmups to configuration file."
Should we redefine this variables in JSON configuration or elsewhere ?

Extract of my configuration file :
@strategies = qw(
myCandlesPatterns
);
@pairs = qw(
kraken:EUR:ETH
);
@WarmUp = qw(
15:3
);

Thanks in advance for any help

I have modified backtest.pl to try to debug it and understand what happens.
I have not programmed in perl for many years, so be cool with my dirty code :-)

The error message is triggered by "if ($remain) {" that is false.
So i investigated the content of this variable:
It is set by " my $remain = scalar @pairs * scalar (keys %stratconfig) * scalar @WarmUp;"

Before 1104 line, i added some debug code:
$backtest_start = strftime "%Y-%m-%d %H:%M:%S", localtime;
print "MYDEBUG pair size=".scalar @pairs." value=@pairs\n";
print "MYDEBUG keys %stratconfig size=".scalar (keys %stratconfig)." value=@{[%stratconfig]}\n";
print "MYDEBUG warmup size=".scalar @WarmUp." value =@WarmUp\n";
print "MYDEBUG strategies=@strategies\n";
my $remain = scalar @pairs * scalar (keys %stratconfig) * scalar @WarmUp;

Result:
MYDEBUG pair size=1 value=kraken:EUR:ETH
MYDEBUG keys %stratconfig size=0 value=
MYDEBUG warmup size=1 value = 15:3
MYDEBUG strategies=myCandlesPatterns
You dont add strategy, pairs or warmups to configuration file.

=> %stratconfig is empty.

It seems to me that this hash contents the configuration of the strategy and is only initialized in the block beginning by "if ($use_toml_files eq 'yes') {" line 871.

In our case ($use_toml_files eq = 'no'), %stratconfig is not filled.

Another information : a configuration of my strategy exists in backtest-config.pl
$stratsettings = q(
config.myCandlesPatterns = {
"trailingStopPourcentage": 2
};
So, either the %stratconfig variable is not filled or my strategy configuration is not correct and not seen.

Any help or advice from someone knowing the tool ?

Has any progress been done on this? Does anyone have any tips for it.