Example #1
0
 public void Add(DateTime dt, AssetWeight aw)
 {
     _data.Add(dt, aw);
     UpdateStartEndDate(dt);
 }
Example #2
0
 public AssetWeight CalculateAssetWeight(DateTime targetDate, MarketDataSet data)
 {
     //공평하게 0.33씩 나누어서 투자한다.
     AssetWeight aw = new AssetWeight(this.KospiWeight, this.BondWeight, this.DollarWeight);
     return aw;
 }
Example #3
0
 public void Sum(AssetWeight input)
 {
     this.KospiWeight += input.KospiWeight;
     this.BondWeight += input.BondWeight;
     this.DollarWeight += input.DollarWeight;
 }
        Tuple<double, double, double, double> GetDailyPnL(
            AssetWeight aw, DateTime prevDate, DateTime curDate, long notional, MarketDataSet marketDataSet)
        {
            MarketData mdKospi = marketDataSet.GetData(MarketDataSetKey.KospiFuture);
            MarketData mdBond = marketDataSet.GetData(MarketDataSetKey.KtbFuture);
            MarketData mdDollar = marketDataSet.GetData(MarketDataSetKey.DollarFuture);

            double kospiUpDoweRate = GetUpDownRate(mdKospi, prevDate, curDate);
            double bondUpDoweRate = GetUpDownRate(mdBond, prevDate, curDate);
            double dollarUpDoweRate = GetUpDownRate(mdDollar, prevDate, curDate);

            double kospiPnL = aw.KospiWeight * notional * kospiUpDoweRate;
            double bondPnL = aw.BondWeight * notional * bondUpDoweRate;
            double dollarPnL = aw.DollarWeight * notional * dollarUpDoweRate;
            double sum = kospiPnL + bondPnL + dollarPnL;

            return new Tuple<double, double, double, double>(sum, kospiPnL, bondPnL, dollarPnL);
        }
Example #5
0
 public void Multiply(AssetWeight input)
 {
     this.KospiWeight *= input.KospiWeight;
     this.BondWeight *= input.BondWeight;
     this.DollarWeight *= input.DollarWeight;
 }