Calculate Volume/Lot Size
Created at 12 Jul 2024, 11:51
GO
Calculate Volume/Lot Size
12 Jul 2024, 11:51
Hi, I am trying to calculate the volume according to the StopLoss in pips without the comission risking 1% of balance per trade with a 1:1 ratio. In theory it should work but the spread or something else alters the trade in backtesting. I guess that my function is wrong, someone can help me? Attached img:
public double CalculateVolume(double StopLossInPips, double Risk)
{
double VolumeGross = (Risk / (0.01 * StopLossInPips)) * InicialBalance;
double Volume = Math.Round(VolumeGross/100000, 2)*100000;
// double Comission = 4 * LotSize;
return Volume;
}