Lotsize computation

 

Noob question here guys.


int fund = 1000;

int risk = 5;

int SL = 800;


double lotsize = (fund * risk * 0.01) / SL);


The output is showing: 0.0625, how can I make it that it will only produce 0.06 or just 2 decimal places?


thank you

 
nsamaniego:

Noob question here guys.


int fund = 1000;

int risk = 5;

int SL = 800;


double lotsize = (fund * risk * 0.01) / SL);


The output is showing: 0.0625, how can I make it that it will only produce 0.06 or just 2 decimal places?


thank you

  • Get the Volume Minimum of the traded asset
  • Find its digits 
  • Apply these digits on the lot you calculated

Things to consider : 

  • You have calculated how much are you risking per "point" in your equation .You may need to factor in how much one lot costs per point in the asset to find the actual volume that is going to get you this risk level.
  • You must factor in the Volume Step as well (for some assets you cant trade 0.25 and then 0.26 ,but 0.50 )