Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.

Automated load of talib and tulind if available locally#1344

Merged
askmike merged 6 commits intoaskmike:developfrom
cmroche:auto_indicators
Dec 6, 2017
Merged

Automated load of talib and tulind if available locally#1344
askmike merged 6 commits intoaskmike:developfrom
cmroche:auto_indicators

Conversation

@cmroche
Copy link
Contributor

@cmroche cmroche commented Nov 19, 2017

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature

  • What is the current behavior? (You can also link to an open issue here)

Users were required to modify configuration files to enable or disable TALIB or TULIP INDICATORS as well as using NPM to manage their installation.

  • What is the new behavior (if this is a feature change)?

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.

  • Other information:

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.

@cmroche
Copy link
Contributor Author

cmroche commented Nov 19, 2017

I've tested various combinations of having talib and tulind loaded, and trying to run indicators from those modules.

@askmike
Copy link
Owner

askmike commented Dec 4, 2017

Loving the idea, though I think stuff like this will break / not work correctly anymore:

var startTime = util.getStartTime();
if(config.tradingAdvisor.talib.enabled) {
// verify talib is installed properly
var pluginHelper = require(dirs.core + 'pluginUtil');

@askmike
Copy link
Owner

askmike commented Dec 4, 2017

If you also think we need to catch these situations before applying to PR let me know and I can do it as well :)

Copy link
Contributor Author

@cmroche cmroche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realize I also had to click submit review

var mode = util.gekkoMode();
var startTime = util.getStartTime();

if(config.tradingAdvisor.talib.enabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

@askmike
Copy link
Owner

askmike commented Dec 6, 2017

Apologies, you are very right! Thanks a ton :)

@askmike askmike merged commit 8c0c53b into askmike:develop Dec 6, 2017
@cmroche cmroche deleted the auto_indicators branch December 9, 2017 00:08
@askmike askmike mentioned this pull request Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants