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

Option to limit order size/exposure #3

Open
adrianmiu opened this issue Apr 29, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@adrianmiu
Copy link

commented Apr 29, 2019

Is there a way to place orders that are limited in size?

I'm working on a Forex strategy where I want to specify the size of the order based on the SL/TP levels provided by a prediction model. Your library mentions that the Strategy.buy/sell methods use "all available funds" which cannot be used in this case.

Thank you!

@kernc kernc added the enhancement label Apr 30, 2019

@kernc

This comment has been minimized.

Copy link
Owner

commented Apr 30, 2019

Would you like to try to make a PR for it? I think API-wise, something like this might work?

Strategy.buy(..., size: float = 1)  # percentage of cash
@adrianmiu

This comment has been minimized.

Copy link
Author

commented Apr 30, 2019

I would if I were a python programmer. Unfortunately I'm just hacking around... started playing with python a month ago. With that being said, it is an interesting challenge but I won't make any promise :)

@kernc kernc added the help wanted label May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.