tommiehansen / gab

Gekko Automated Backtests
57 stars 19 forks source link

Uncaught Exception: Unknown primative for `'no'` on line 2. #4

Closed izevar closed 6 years ago

izevar commented 6 years ago

Hello Seem that someting in the parser function did't work correctly.

PHP says: [Sat Mar 24 09:04:58.802581 2018] [php7:error] [pid 27543] [client 127.0.0.1:49124] PHP Fatal error: Uncaught Exception: Unknown primative for 'no' on line 2. in /data/gab/system/class.toml.php:177\nStack trace:\n#0 /data/gab/system/class.toml.php(122): Toml\Parser->parseValue(''no'')\n#1 /data/gab/system/class.toml.php(79): Toml\Parser->processLine('buyImmediately ...')\n#2 /data/gab/system/class.toml.php(25): Toml\Parser->parse()\n#3 /data/gab/system/class.gab.php(131): Toml\Parser::fromString('buyImmediately ...')\n#4 /data/gab/system/class.gab.php(73): GAB\core->parse_toml('buyImmediately ...')\n#5 /data/gab/runner.php(34): GAB\core->get_strategies()\n#6 {main}\n thrown in /data/gab/system/class.toml.php on line 177

Gekko says: --> POST /api/backtest 200 2,579ms 39.34kb <-- POST /api/backtest 2018-03-24 10:17:51 (INFO): Setting up Gekko in backtest mode 2018-03-24 10:17:51 (INFO): 2018-03-24 10:17:51 (INFO): Setting up: 2018-03-24 10:17:51 (INFO): Trading Advisor 2018-03-24 10:17:51 (INFO): Calculate trading advice 2018-03-24 10:17:52 (INFO): Using the strategy: RSI_BULL_BEAR_ADX 2018-03-24 10:17:52 (INFO): ==================================== 2018-03-24 10:17:52 (INFO): Running RSI Bull and Bear + ADX 2018-03-24 10:17:52 (INFO): ==================================== 2018-03-24 10:17:52 (INFO): Make sure your warmup period matches SMA_long and that Gekko downloads data if needed 2018-03-24 10:17:52 (WARN): WARNING Your Warmup period is lower then SMA_long. If Gekko does not download data automatically when running LIVE the strategy will default to BEAR-mode until it has enough data. 2018-03-24 10:17:52 (INFO):

2018-03-24 10:17:52 (INFO): Setting up: 2018-03-24 10:17:52 (INFO): Paper Trader 2018-03-24 10:17:52 (INFO): Paper trader that simulates fake trades. 2018-03-24 10:17:52 (INFO):

2018-03-24 10:17:52 (INFO): Setting up: 2018-03-24 10:17:52 (INFO): Performance Analyzer 2018-03-24 10:17:52 (INFO): Analyzes performances of trades 2018-03-24 10:17:52 (INFO):

2018-03-24 10:17:52 (INFO): Scanning local history for backtestable dateranges. 2018-03-24 10:17:52 (DEBUG): Available 282204 2018-03-24 10:17:52 (DEBUG): Optimal 438632 2018-03-24 10:17:52 (INFO): The database has 156429 candles missing, Figuring out which ones... 2018-03-24 10:17:52 (INFO): Gekko detected multiple dateranges in the locally stored history. Please pick the daterange you are interested in testing: 2018-03-24 10:17:52 (INFO): OPTION 1: 2018-03-24 10:17:52 (INFO): from: 2017-05-23 19:15:00 2018-03-24 10:17:52 (INFO): to: 2017-09-05 01:15:00 2018-03-24 10:17:52 (INFO): OPTION 2: 2018-03-24 10:17:52 (INFO): from: 2017-12-22 15:15:00 2018-03-24 10:17:52 (INFO): to: 2018-03-22 19:15:00 2018-03-24 10:17:52 (INFO): OPTION 3: 2018-03-24 10:17:52 (INFO): from: 2018-03-22 21:15:00 2018-03-24 10:17:52 (INFO): to: 2018-03-24 09:15:00 prompt: option:

Note: The dataset selected from the GIU is the second one, if i select it manually the simulation works correctly.

tommiehansen commented 6 years ago

The TOML parser is an external lib. It however has been tested quite a lot, especially using the BULL/BEAR ADX strategy so it should be 100%.

Do note that you have several datasets within your dataset for so you have several option = automatic running will not work for that dataset. Try with a dataset where you don't got over 2x different periods.

izevar commented 6 years ago

Consolidating the dataset has solved the issue. Many thanks

WilbertNL commented 5 years ago

Sorry to re-open this issue, but I'm encountering the same problem:

Fatal error:  Uncaught Exception: Unknown primative for `'no'` on line 2. in /var/www/html/gab/system/class.toml.php:176
Stack trace:
#0 /var/www/html/gab/system/class.toml.php(121): Toml\Parser->parseValue(''no'')
#1 /var/www/html/gab/system/class.toml.php(78): Toml\Parser->processLine('buyImmediately ...')
#2 /var/www/html/gab/system/class.toml.php(24): Toml\Parser->parse()
#3 /var/www/html/gab/system/class.gab.php(178): Toml\Parser::fromString('buyImmediately ...')
#4 /var/www/html/gab/system/class.gab.php(67): GAB\core->parse_toml('buyImmediately ...')
#5 /var/www/html/gab/system/runner.php(42): GAB\core->get_strategies()
#6 {main}
  thrown in /var/www/html/gab/system/class.toml.php on line 176

Freshly installed today. Already tried a newly created dataset. Sanity check looks happy:

PHP EXTENSIONS
OK
DIRECTORY CREATION TEST
OK
PHP VERSION
OK You are running: 7.2.10-0ubuntu0.18.04.1
PHP MEMORY
OK Your PHP has 512M available
PHP MAX EXECUTION TIME
OK Your max execution time is 900 seconds (15 minutes)
SQLITE CREATE DATABASE TEST
OK
SQLITE INSERT TEST
OK

Initially I had MySQL, same problem, so now I'm trying with sqlite.

Any ideas perhaps? And where would I find the logging that izevar mentioned:

Gekko says:
--> POST /api/backtest 200 2,579ms 39.34kb
<-- POST /api/backtest
2018-03-24 10:17:51 (INFO): Setting up Gekko in backtest mode
2018-03-24 10:17:51 (INFO):
2018-03-24 10:17:51 (INFO): Setting up:
2018-03-24 10:17:51 (INFO): Trading Advisor

I'm running gekko --ui. (v0.6.8). Backtests in Gekko UI work fine.

Hopefully someone can help me :-)

Thanks!