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

Work with FOREX but volume error with US500 #36

Open
mehmetcigerli opened this issue Jun 13, 2024 · 4 comments
Open

Work with FOREX but volume error with US500 #36

mehmetcigerli opened this issue Jun 13, 2024 · 4 comments

Comments

@mehmetcigerli
Copy link

Hello, thank you for the library.

I tried the lib with EURUSD which worked fine.

However I ran into this weird volume error with US500.

My code:
symbol = "US500"
volume = 0.1 # order size
price = api.quote()
price = np.round(price['US500']['bid'] + 0.002, 1)

id = api.buyLimit(symbol, volume, price)

And I received this as error.

ERROR:root:Order volume 10000.00 is bigger than maxVolume=100.00.

Which is not the volume I entered clearly.

Please help.

Thank you very much.

Copy link

We're glad you've opened your first issue. Please provide all the necessary details and any relevant code or screenshots to help us understand the problem better. Our team will review your issue and provide assistance as soon as possible. Thank you for contributing!

@traderpedroso
Copy link
Member

Hello, thank you for the library.

I tried the lib with EURUSD which worked fine.

However I ran into this weird volume error with US500.

My code: symbol = "US500" volume = 0.1 # order size price = api.quote() price = np.round(price['US500']['bid'] + 0.002, 1)

id = api.buyLimit(symbol, volume, price)

And I received this as error.

ERROR:root:Order volume 10000.00 is bigger than maxVolume=100.00.

Which is not the volume I entered clearly.

Please help.

Thank you very much.

digit point contract size 0.001

@amolc
Copy link

amolc commented Aug 4, 2024

HI, This error is because of it multiplying the volume with 10000 for forex calculation. Changing it in the main library fix.py I was able to solve the issue.

@traderpedroso
Copy link
Member

HI, This error is because of it multiplying the volume with 10000 for forex calculation. Changing it in the main library fix.py I was able to solve the issue.

As this project was focused on Forex, it presents these issues. However, if necessary, feel free to submit a pull request for changes. We appreciate your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants