Forex_Strategy_Builder.Backtester.TradingSize C# (CSharp) Метод

TradingSize() публичный статический Метод

Calculates the trading size in normalized lots.
public static TradingSize ( double size, int bar ) : double
size double
bar int
Результат double
        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;
        }