Closed massaroni closed 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me.
This feature would be super helpful if you need to hit a file, database, web service, ML service, etc, from within your strategy.
Anyone want to review this PR?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) New feature.
What is the current behavior? (You can also link to an open issue here) Strategy update function is strictly synchronous.
What is the new behavior (if this is a feature change)? Now, your strategy's update function can be asynchronous or synchronous. This uses a callback function, as per the convention in this project, and it's backward compatible with synchronous update functions.
Asynchronous update functions should return "true" to indicate that it's operating in asynchronous mode, and call the provided callback when it's done. For example:
update: function (candle, done) { setTimeout(() => { // do stuff done(); }); return true; }