Lot Size Formula Help

 

Hi Guys

im using this to calculate my lot size,any one know why this set a big lot size on mini account??

double lots = AccountFreeMargin() * Risk/100 / ( StopLoss* MarketInfo( Symbol(), MODE_TICKVALUE ) );

I want to calculate lot size by using stoploss and risk parameters

Plz some Advise

Best Regards

 
kimitrio wrote >>

Hi Guys

im using this to calculate my lot size,any one know why this set a big lot size on mini account??

I want to calculate lot size by using stoploss and risk parameters

Plz some Advise

Best Regards

double l=LotMin;
   double r=AccountBalance()/100*RiskPercent;
   double t=MarketInfo(Symbol(),MODE_TICKVALUE);   
   l=r/(t*RiskPoints);   

while LotMin is in my case an external variable (extern double LotMin=0.5 f.e.)

RiskPercent is an external variable (extern double RiskPercent=1.5) and

RiskPoints is the StopLoss in Points.

l returns you the new OrderSize.

In my case this formula is working also in micro-account, but dont forget to check if you have enough margin free for the new Ordersize, otherwise reduce!

 
EADeveloper:

while LotMin is in my case an external variable (extern double LotMin=0.5 f.e.)

RiskPercent is an external variable (extern double RiskPercent=1.5) and

RiskPoints is the StopLoss in Points.

l returns you the new OrderSize.

In my case this formula is working also in micro-account, but dont forget to check if you have enough margin free for the new Ordersize, otherwise reduce!

Thank you very much,i will test it now,to see how this one works, Thanks bro