Skip to content

Option to limit order size/exposure #3

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

Closed
adrianmiu opened this issue Apr 29, 2019 · 5 comments · Fixed by #47
Closed

Option to limit order size/exposure #3

adrianmiu opened this issue Apr 29, 2019 · 5 comments · Fixed by #47
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@adrianmiu
Copy link

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 New feature or request label Apr 30, 2019
@kernc
Copy link
Owner

kernc 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
Copy link
Author

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 Extra attention is needed label May 3, 2019
@Pk13055
Copy link

Pk13055 commented Jun 25, 2019

I have monkey patched the code to make it work with variable position sizing. I will clean it up and submit a PR.

@kernc
Copy link
Owner

kernc commented Jul 3, 2019

@Pk13055 If you find time, I'd appreciate it! I know I've been looking into it briefly, and it seemed harder than I was willing to handle at the time. 😅

@algomaschine
Copy link

Gents, I'm also working with FOREX markets and also with leverage of 1:100 and up. Usually my position size is estimated in so called Lots (100k USD), the money management would be 0.1 Lots per 1000 USD balance. Could you please advise on how to simulate this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants