Disliked{quote} Gorraf thank you very much for your help! The script is not calculating the lot size corectly yet. When the total amout of capital is low, like 15 dolars, and I set the risk to 5% the script doesn't open the operation. And when it gets higher than 48.18 lots he doesnt operate too. Here is the code: Lots=((AccountBalance()/100)*RiskPercent)/(MarketInfo(Symbol(),MODE_MINLOT)*MarketInfo(Symbol(),MODE_LOTSIZE)); Can you help me?Ignored
Use this line instead:
Inserted Code
Lots=MathFloor(((AccountEquity()/100)*RiskPercent)/(MarketInfo(Symbol(),MODE_MARGINREQUIRED)*MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);