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 summComission = closePrice * comission + openPrice * comission; var priceDiff = closePrice - openPrice; if (isShort) { priceDiff *= -1; } var diff = priceDiff * leverage - summComission; return diff; } } }