public static double TradingSize(double size, int bar)
{
if (Strategy.UseAccountPercentEntry)
{
double maxMargin = session[bar].Summary.MoneyEquity * size / 100.0;
double exchangeRate = Close[bar] / AccountExchangeRate(Close[bar]);
size = maxMargin * Configs.Leverage / (exchangeRate * InstrProperties.LotSize);
}
size = NormalizeEntryLots(size);
return size;
}