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

asynchronous strategy update function, backward compatible #2801

Closed
wants to merge 1 commit into from

Conversation

massaroni
Copy link

  • 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;
}

@stale
Copy link

stale bot commented Aug 22, 2019

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.

@stale stale bot added the wontfix label Aug 22, 2019
@massaroni
Copy link
Author

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?

@stale stale bot removed the wontfix label Aug 22, 2019
@stale
Copy link

stale bot commented Nov 28, 2019

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.

@stale stale bot added the wontfix label Nov 28, 2019
@stale stale bot closed this Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants