What formula is VolumeForProportionalRisk using?
Created at 21 Apr 2023, 15:16
CO
What formula is VolumeForProportionalRisk using?
21 Apr 2023, 15:16
Good afternoon
Can you share the formula behind VolumeForProportionalRisk please?
Previously in my cBots I have used the following code...
symbol.NormalizeVolumeInUnits(riskPercentage / (Math.Abs(stopLossInPips) * symbol.PipValue / accountBalance * 100));
...But I have noticed that this isn't generally giving the same volume as VolumeForProportionalRisk. Sometimes not even close!
For example:
riskPercentage = 1
stopLossInPips = 123.1
PipValue = , 0.00008301235
Balance = 100,000 GBP
Symbol: NZDUSD
My code returns: 97,000
VolumeForProportionalRisk returns 133,000
Any reason why this might be?
Thanks
Marcus