Beispiel #1
0
        public static double GetBlsDelta(PayOffType type, double curPrice, double strikePrice, double tYear, double TYear, double volYear, double rfYear)
        {
            double d1 = (Math.Log(curPrice / strikePrice)
                + (rfYear + volYear * volYear / 2) * (TYear - tYear)) / (volYear * Math.Sqrt(TYear - tYear));
            //double d2 = d1 - vol * Math.Sqrt(T - t);

            double delta = 0.5;
            // Call 매도 포지션 델타
            if(type == PayOffType.LongCall)
            {
                delta = GetNormalCdf(d1);
            }
            else if (type == PayOffType.LongPut)
            {
                delta = GetNormalCdf(d1) - 1;
            }
            else if (type == PayOffType.ShortCall)
            {
                delta = -1 * GetNormalCdf(d1);
            }
            else if (type == PayOffType.ShortPut)
            {
                delta = 1 - GetNormalCdf(d1);
            }

            return delta;
        }
Beispiel #2
0
 public European(
     double strike,
     PayOffType type)
 {
     Strike = strike;
     if (type == PayOffType.Call)
     {
         CallPut = 1.0;
     }
     else if (type == PayOffType.Put)
     {
         CallPut = -1.0;
     }
 }
        public IndividualTradingSimulator(MarketDataSetKey key, double baseInvest, TradingDirection direction,  
            PayOffType payOffType, double strikePriceDiffRate, int livePeriod, double impliedVol, 
            bool bAmountBasis, List<PriceData> prices)
        {
            _key = key;
            _baseInvest = baseInvest;
            _direction = direction;
            _payoffType = payOffType;
            _strikePriceDiffRate = strikePriceDiffRate;
            _livePeriod = livePeriod;
            _impliedVol = impliedVol;
            _bAmountBasis = bAmountBasis;

            _priceDataList = prices;
            _bUseReturnModel = false;
        }