Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bald123 opened this issue Jun 5, 2018 · 4 comments

Comments

@bald123
Copy link

bald123 commented Jun 5, 2018

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?

@cat944
Copy link

cat944 commented Jun 9, 2018

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

@cat944
Copy link

cat944 commented Jun 10, 2018

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.

@cat944
Copy link

cat944 commented Jun 10, 2018

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 ?

@sipink
Copy link

sipink commented Jul 20, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants