please I want to calculate how many lots I can open

 
please I want to calculate how many lots I can open
for one EURUSD I can open 5 lots with 5,000 but for GBPUSD I can open 2.5 lots
anyboby can help me thank
please write code for me thank very much !
 
The following might be the thing, as I understand the documentation. Though I have not tested it.
/**
 * Returns how large a volume of a given symbol corresponds to a given balance in the
 * base currency (right now), rounded to 1 decimal.
 */
double lots(string symbol,double balance)
{
    return( NormalizeDouble( balance / MarketInfo( symbol, MODE_LOTS ), 1 ) );
}
Reason: