Lot size calculation ... but it doesn't add up.
As we don't know how values for StopLoss and pips2points are represented, it's difficult to say, but possibly you are working with values based on points instead of a decimal
Lots = percent / ((StopLoss * pips2points) * CBtickvalue); //(StopLoss * pips2points) needs to be a decimal //ie if SL is 30 pips on EURUSD it should calculate to 0.00300
GumRai and WHRoeder thanks for your help.
WHRoeder, i believe part of my code was using some of the solutions you've kindly shared in this forum.
Hello all,
I attached my code below which is a mixture of codes found on this forum and an adaptation of the indicator from this page http://www.earnforex.com/position-size-calculator.
I'm using a 5 digits broker with 30 pips of Stoploss hence the Stoploss * pips2points. The account currency is USD.
Can anyone point me in the right direction?
Many thanks.