Automated load of talib and tulind if available locally#1344
Automated load of talib and tulind if available locally#1344askmike merged 6 commits intoaskmike:developfrom cmroche:auto_indicators
Conversation
|
I've tested various combinations of having talib and tulind loaded, and trying to run indicators from those modules. |
|
Loving the idea, though I think stuff like this will break / not work correctly anymore: gekko/plugins/tradingAdvisor/baseTradingMethod.js Lines 10 to 14 in c86ce48 |
|
If you also think we need to catch these situations before applying to PR let me know and I can do it as well :) |
cmroche
left a comment
There was a problem hiding this comment.
Didn't realize I also had to click submit review
| var mode = util.gekkoMode(); | ||
| var startTime = util.getStartTime(); | ||
|
|
||
| if(config.tradingAdvisor.talib.enabled) { |
There was a problem hiding this comment.
@askmike I believe this is the code you are referring to? I've already remove the old check and wrapped them around with the new approach. Is that what you mean?
|
Apologies, you are very right! Thanks a ton :) |
Feature
Users were required to modify configuration files to enable or disable TALIB or TULIP INDICATORS as well as using NPM to manage their installation.
Removed the need to modify config files to indicate the presence of TALIB and TULIND, instead their presence is detected automatically and they are loaded when available. This bring module management down to NPM installation.
Was a bit of a thorn in switching between my active branches, and branches used for development, to ensure that all configuration files for test processes were using the correct settings.
Since there isn't any real cost to loading the indicator modules when unneeded, or a likely source of harm, and users can easily control their presence through NPM, this change seems like it will facilitate configuration for all users.
The core/talib.js and core/tulind.js scripts now detect when the libraries are missing by catching the exception thrown by require and export a null module, this is then used to validate if the indicators are available. If they are not an warning is printed to indicate that the indicators will not be available and execution resumes normally.