Gekko: Strategy works when using UI, but not from console

Created on 25 May 2018  路  5Comments  路  Source: askmike/gekko

Note: this is the technical bug tracker, please use other platforms for getting support and starting a (non technical) discussion. See the getting help page for details.

I'm submitting a ...
[x ] bug report
[ ] question about the decisions made in the repository

Action taken (what you did)

I tried running a strategy ( which runs fine on UI ) from the console

Expected result (what you hoped would happen)

It would run

Actual result (unexpected outcome)

Gekko fails to start.

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)

2018-05-25 21:52:22 (INFO): Setting up Gekko in realtime mode
2018-05-25 21:52:22 (INFO):
2018-05-25 21:52:22 (INFO): Setting up:
2018-05-25 21:52:22 (INFO): Candle writer
2018-05-25 21:52:22 (INFO): Store candles in a database
2018-05-25 21:52:22 (INFO):

2018-05-25 21:52:22 (INFO): Setting up:
2018-05-25 21:52:22 (INFO): Trading Advisor
2018-05-25 21:52:22 (INFO): Calculate trading advice
2018-05-25 21:52:22 (INFO): Using the strategy: chroll
2018-05-25 21:52:22 (WARN): TALIB indicators could not be loaded, they will be unavailable.
C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\strategies\chroll.js:31
this.addTulipIndicator('maSlow', 'sma', { optInTimePeriod: this.settings.SMA_long });
^

TypeError: Cannot read property 'SMA_long' of undefined
at Base.init (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\strategies\chroll.js:31:81)
at Base.bound [as init] (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at new Base (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\plugins\tradingAdvisor\baseTradingMethod.js:87:8)
at Actor.setupTradingMethod (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\plugins\tradingAdvisor\tradingAdvisor.js:62:17)
at Actor.bound [as setupTradingMethod] (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at new Actor (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\plugins\tradingAdvisor\tradingAdvisor.js:23:8)
at load (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\core\pluginUtil.js:95:22)
at C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\node_modules\async\dist\async.js:1156:9
at replenish (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\node_modules\async\dist\async.js:1030:17)
at iterateeCallback (C:\Users\Vasilis\Desktop\ph\gekko-develop\gekko-develop\node_modules\async\dist\async.js:1015:17)

All 5 comments

how about a "copy and paste this into custom part of config.js" from the Strat runner page...... because i am having the same issue.
works in the web interface, but when i put it in the config doesn't work

You need to manually add an object in the config describing your parameters, when you are using the CLI interface Gekko ignores TOML files. If you still need help feel free to post your TOML file with strat parameter and the config file you pointed Gekko at.

how about a "copy and paste this into custom part of config.js"

Don't just copy it in: the UI uses TOML and the config only takes raw javascript.

@askmike Mike, thank you so much. I added my parameters in the config file, now it works perfectly.

@DrBlackross Thank you as well. Simple copy and paste did not work. The parametres need to be tweaked for raw js

Guys,
Should i create an object of the missing indicators or of the strategy itself? I tried both solutions.
Can please anyone post an example on how to add the strategy in the config file? I did mine, adding an object as askmike said, but not working yet after several attempts..., still getting this error:
this.addIndicator('maSlow', 'SMA', this.settings.SMA.long );
..dunno why... :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yacindou picture yacindou  路  3Comments

clownfish44 picture clownfish44  路  3Comments

gekkotrader picture gekkotrader  路  4Comments

prathanbomb picture prathanbomb  路  3Comments

burtnderson picture burtnderson  路  5Comments