namespace KLHZ.Trader.Core.Exchange.Utils { internal static class TradingCalculator { public static decimal CaclProfit(decimal openPrice, decimal closePrice, decimal comission, decimal leverage, bool isShort) { var diff = ((isShort ? (closePrice - openPrice) : (openPrice - closePrice)) - closePrice * comission - openPrice * comission) * leverage; return diff; } } }