hootnot / oandapyV20-examples

Examples demonstrating the use of oandapyV20 (oanda-api-v20)
MIT License
147 stars 65 forks source link

Question -Can you execute trades based on margin or is there a way to convert margin into units for different assets? #29

Closed ScuzzyHoulihan closed 1 year ago

ScuzzyHoulihan commented 2 years ago

Is there any way to set a certain amount of margin to open a position so you don't have to calculate the units? Hope this question makes sense. Let me know if you have any recommendation.

Example: I want to use only 1% margin but want to buy a higher priced item and then short another asset with 1% margin of my total margin. It would take time to calculate between the two assets. Trying to keep both positions equal for my use case. Decimals would have to be rounded.

hootnot commented 2 years ago

Hi, sorry for the late response (was on holiday)

With the example you gave, I think you need to do calculations yourself.