Component 
Resolution  Swap Pricing 




Function Definition 
oSWPccy_Price(PricingFlags, Dates, PaymentFreq, CoupMarginPay, CoupMarginRcv, Notional, SpotRate, RatePay, RateRcv, ZeroCurvePay, ZeroCurveRcv, InterpMethod, AccrualBasis, BusinessDayConv, HolidaysPay, HolidaysRcv) Calculates the fair value for a currency swap. Also returns the accrued interest and the risk statistics. 




Swap Types 




Function Parameters 



Parameters 
Description 
Parameter Type 

Restrictions 

. 

PricingFlags 

Array of six Enumerated Constants: 

Array (of Enumerated Constants) 




ValueCurrency: Specifies whether the returned values are expressed in units of the pay leg currency or the receive leg currency. 



1  Pay 


PayLegType: Specifies whether the pay leg of the swap is fixed or floating. 



1  Fixed 


RecieveLegType: Specifies whether the receive leg of the swap is fixed or floating. 



1  Fixed 


DateGeneration: Determines if the rate reset cycle is computed backwards from the maturity date or forwards from the effective date. 



1  Maturity Date 


NotionalPayment: Defines the treatment of the notional payments from a valuation point of view. 



1  Notional Only 


OutputFlag: Indicates which result, or set of results, will be displayed in the worksheet. When returning more than one value, the function must be entered as an array function. Entering a 0 will output: Fair Value, Accrued Interest, Effective Duration, Modified Convexity, PVBP, and Par Swap Rate. Entering 1 or 2 will output Fair Value and Accrued Interest for the Pay and Receive Legs respectively. Entering a 5 will output: Effective Duration, Modified Convexity, and Price Value of a Basis Point. 



0  All Swap Values 
Dates 

Four dates entered as an array. 

Array (of Dates) 




ValuationDate: The valuation date of the swap. 



ValDate < SettleDate 


SettlementDate: The date on which the trade will settle. This is typically 13 business days after the trade. 



SettleDate < MatDate 


EffectiveDate: The start date of the swap. 



EffDate < MatDate 


MaturityDate: The maturity date of the swap. 



As above. 
PaymentFreq 

Array of two Enumerated Constants: 

Enumerated Constant, or an Array of Enumerated Constants 

If both frequencies are identical then enter a single Enumerated Constant. 
CoupMarginPay 

The margin, in basis points, that is added to each pay leg rate reset. If the pay leg is fixed then then set the margin to zero. 

Double 

CpnMarginDom >= 0 
CoupMarginRcv 

The margin, in basis points, that is added to each receive leg rate reset. If the receive leg is fixed then then set the margin to zero. 

Double 

CpnMarginFrn >= 0 
Notional 

Array of two doubles: Notional_Pay: The notional value of the pay leg. Notional_Receive: The notional value of the receive leg. If the legs have the same notional value then just enter a single double. 

Double, or an Array of Doubles 

Notional >= 0 
SpotRate 

The current exchange rate quoted directly (domestic/foreign). 

Double 

SpotRate >= 0 
RatePay 

The coupon rate if the pay leg is fixed, or the past reset rate if the pay leg is floating. 

Double 

RateDom >= 0 
RateRcv 

The coupon rate if the receive leg is fixed, or the past reset rate if the receive leg is floating. 

Double 

RateFrn >= 0 
ZeroCurvePay 

The zero curve that is used to discount and project cash flows for the pay leg. 

Curve 

Curve must be three columns. 
ZeroCurveRcv 

The zero curve that is used to discount and project cash flows for the receive leg. 

Curve 

Curve must be three columns. 
InterpMethod 

Method used to calculate rates and discount factors from the zero curves. 

Enumerated Constant 

1  Discount Factors 
AccrualBasis 

Array of two Enumerated Constants: AccrualBasis_Pay: Used to determine the length (in years) of each pay leg coupon period, which is used in turn to calculate the coupon amount and accrued interest for that period. AccrualBasis_Receive: Used to determine the length (in years) of each receive leg coupon period, which is used in turn to calculate the coupon amount and accrued interest for that period. If both conventions are identical then just enter a single Enumerated Constant.


Enumerated Constant, or an Array of Enumerated Constants 

1  Act/Act (actual) 
BusinessDayConv 

Array of two Enumerated Constants: BusinessDayCon_Pay: Used to determine the start and end date of each pay leg coupon payment period. BusinessDayCon_Receive: Used to determine the start and end date of each receive leg coupon payment period. 

Enumerated Constant, or an Array of Enumerated Constants 

1  No Adjustment 
HolidaysPay 

Schedule of nonbusiness days in the pay leg (excluding weekends). 

Curve 

Leave blank if not applicable 
HolidaysRcv 

Schedule of nonbusiness days in the receive leg (excluding weekends). 

Curve 

Leave blank if not applicable 
See Also 
Copyright 2013 Hedgebook Ltd.