Skip to content

Commit

Permalink
Merge pull request #29 from jackgillett101/fd_barrier_engines
Browse files Browse the repository at this point in the history
Adding FdBarrier engines
  • Loading branch information
nhaga committed Dec 21, 2020
2 parents 721662c + b1c1c96 commit d5a009a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/pricing_engines/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,40 @@ AnalyticBarrierEngine
analyticBarrierEngine = ql.AnalyticBarrierEngine(bsm)
FdBlackScholesBarrierEngine
---------------------------

.. function:: ql.FdBlackScholesBarrierEngine(process, tGrid=100, xGrid=100, dampingSteps=0, FdmSchemeDesc=ql.FdmSchemeDesc.Douglas(), localVol=False, illegalLocalVolOverwrite=None)

.. code-block:: python
today = ql.Date().todaysDate()
spotHandle = ql.QuoteHandle(ql.SimpleQuote(100))
flatRateTs = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.05, ql.Actual365Fixed()))
flatVolTs = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(today, ql.UnitedStates(), 0.2, ql.Actual365Fixed()))
bsm = ql.BlackScholesProcess(spotHandle, flatRateTs, flatVolTs)
fdBarrierEngine = ql.FdBlackScholesBarrierEngine(bsm)
FdBlackScholesRebateEngine
--------------------------

.. function:: ql.FdBlackScholesRebateEngine(process, tGrid=100, xGrid=100, dampingSteps=0, FdmSchemeDesc=ql.FdmSchemeDesc.Douglas(), localVol=False, illegalLocalVolOverwrite=None)

.. code-block:: python
today = ql.Date().todaysDate()
spotHandle = ql.QuoteHandle(ql.SimpleQuote(100))
flatRateTs = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.05, ql.Actual365Fixed()))
flatVolTs = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(today, ql.UnitedStates(), 0.2, ql.Actual365Fixed()))
bsm = ql.BlackScholesProcess(spotHandle, flatRateTs, flatVolTs)
fdRebateEngine = ql.FdBlackScholesRebateEngine(bsm)
AnalyticBinaryBarrierEngine
---------------------------

Expand Down

0 comments on commit d5a009a

Please sign in to comment.