View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul S[_5_] Paul S[_5_] is offline
external usenet poster
 
Posts: 7
Default HELP NEEDED - Iterative process in a VBA function

Hi Everybody,


I am trying to define a function that calculates a forward price, this
should be an iterative process and unfortunately I am not able to
properly define the required loop.

The function shown below performs the required calculation but it
should be repeated until the LOAN_AMOUNT + FPA_COST equals the
SETTLEMENT_AMOUNT. I have made the calculation manually in Excel and
the price is normally found in 3 to 5 steps.

Would anyone be able to define the required loop?

Many thanks in advance!,

Paul

---------------------------------

Function FPA_price(fraction, loan_amount, spot_price, coupon,
risk_free_rate, commision)

Dim bond_amount As Double
Dim fpa_cost As Double
Dim settlement_amount As Double

bond_amount = Round(loan_amount / (spot_price / 100), 0)
fpa_cost = (bond_amount * fraction * coupon / 4) - (loan_amount *
fraction * risk_free_rate / 4) + commision
settlement_amount = loan_amount - fpa_cost

FPA_price = Round(settlement_amount / bond_amount * 100, 6)

End Function