1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ブラウザ上でオプション理論価格計算&複合ポジのグラフ描画

Last updated at Posted at 2019-02-03

#簡単な使い方

  1. ブラウザで⇒アクセス Gooogle colabo のページ
  2. (パラメータ変更して)実行ボタンを押す

bata.JPG


##パラメータ変更例1:


# 3月限ショートストラングル
p = Portfolio(
"""
	03/C21000[-1]
	03/P20000[-1]
""")

#マーケット情報設定書式
#setting(原資産価格, IV(%), 日付【yyyymmdd】)   
setting(20250, 25, 20190204)    


##内部の概略
Quantlibからよく使われるブラックショールズ式を簡単に呼び出せるラッパークラスを作成。

##インストールする場合


pip install simple_option

##主なクラス
Portfolio
Option
Payoff

###クラス利用例:


Example1
---------
from simpleOption import *
#Simple Example
o = Option('02/P20500')
op_price = o.v(20625, 20.8, 20190124)
print(f"{o}@{op_price:.2f}  (nk=20625,IV=20.8%)  jan24 ")
OUTPUT 1
---------
02/P20500@285.49  (nk=20625,IV=20.8%)  jan24
Example2
---------
#underlying change: 20625 >>20500
op_price2 = o.v(20500)
print(f"{o}@{op_price2:.2f} (nk=20500,IV=20.8%)  jan24")
OUTPUT 2
---------
02/P20500@285.49  (nk=20625,IV=20.8%)  jan24
Example3
---------
#underlying & IV change: 20625>>20000 &IV=25%
op_price3 = o.v(20000, 25)
print(f"{o}@{op_price3:.2f} (nk=20000,IV=25%)  jan24")
OUTPUT 3
---------
02/P20500@703.62 (nk=20000,IV=25%)  jan24
Example4
---------
#use keyword
op = Option('02/P20500')
op_price4 = op(
    underlying=20250,
    iv=25,
    evaluationDate=20190122
)
"""


1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?