SinglePnLResult CalculateHedgePnLResult() { _tradingDataList.Sort(); bool bAmoutBasis = false; SinglePnLResult profitAndLossResult = new SinglePnLResult( HedgingInstKey, "EquityDeltaHedging", TradingDirection.Short, bAmoutBasis, _tradingDataList); if (EquityVolPredefinedVariables.BLogEnabled) { profitAndLossResult.EnableLog(); } profitAndLossResult.CalculatePnL(); return profitAndLossResult; }
Dictionary<MarketDataSetKey, IPnLResult> GetSelectedEquityPnLResults( Dictionary<MarketDataSetKey, IPnLResult> allEquityPnLResults, Dictionary<DateTime, List<MarketDataSetKey>> selectedEquities) { if (selectedEquities.Count == 0) { return allEquityPnLResults; } Dictionary<MarketDataSetKey, IPnLResult> selectedEquityPnLResults = new Dictionary<MarketDataSetKey, IPnLResult>(); foreach (KeyValuePair<MarketDataSetKey, IPnLResult> pair in allEquityPnLResults) { SinglePnLResult result = pair.Value as SinglePnLResult; List<RawTradingData> selectedTradingList = SelectTradingDataList(result.Key, result.TradingDataList, selectedEquities); if (selectedTradingList.Count == 0) { continue; } SinglePnLResult selectedResult = new SinglePnLResult(result.Key, result.Name, result.Direction, true, selectedTradingList); selectedResult.CostRate = EquityVolPredefinedVariables.CostRate; if (EquityVolPredefinedVariables.BLogEnabled) { selectedResult.EnableLog(); } selectedResult.CalculatePnL(); selectedEquityPnLResults.Add(pair.Key, selectedResult); } return selectedEquityPnLResults; }