View Single Post
  #2 (permalink)  
Old 03-01-2007, 10:13 PM
jkancil's Avatar
jkancil jkancil is offline
Freshman
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jkancil is on a distinguished road
Default

extern int RiskFactor = 2.0; //Percent
extern double Lots = 0.1; //Manual Lots if Risk Factor=0

double lot_size() {
double lots;
double LotSize = MarketInfo(Symbol(), MODE_LOTSIZE);
double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
if (RiskFactor==0) return (Lots);
lots = (AccountFreeMargin()* AccountLeverage() / LotSize) * RiskFactor/100.0;
if (lots < MinLot) lots = MinLot;
lots /= LotStep;
lots = NormalizeDouble(lots, 0);
lots *= LotStep;
return(lots);
}

Last edited by jkancil : 03-01-2007 at 10:16 PM.
Reply With Quote

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast