i want to calculate my position size, depending on the % of my capital I want to risk. So in other works, I want to create a user input/variable where I can specify % risk.
Depending on the currency pair in Forex, the pip size will differ.
When an order is sent I want to have the code look at the:
currency pair selected
calculate its pip size (USD per pip)
use the stop loss pip size for that trade and then calculate the position size
Obviously some exchanges only allow you to enter sizes of 100, 1000, 10000, 100000, so the calculation must round the position size to the nearest 1000.
This value must then be used as a variable to enter a trade.
Can someone assist with the necessary code for this, or even better through the strategy builder?
regards
Jacques
Comment