- double iLotsOptimized(double myFunds, double myCapitalRisk)
- {
- double myMargin = myFunds * myCapitalRisk / 100 - AccountMargin();
- double myLots = myMargin * AccountLeverage() / MarketInfo(Symbol(), MODE_LOTSIZE) / (MarketInfo(Symbol(), MODE_MARGINREQUIRED) * 2);
- myLots = MathRound(myLots / MarketInfo(Symbol(), MODE_MINLOT)) * MarketInfo(Symbol(), MODE_MINLOT);
- if(myLots <= 0)
- {
- myLots = 0;
- }
- return(myLots);
- }
复制代码
|