Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic closing of the positions at the end of the simulation #343

Open
gaborvecsei opened this issue May 5, 2021 · 3 comments · May be fixed by #393
Open

Automatic closing of the positions at the end of the simulation #343

gaborvecsei opened this issue May 5, 2021 · 3 comments · May be fixed by #393
Labels
enhancement New feature or request Hacktoberfest https://hacktoberfest.digitalocean.com

Comments

@gaborvecsei
Copy link

This is just a question about whats in the title.

  • Why is the framework closing the positions automatically at the end of the simulation?
  • Is there any way to prevent that?
@kernc
Copy link
Owner

kernc commented May 5, 2021

Why is the framework closing the positions automatically at the end of the simulation?

So the trades can produce some stats. See #183, f77786e.

@gaborvecsei
Copy link
Author

So the trades can produce some stats. See #183, f77786e.

I understand that the unclosed trades wouldn't appearing in the final stats but that could be also a stat. E.g.:

  • still open positions
  • allocated money in those positions
  • return should be calculated only for the closed positions

Maybe a parameter like autoclose_open_positions in bt.run() would be useful, so people can decide if they want the feature or not.

I raised this question because the still open positions is also a good measure of a strategy. If the strategy fails to close the positions, this auto-closing can give the false feeling that the Strategy is working fine.

@replacementAI
Copy link

Still able to see open trades that are closed because they are the last ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest https://hacktoberfest.digitalocean.com
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants