예제 #1
0
 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;
 }
예제 #2
0
        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;
        }