How could I calculate the volume size? #26
Replies: 2 comments 2 replies
-
Sorry, but this is a question somewhat for Stack Overflow, but it's okay. The calculation must be based on the asset being traded. For example, assets with 5 digits after the decimal point, like EURUSD have a pip size of 0.0001. Whereas assets like XAUUSD have 2 digits after the decimal point, and the pip size is 0.01. def get_pip_size(pair):
if 'JPY' in pair.upper():
return 0.01
else:
return 0.0001 |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, my friend, but the API is already handling this. If you just want to add a specific size, for example, 0.10 on EURUSD, you just need to consult the documentation. This is the minimum effort required on your part. The code in the API is essentially doing the following operation: size = int(float(v_lots) * 100000). |
Beta Was this translation helpful? Give feedback.
-
I'm trying to calculate the volume size by a function i found in ctrade forum:
but now, i'm have this output:
ERROR:root:Order volume 100000000.00 is bigger than maxVolume=5000000.00
Has someone help. me in this step?
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions