Skip to content

Commit

Permalink
Adjusted README.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbywater committed Sep 19, 2017
1 parent fc7fe02 commit b125130
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ The basic steps in evaluating a model are:
* evaluation of the contract model.

A convenience function `calc_and_plot()` can be used to perform all the steps.

```python
from quantdsl.interfaces.calcandplot import calc_and_plot
```

Here's an evaluation of a gas storage facility.

```pyt hon
from quantdsl.interfaces.calcandplot import calc_and_plot


calc_and_plot(
title="Gas Storage",
source_code="""def GasStorage(start, end, commodity_name, quantity, target, limit, step, period):

source_code="""
def GasStorage(start, end, commodity_name, quantity, target, limit, step, period):
if ((start < end) and (limit > 0)):
if quantity <= 0:
return Wait(start, Choice(
Expand Down Expand Up @@ -104,11 +104,13 @@ def Inject(start, end, commodity_name, quantity, limit, step, period, target, vo
GasStorage(Date('2011-6-1'), Date('2011-9-1'), 'GAS', 0, 0, 50000, TimeDelta('1m'), 'monthly')
""",

observation_date='2011-1-1',
interest_rate=2.5,
path_count=20000,
perturbation_factor=0.01,
periodisation='monthly',

price_process={
'name': 'quantdsl.priceprocess.blackscholes.BlackScholesPriceProcess',
'market': ['GAS'],
Expand Down Expand Up @@ -153,6 +155,7 @@ Here's an evaluation of a power station.
```python
calc_and_plot(
title="Gas Storage",

source_code="""
def PowerStation(start, end, gas, power, duration_off):
if (start < end):
Expand Down Expand Up @@ -192,11 +195,13 @@ def Tomorrow(today):
PowerStation(Date('2012-01-01'), Date('2012-01-13'), Market('GAS'), Market('POWER'), Running())
""",

observation_date='2011-1-1',
interest_rate=2.5,
path_count=20000,
perturbation_factor=0.01,
periodisation='monthly',

price_process={
'name': 'quantdsl.priceprocess.blackscholes.BlackScholesPriceProcess',
'market': ['GAS', 'POWER'],
Expand Down

0 comments on commit b125130

Please sign in to comment.