Kalkulator stokanku kalkulator kalkulator hitam kalkulator


Kalkulator Pilihan ini telah dirancang agar siapapun, mulai dari pedagang pemula hingga pedagang opsi lanjutan, bisa langsung mulai menggunakannya. Contoh terstruktur berikut disediakan untuk Anda mulai. Bagian DEFINISI dicapai dengan menggulir ke bawah. Option Calculator paling baik dilihat pada resolusi layar minimal 800 x 600 piksel. Jika Anda tidak dapat melihat seluruh kalkulator di layar, resolusi pada layar Anda diatur pada 640 x 480 piksel. INSTRUKSI Tidak perlu berjuang mencari semua parameter masukan pilihan yang sesuai dengan Kalkulator Pilihan IVolatilitas. Itu karena IVolatility telah membebaskan Anda dari beban ini dengan menyederhanakan proses input. Apa yang telah kita lakukan adalah mendesain kalkulator sehingga semua nilai input yang dibutuhkan untuk harga suatu pilihan ditentukan terlebih dahulu dari database lengkap kita dan kemudian muncul di layar Anda kapan pun Anda mengetikkan saham atau pilihan pilihan Anda dan klik tombol GO . Begitu tombol GO diklik, Kalkulator Pilihan hanya mengetuk basis data pilihan yang tidak fleksibel dan kemudian memasukkan harga saham, tingkat bunga, dividen yang sesuai (jika ada) dan jadwal pembayaran mereka untuk saham atau opsi tersebut. Jika sebuah saham dipanggil naik, maka secara otomatis akan menampilkan bulan pilihan yang paling dekat dengan kadaluarsa dan seri (pc), yang paling dekat dengan harga di-the-money. MEMBUAT PERUBAHAN Untuk mengganti nilai atau melakukan perubahan, Anda dapat (1) menyorot nilainya dan kemudian mengetikkan nilai baru, (2) klik pada kotak drop-down dan buat pilihan atau (3) klik pada kenaikan Panah dan toggle ke nilai yang sesuai. Dengan membuat perubahan pada pilihan, Anda dapat membuat analisis apa-sendiri. Bergantung pada apa yang Anda pikir bisa terjadi, Anda dapat mengubah pilihan gaya, harga saham, pemogokan opsi, tanggal kedaluwarsa, hari-hari menjelang kadaluarsa, Volatilitas, tingkat suku bunga dan akhirnya Anda dapat mengubah jumlah dividen dan jadwal pembayaran. Dari dividen. Setelah Anda membuat penyesuaian, Anda dapat menentukan opsi nilai baru dengan mengklik tombol PERHITUNGAN di atas. Anda hanya menggunakan tombol kalkulasi bawah setiap kali Anda ingin melihat tingkat Volatilitas tersirat sesuai dengan harga opsi baru yang dimasukkan di sebelahnya. Untuk RESET semua nilai kembali ke nilai default dan hapus semua nilai yang dihitung cukup klik tombol GO lagi. CONTOH KERJA LANGKAH 1 (Simbol Saham atau Simbol Indeks, Simbol Opsi atau Bantuan): Setelah Anda memiliki simbol, Anda dapat menggunakannya untuk melihat harga saham dan pilihan uang paling cepat kedepan. Misalnya ketik MSFT dan klik tombol Go pilih Stock Symbol atau Index Symbol dari menu dropdown. Opsi di-the-money terdekat untuk Microsoft akan muncul. Ingat jika Anda tidak tahu nama saham, simbol saham atau opsi, Anda sekarang dapat mencarinya dengan cepat dan mudah dengan menggunakan namanya, simbol, akar pilihannya atau rangkaian opsi penuhnya dengan menggunakan Symbol lookup di bagian atas halaman. Begitu anda masuk ke Stock Symbol, Option Symbol atau option root cukup klik tombol GO untuk mendapatkan harga opsi. Namun, jika Anda butuh bantuan maka klik pada link Help Calculators. Contoh: Contoh Stock-Microsoft: Symbol-MSFT CHOOSE - Stock Symbol atau Index Symbol lalu ketik MSFT dan kemudian klik tombol GO LANGKAH 2 (Gaya Amerika vs Eropa): Pilihan pilihan harga berikutnya yang perlu Anda lakukan adalah apakah akan Harga opsi sebagai pilihan tipe Style atau Gaya Amerika. Inilah perbedaan antara keduanya. GAYA AMERIKA: Semua opsi saham yang terdaftar untuk diperdagangkan di bursa opsi di Amerika Serikat adalah pilihan gaya Amerika. Ini berarti bahwa opsi tersebut dapat dilakukan kapan saja sebelum kadaluarsa. Kemampuan latihan awal ini diperhitungkan dalam penentuan harga opsi. Ada beberapa pilihan indeks yang bergaya Amerika dan Anda harus mengecek spesifikasi produk yang diberikan oleh bursa untuk informasi ini. Kalkulator Opsi ini menggunakan model binomial dengan 100 langkah untuk menciptakan harga teoritis untuk pilihan gaya Amerika. GAYA EROPA: Sebagian besar (tapi tidak semua) pilihan indeks yang terdaftar untuk perdagangan di bursa opsi di Amerika Serikat adalah pilihan gaya Eropa. Ini berarti opsi itu bisa dilakukan hanya pada hari terakhir perdagangan sebelum kadaluarsa. Ketidakmampuan untuk berolahraga sampai kadaluwarsa diperhitungkan dalam penetapan harga opsi. Kalkulator pilihan ini menggunakan model Black-Scholes untuk pilihan gaya Eropa. LANGKAH 3 (Harga): Harga yang ditampilkan adalah harga penutupan malam terakhir. Jika Anda ingin mengubahnya menjadi todays harga saat ini atau harga lainnya cukup masukkan harga yang anda inginkan. Perhatikan bahwa harga harus dimasukkan dalam format desimal (misal 105,25) LANGKAH 4 (Mogok): Harga strike dari opsi yang ditunjukkan dapat diubah. Defaultnya adalah pemogokan di uang. Panah atas dan bawah di sebelah kanan kotak STRIKE dapat digunakan untuk memindahkan harga strike secara bertahap. Untuk pemogokan di bawah 50 kenaikannya adalah 2,5 poin. Untuk pemogokan di atas 50 dan di bawah 200 interval adalah 5 poin. Untuk pemogokan di atas 200 interval adalah 10 poin. Anda juga bisa mengganti harga STRIKE secara manual dengan strike yang Anda inginkan. LANGKAH 5 (Kadaluarsa): Pilih bulan kedaluwarsa (sistem menghitung jumlah hari dengan kadaluarsa secara otomatis) atau ubah jumlah hari kadaluarsa ke nomor yang Anda pilih. Nilai default adalah bulan kedaluwarsa sekarang dan dapat diubah dengan Toggling panah atas atau bawah di sebelah kanan kotak. LANGKAH 6 (Volatilitas): Nilai default diturunkan secara otomatis dari database. Namun demikian, Volatilitas default berasal dari malam terakhir yang tersirat Volatilitas untuk seri opsi put dan call tertentu. Anda dapat mengubah Volatilitas dengan memasukkan nilai lain yang Anda inginkan. Lihat bagian Definisi untuk pembahasan Volatilitas yang lebih lengkap dan bagaimana jumlah ini ditentukan. LANGKAH 7 (Suku Bunga): Nilai default diturunkan secara otomatis dari database. Namun demikian, suku bunga bebas risiko default berasal dari pasar treasury malam terakhir dan merupakan tingkat yang setara dengan opsi kedaluwarsa. Anda dapat mengubah tingkat suku bunga dengan memasukkan nilai lain yang Anda inginkan. LANGKAH 8 (Jumlah Dividen, Tanggal amp Frekuensi): Tergantung pada apakah saham membayar dividen atau tidak bagian ini mungkin atau mungkin tidak berisi data. Jika ada data di dalam kolom Anda dapat mengubahnya hanya dengan menambahkan jumlah dividen dan kapan mereka akan dibayarkan ke kolom. Kalkulator Pilihan kemudian akan memberi harga sesuai pilihan. Jangan gunakan tanda dolar untuk jumlah dividen. LANGKAH 9 (Perhitungan): Anda sekarang siap untuk menghitung panggilan dan memasukkan harga untuk opsi ini. Kami dapat memverifikasi bahwa Anda memahami bagaimana membuat perubahan pada semua masukan dengan membuat satu perubahan terakhir. Ingat bahwa sistem secara otomatis memperbarui perbedaan antara tanggal hari ini dan berakhirnya opsi. Untuk mengunggah fitur otomatis ini, mari kita ketik 35 pada hari ke bidang kedaluwarsa. Dengan cara ini kita semua akan menentukan harga opsi ini dengan parameter yang sama. Setelah Anda melakukan ini, klik tombol RAHASIA atas dan harga opsi akan dihitung dari semua nilai yang digunakan di atas. Harga yang harus Anda dapatkan jika Anda telah melakukan penyesuaian di atas adalah 5.8473 untuk panggilan dan 10.0017 untuk penempatan. Orang-orang Yunani dihitung bersamaan dengan harga opsi. Orang Yunani (Delta, Gamma, Theta, Vega dan Rho) adalah nilai matematis yang mengukur sensitivitas opsi harga terhadap perubahan stok, waktu, Volatilitas dan tingkat suku bunga - lihat DEFINISI. Kalkulator ini memungkinkan Anda untuk melihat perhitungan Theta satu hari. Namun, Anda bisa menghitung jumlah peluruhan theta dengan mengubah hari kadaluwarsa. Misalnya jika Anda ingin menghitung biaya peluruhan waktu yang terkait dengan waktu 10 hari dari waktu Anda akan mengurangi secara sederhana 10 hari dari pilihan waktu sampai kadaluwarsa dan kemudian membandingkan harga opsi tersebut dengan harga opsi asli. LANGKAH 10 (VOLATILITAS TERSIRAT) Dengan tetap memegang semua variabel dalam model penetapan harga opsi kecuali Volatilitas, pengguna dapat memasukkan harga alternatif untuk opsi panggilan atau opsi put untuk melihat Volatilitas yang harus digunakan untuk menciptakan harga opsi tersebut. Volatilitas ini disebut Volatilitas tersirat - lihat DEFINISI. Volatilitas tersirat dihitung sebagai berikut: Masukkan harga opsi. Harga ini bisa menjadi harga teoritis atau yang langsung diamati dari pasar pilihan dimana opsi diperdagangkan. Klik tombol PERHITUNGAN bawah dan Volatilitas tersirat akan ditampilkan. OPSI AMERIKA-STYLE Sebuah put atau panggilan yang bisa dilakukan kapanpun sebelum kadaluarsa. Sebagian besar opsi saham terdaftar, termasuk bursa luar negeri, adalah gaya Amerika. CALL Opsi dimana pemegang memiliki hak namun tidak berkewajiban untuk membeli keamanan yang mendasarinya dengan harga strike tertentu untuk waktu yang terbatas. HARI KE EXPIRATION Jumlah hari yang tersisa dalam kehidupan pilihan sebelum kadaluarsa dan menjadi tidak berharga atau dilakukan dan sama dengan nilai intrinsiknya. OPSI EROPA-STYLE Sebuah put atau panggilan yang hanya bisa dilakukan pada tanggal kadaluwarsa. Sejumlah pilihan gaya Eropa telah diperkenalkan dalam beberapa tahun terakhir, terutama pada indeks saham dan opsi mata uang. Salah satu pilihan gaya Eropa yang paling menonjol adalah Indeks Sampp 500 (SPX). EXPIRATION Tanggal dimana opsi berakhir atau menjadi batal. Tanggal kedaluwarsa untuk opsi saham yang terdaftar adalah hari Sabtu setelah Jumat ketiga bulan kedaluwarsa. Pemegang opsi yang berniat menggunakan opsi dengan kadaluarsa harus memberikan instruksi latihan ke perusahaan pialangnya sebelum perusahaan memotong waktu untuk menerima instruksi latihan pada hari perdagangan terakhir sebelum kadaluarsa. YUNANI Sebuah surat Yunani menunjuk sebuah pilihan kepekaan terhadap jenis gerakan tertentu. Contohnya meliputi Delta, Gamma, Theta, Vega, Rho dan Alpha - semuanya diidentifikasi oleh ejaan bahasa Inggris dari huruf Yunani masing-masing. DELTA Jumlah harga opsi akan berubah untuk perubahan satu poin yang sesuai dengan harga keamanan yang mendasarinya. GAMMA Perubahan delta dibagi dengan perubahan dolar dalam harga harga keamanan yang mendasarinya. Ini adalah pengukuran tingkat perubahan harga opsi sehubungan dengan harga yang mendasarinya. THETA Ukuran berapa banyak harga opsi meluruh dari waktu ke waktu dengan harga keamanan yang mendasarinya dan Volatilitas tersirat tetap tidak berubah. VEGA Ukuran perubahan harga opsi sebagai respons terhadap perubahan persentase poin dalam Volatilitas. RHO Ukuran perubahan harga opsi sebagai respons terhadap perubahan persentase pada tingkat bunga bebas risiko. Alpha ALPHA adalah rasio Gamma di atas Theta. Jadi Alpha menunjukkan nilai relatif dari memiliki gamma relatif terhadap tingkat theta saat ini. Alpha telah digambarkan sebagai ledakan untuk ukuran buck Anda. Ini adalah ukuran yang memungkinkan perbandingan beberapa opsi berbeda berdasarkan jumlah biaya setiap hari untuk memiliki (harian Theta) versus potensi gamma yang berasal dari keuntungan (keuntungan dari pergerakan) dari kepemilikan mereka. Nilai absolut Alpha yang lebih besar semakin besar potensi keuntungan yang ada terhadap kerugian dari Theta untuk posisi long. Kebalikannya benar untuk posisi pendek. VOLATILITAS TERSIRAT Nilai Volatilitas yang dipilih oleh pembeli dan penjual tampaknya menerima dari harga opsi pasar. Hal ini diperoleh dengan memasukkan harga opsi saat ini ke dalam model penetapan harga opsi dan menemukan Volatilitas yang tidak diketahui ini secara berulang. BUNGA BUNGA Biaya menggunakan uang sebagaimana ditentukan pada tingkat bunga per periode waktu, biasanya satu tahun (yaitu tingkat bunga tahunan). Pilihan pembeli dan penjual biasanya melacak suku bunga bebas risiko dari A. S. Treasuries. PUT Opsi dimana pemegang memiliki hak namun tidak berkewajiban untuk menjual keamanan yang mendasarinya dengan harga strike tertentu untuk waktu yang terbatas. HARGA STRIKE Harga di mana keamanan atau indeks yang mendasari opsi dapat dibeli (untuk opsi panggilan) atau dijual (untuk opsi put) sepanjang masa opsi. Juga dikenal sebagai harga pelaksanaan. HARGA UNDERLYING StockIndex - Harga saham atau nilai indeks saat ini adalah subjek pilihan. VOLATILITAS Ukuran jumlah dimana keamanan yang mendasarinya cenderung berfluktuasi dalam periode waktu tertentu. Biasanya diukur dengan varians atau deviasi standar tahunan dari perubahan harga harian dalam suatu keamanan. Dikatakan tinggi jika harganya berubah drastis dalam waktu singkat. Volatilitas adalah salah satu elemen terpenting dalam mengevaluasi suatu pilihan karena biasanya satu-satunya variabel penilaian yang tidak diketahui dengan pasti sebelumnya. TopquotBlack-Scholesquot dalam Beberapa Bahasa Januari 2008: Setelah mempelajari literatur (ada banyak akademisi terkenal sendiri yang jelas tidak melakukannya dengan benar) jelas bahwa kita pedagang opsi tidak pernah menggunakan formula Black-Scholes-Merton dalam praktiknya. Artikel di Frobes) Hanya jika Anda menggunakan lencana delta waktu terus menerus untuk menghapus semua risiko sepanjang waktu Anda benar-benar menggunakan formula pilihan Black-Scholes (atau Black-Scholes-Merton) dari formula pilihan. Satu-satunya masalah ini tidak mungkin dilakukan dalam praktek. Jika Anda menghilangkan sebagian besar risiko dengan opsi lindung nilai dengan opsi, kebal terhadap risiko meledak dengan cara Anda menyusun portofolio pilihan Anda, maka Anda menggunakan metode formulamethod pedagang yang ditemukan sebelum Black-Scholes-Merton oleh serangkaian pedagang dan peneliti, Kontribusi pertama bentuk Bachelier 1900 dan yang terakhir oleh Thorp 1969, jadi inilah mengapa kita pikir itu harus disebut formula Bachelier-Thorp. Dalam prakteknya Anda dapat menghapus risiko dengan lindung nilai delta diskrit (diketahui jauh sebelum Black-Scholes dan Merton), namun Anda tidak dapat menghilangkan risiko yang cukup untuk memperdebatkan penilaian netral-risiko (dan ini adalah argumen utama Black-Scholes-Merton). Lihat Bab 2 di buku saya Model Derivatif pada Model untuk diskusi terperinci tentang cara melindung nilai opsi dalam praktik. Secara alami Anda tahu formula pilihan quotBlack-Scholes-Mertonquot yang tepat, yang sebenarnya bukan formula Black-Scholes-Merton (BSM adalah argumen lindung nilai teoretis yang terkait dengan penilaian netral risiko), namun dalam jumlah bahasa seperti yang saya kira Anda berbicara bahasa Norwegia, bahasa Prancis, Rusia, Inggris, Swedia dan Denmark, tapi bagaimana dengan bahasa yang sangat menarik seperti (sekarang ada lebih dari 30 bahasa): Objective-CiPhone, F, Autoit, Fortress, Lua, APL, SAS, Mathcad, J, MEL, Postscrip t, VB, Clean, Ruby, Lisp, Prolog, PLSQL, LyME, ColdFusion, K, C, HP48, Transact SQL, OCaml, Rebol, Real Basic, Icon, Squeak, Haskell, JAVA. JavaScript, VBA, C, Perl, Maple, Mathematica, Matlab, S-Plus, IDL, Pascal, Python, Fortran, Skema, PHP, GNU, gnuplot. Jika Anda telah menerapkan Black-Scholes dalam bahasa lain, saya akan dengan senang hati mendapatkan salinan kode sumber Anda untuk meletakkannya di halaman ini (dalam hal ini mencoba menggunakan simbol dan penyiapan yang sama seperti di bawah ini) Dalam implementasi yang berbeda di bawah ini Akan menggunakan simbol-simbol: Black-Scholes Langsung dalam Lembar Excel (kutipannya sederhana bodoh) Jika Anda takut bahasa pemrograman Anda bisa mulai dengan melakukan Black-Scholes langsung di lembar Excel, ketik saja apa yang Anda lihat di bawah ini. Jika Anda menggunakan versi Excel Norwegia atau Prancis, Anda harus melakukan terjemahan sendiri: Apakah Anda terlalu malas mengetik apa yang Anda lihat di atas Oke unduh saya di sini Black-Scholes dalam Visual Basic Oleh Espen Gaarder Haug Visual Basic: mudah diprogram Tapi cukup lambat The Black and Scholes (1973) Stock option formula Public Function BlackScholes (CallPutFlag As String S As Double X Sebagai Double T As Double R Sebagai Double v As Double) Sebagai Double Dim d1 As Double. D2 Sebagai Double d1 (Log (SX) (rv 2 2) T) (v Sqr (T)) d2 d1 - v Sqr (T) Jika CallPutFlag quotcquot Kemudian BlackScholes S CND (d1) - X Exp (-r T) CND (D2) ElseIf CallPutFlag quotpquot Kemudian BlackScholes X Exp (-r T) CND (-d2) - S CND (-d1) End If End Function Fungsi distribusi normal kumulatif Fungsi Umum CND (X As Double) Sebagai Double Dim L As Double . K As Double Const a1 0.31938153: Const a2 -0.356563782: Const a3 1.781477937: Const a4 -1.821255978: Const a5 1.330274429 L Abs (X) K 1 (1 0.2316419 L) CND 1 - 1 Sqr (2 Application. Pi ()) Exp (-L 2 2) (a1 K a2 K 2 a3 K 3 a4 K 4 a5 K 5) Jika X lt 0 Kemudian CND 1 - CND End If End Function Oleh Espen Gaarder Haug C: sedikit lebih keras dari kebanyakan bahasa lain tapi sangat Cepat dan kuat Setelah saya berpendapat bahwa bahasa komputer Rolls Royce untuk model matematis di mana Anda memerlukan kecepatan (untuk solusi bentuk tertutup seperti Blacks-Scholes, Anda tentu saja melakukannya dengan baik dalam hampir bahasa apa pun, namun bila menyangkut skala besar Monte Carlo C benar-benar merupakan nilai tambah). Ifndef Pi mendefinisikan Pi 3.141592653589793238462643 endif Black dan Scholes (1973) Formula opsi saham double BlackScholes (char CallPutFlag, double S, double X, double T, double r, double v) double d1, d2 jika (CallPutFlag c) mengembalikan S CND D1) - X exp (-rT) CND (d2) else if (CallPutFlag p) kembali X exp (-r T) CND (-d2) - S CND (-d1) Fungsi distribusi normal kumulatif CND ganda (double X) Double const a1 0.31938153, a2 -0.356563782, a3 1,781477937 double const a4 -1.821255978, a5 1.330274429 L fabs (X) K 1.0 (1.0 0.2316419 L) w 1.0 - 1.0 sqrt (2 Pi) exp (-LL 2) (a1 K a2 K3, a5 pow (K, 5)) Black-Scholes di JAWA Oleh Espen Gaarder Haug Mudah diprogram, dapat digunakan untuk membangun applet JAVA atau sistem standalone yang besar. Jauh lebih cepat daripada Java Script dan VBA tapi masih lebih lambat dari CC The Black dan Scholes (1973) Stock option formula public double BlackScholes (char CallPutFlag, double S, double X, double T, double r, double v) double d1, d2 The kumulative Fungsi distribusi normal ganda ganda CND (double X) double L, K, w double a1 0.31938153, a2 -0.356563782, a3 1,781477937, a4 -1.821255978, a5 1,330274429 L Math. abs (X) K 1.0 (1.0 0.2316419 L) w 1.0 - 1.0 Math. sqrt (2.0 Math. PI) Math. exp (-LL 2) (a1 K a2 KK a3 Math. pow (K, 3) a4 Math. pow (K, 4) a5 Math. pow (K, 5) ) Black-Scholes JAVA Applet Periksa juga keluar Wenhua Wang sangat baik Java Option Pricer dari edtion pertama buku saya Black-Scholes di Java Script Oleh Espen Gaarder Haug (terima kasih kepada Kurt Hess di University of Waikato karena menemukan bug dalam kode saya) Mudah untuk Program, dapat digunakan secara langsung di web, namun cukup lambat Efek formula opsi Black dan Scholes (1973) BlackScholes (PutCallFlag, S, X, T, r, v) var d1, d2 d1 (M Ath. log (SX) (rvv 2.0) T) (v Math. sqrt (T)) d2 d1 - v Math. sqrt (T) jika (PutCallFlag quotcquot) mengembalikan S CND (d1) - X Math. exp (-r T) CND (d2) yang lain kembali X Math. exp (-r T) CND (-d2) - S CND (-d1) Fungsi distribusi normal kumulatif: var a1, a2, a3, a4, a5, k a1 0.31938153, A2 -0.356563782, a3 1.781477937, a4 -1.821255978. A5 1.330274429 if (xlt0.0) return 1-CND (-x) else k 1.0 (1.0 0.2316419 x) kembali 1.0 - Math. exp (-xx 2.0) Math. sqrt (2Math. PI) k (a1 k (-0.356563782 K (1.781477937 k (-1.821255978 k 1.330274429)))) Oleh Jerome V. Braun Perl adalah gergaji mesin perangsang quotSwiss dari bahasa yang secara alami juga dapat digunakan untuk Black-Scholes: Rutin untuk menerapkan rumus harga opsi Black and Scholes (1973) . Harga penggunaan GBlackScholes (callputflag, S, X, T, r, b, v) Disini Cltcallputflaggt adalah c atau p untuk panggilan atau taruh masing-masing, sub BlackScholes saya (callputflag, S, X, T, r, v) menghitung beberapa Nilai tambahan saya d1 (log (SX) (rv22) T) (v T0.5) d2 d1 - v T0.5 Perkiraan distribusi normal kumulatif. Artinya, nilai integral dari kerapatan normal standar dari minus tak terhingga ke Cltxgt. Sub CND my x menggeser persentil berdasarkan pertimbangan saya Pi 3.141592653589793238 koefisien deret Taylor (a1, a2, a3, a4, a5) (0,319381530, -0.35656379, 1,781477937, -1,821255978, 1,330274429) menggunakan simetri untuk melakukan perhitungan di sebelah kanan 0 L abs saya (x) k saya (1 0.2316419L) kemudian kembalikan nilai kembali yang sesuai (x gt 0). CND. 1-CND Black-Scholes di Maple Oleh Espen Gaarder Haug Mudah diprogram, bagus untuk pengujian dan pemahaman model pilihan, namun cukup lambat. Gt dengan statin anova, deskripsikan, fit, importdata, acak, statevalf, statplots, transform Fungsi distribusi normal kumulatif: gt CND: proc (d) gt statevalfcdf, normald (d) gt end: The Balck-Scholes (1973) Formula opsi call stock Gt BlackScholesCall: proc (S, X, T, r, v) gt lokal d1, d2 gt d1: (ln (SX) (rv22) T) (vsqrt (T)) gt d2: d1-vsqrt (T) gt SCND (D1) - Xexp (-rT) CND (d2) gt end: Rumus opsi putck-Scholes (1973) put put. Gt BlackScholesPut: proc (S, X, T, r, v) gt d1 lokal, d2 gt d1: (ln (SX) (rv22) T) (vsqrt (T)) gt d2: d1-vsqrt (T) gt Xexp (-rT) CND (-d2) - SCND (-d1) gt end: Oleh Espen Gaarder Haug Mudah diprogram, bagus untuk menguji dan memahami model pilihan. Mathematica 3.0 cukup lambat, namun Mathematica 4.0 cukup cepat (Mathematica 4.0 pada 266MHz Power Mac G3 mengalahkan MATLAB 5.2 pada sistem Pentium II 300MHz dengan faktor rata-rata 4.3 MacWorld 10-99). Apa yang kemudian akan terjadi jika Anda meletakkan Mathematica 4.0 pada Mac G4, oh Tuhan. (Terima kasih kepada Wolfram dan Steve Jobs hidup layak dijalani). Fungsi distribusi normal kumulatif: Formula opsi saham Balck-Scholes (1973): Oleh Espen Gaarder Haug Jika Anda memiliki latar belakang dari Teknik, Anda mungkin tahu Matlab. Mudah diprogram, bagus untuk pemodelan proto, cukup cepat tapi tetap lambat dibandingkan dengan JAVA dan CC. (Kode di bawah ini harus disimpan sebagai file Matlab M): Hitam dan Scholes di Matlab Black-Scholes di S-PLUS Oleh Trygve Nilsen, Universitas Bergen Norwegia dan Gene D. Felber, Talus Solutions Inc S-Plus adalah alat favorit Bagi banyak orang yang bekerja dengan statistik matematika. S-Plus juga merupakan alat yang bagus untuk memodelkan derivatif keuangan. Kode di bawah ini juga akan berjalan di bawah perangkat lunak bebas R. Call. value lt - function (S, X, t, r, v) d1 lt - (log (SX) (r0.5v2) t) (vsqrt (t)) d2 lt-d1-vsqrt (t) Spnorm (d1 ) - Xexp (-rt) pnorm (d2) Penting: S-PLUS memiliki fungsi internal built-in untuk quotTquot dan quotcallquot. Menetapkan nilai pada fungsi ini menciptakan konflik dan formula akan mengembalikan nilai yang salah. Oleh Goran Gasparovic, Universitas Johns Hopkins. Baltimore, Maryland (AS) IDL Bahasa Data Interaktif (tersedia dari perangkat lunak sangat mahal tapi berguna). Black-Scholes di Icon Dari Squeak2.8 dari 13 Juni 2000 update terbaru: 2359 pada 10 Juni 2001 di 7:40:05 pm Subclass objek: BlackScholes instanceVariableNames: classVariableNames: poolDictionaries: category: Unclassified Contoh kelas BlackScholesVariableNames: Metode kelas BlackScholesFor: komputasi Cap: WRT 6102001 19:39 isCall: isCall S: s X: x T: tr: rv: v penggunaan quotexample: BlackScholes isCall: true S: 27,9 X: 30 T: 6.0 365 r: 1.05333 v: 0.75 quot d1 d2 d1 : Vv 2,0 rt (sx) ln (vt sqrt). D2: d1 - (v t sqrt). (CND: d2)) ifFalse: x (r negated t) (CND diri: d2 dinegasikan) - (s self CND: d1 dinegasikan )). Metode kelas BlackScholes Untuk: stempel pribadi: WRT 6102001 16:53 CND: x l k a w a: (0.31938153 -0.356563782 1.781477937 -1.821255978 1.330274429). L: x abs K: 1.0 (0.2316419 l 1). W: 1.0 - (1.0 (2 Float pi) sqrt (l negated l 2) exp ((1 sampai: 5) menyuntikkan: 0 ke:: sum: each (a at: each) (k raisedToInteger: each) sum)) . X negatif ifTrue: 1 - w ifFalse: w. Oleh Espen Gaarder Haug Sangat mudah diprogram, dengan menekan sebuah tombol kode bisa dikompilasi ke Pc atau Mac. Semuanya secara alami terlihat jelek pada PC (bahkan mesinnya), hasilnya pada Mac Carbon X hanya menakjubkan cepat dan mewah Bahkan lebih baik Anda dapat dengan mudah memasukkan kode VBA Anda ke aplikasi cepat dan mewah yang terik. Contoh Wikipedia: Black-Scholes in Carbon (Hanya untuk Mac X saja) Download disini Menurut George F. Colony, Teknologi perangkat lunak lainnya akan hadir dan membunuh Web, seperti Web membunuh News, Gopher, et al. Dan hari penghakiman itu akan segera tiba - dalam dua sampai tiga tahun ke depan, bukan 25 tahun dari sekarang. Apa yang akan menggantikannya X Internet. Jangan khawatir kami akan memberi Anda beberapa kode REBOL Black-Scholes sehingga Anda bisa bertahan dalam penghakiman. REBOL adalah bahasa pemrograman yang menarik dan ekspresif yang sesuai untuk penggunaan internet dan cross-platform. REBOL Home Distributed Network Applications untuk X Internet. Ada lebih banyak informasi tentang bahasa di situs web mereka (rebol. Seluruh waktu REBOL run-time (termasuk paket grafis) sesuai dengan satu floppy disk (dapatkan dari reboldownload. html) atur a1 a2 a3 a4 a5 0.2316419 0.31938153 ( - 0,356563782) 1,781277937 (- 1,821255978) 1,330274429 w1: (K a1) (a2 (K 2)) (a3 (K3)) (a4 (K4)) (a5 (K 5)) w: 1 - ((w1 Square-root (2 pi)) exp (- (LL) 2)) jika negatif x return 1 - w return w black-scholes: func s money quotactual stock pricequot x money quotstrike pricequot t number quotyears to maturityquot r number quotrisk free interest Ratequot v number quotvolatilityquot call quotcall option (default) quot quot pilihan kuota opsi kuota d1 d2 d1: (log-e (sx) ((r ((v 2) 2)) T)) (v kuadrat-akar t) d2: d1 - (v square-root t) baik (tidak dimasukkan) (s cum-normal-dist d1) - ((x exp (- rt)) cum-normal-dist d2) ((x exp (- rt)) cum - Normal-dist negate d2) - (s cum-normal-dist-d1) Berikut adalah implementasi dari Black - Scholes dalam bahasa OCaml. Ini adalah bahasa yang sangat kuat dan sangat cepat. Its bahasa mimpi pemrogram Terima kasih telah menyediakan semua perhitungan Black Schole dalam bahasa yang berbeda. Sangat berguna saya diperlukan satu di SQL jadi saya menggunakan salah satu contoh Anda dan mengubahnya menjadi Transact SQL. Sebelum menjadi insinyur keuangan, saya dulu adalah insinyur sejati, jadi saya secara alami menerapkan BS pada kalkulator saya, menggunakan notasi reverse-polish (alias RPN). Ltlt-gt SX rv T ltlt SX LN rv SQ 2 T v T SQRT DUP v T SQRT - - gt d1 d2 ltlt S 1 0 1 d1 UTPN - X r T NEG EXP 1 0 1 d2 UTPN - - quotCquot - gtTAG X r T NEG EXP 1 0 1 d2 NEG UTPN - S 1 0 1 d1 NEG UTPN - - quotPquot - gtTAG gtgt gtgt Catatan: quotSQRTquot adalah satu karakter yang mewakili simbol kuot square rootquot quotltltquot, quotgtgtquot dan quot-gtquot semua simbol tunggal Ini menghitung keduanya Memanggil dan meletakkan nilai, meninggalkan nama yang ditandai di tumpukan. Fungsi ltcfscriptgt BlackScholes (callputflag, S, X, T, r, v) var d1 (log (SX) (r (v2) 2) T) (v (T0.5)) var d2 d1 - v (T0.5) Jika (callputflag eq c) kembali S CND (d1) - X exp (-r T) CND (d2) yang lain mengembalikan fungsi X exp (-r T) CND (-d2) - S CND (-d1) CND (x) Fungsi distribusi normal kumulatif var Pi 3.141592653589793238 var a1 0.31938153 var a2 -0.356563782 var a3 1.781477937 var a4 -1.821255978 var a5 1.330274429 var L abs (x) var k 1 (1 0.2316419 L) var p 1 - 1 ((2 Pi) 0.5 ) Exp (- (L2) 2) (a1 k a2 (k2) a3 (k3) a4 (k4) a5 (k5)) jika (x gte 0) kembali ke yang lain kembali 1-p ltCFSET CallPutFlag cgt ltCFSET S49.25gt ltCFSET X50.00gt ltCFSET T0.1gt ltCFSET r0.35gt ltCFSET v0.30gt ltcfoutputgt BlackScholes (CallPutFlag, S, X, T, r, v) ltcfoutputgt Black-Scholes di LyME Oleh Donsyah Yudistira Saya sendiri adalah penggemar berat Black Scholes Option Pricing Rumus. Keindahan derivasi telah mendorong banyak orang, termasuk Anda dan saya, untuk menuliskannya dalam beberapa bahasa seperti yang terlihat di halaman Anda. Beberapa minggu yang lalu, istri saya yang cantik membelikan saya PDA Sony Clie. Tidak lama kemudian, saya browsing net untuk mencari aplikasi terbaik untuk menghitung Black Scholes Option. Saya telah naik ke LyME dari Calerga (calerga). LyME adalah port dari LME (quotLightweight Math Enginequot, jantung SysQuake) ke perangkat genggam Palm OS. Perangkat lunak freeware ini sangat mengherankan saya karena sama kuatnya dengan Mathematica, Matlab, Maple, dan perangkat lunak matematis lainnya dan yang terbaik adalah Anda dapat membawanya ke mana saja dengan perangkat kompak. Tanpa due lebih lanjut, berikut adalah skrip kecil di LyME untuk European Black Scholes Option: fungsi mbs (cp, s, x, t, r, v) d1 (log (sx) (rvv2) t) (vsqrt (t)) d2d1 - vsqrt (t) jika cpc mscdf (normal, d1) - xexp (-rt) cdf (normal, d2) elseif cpp mxexp (-rt) cdf (normal, - d2) - scdf (normal, - d1) akhir Black - Scholes di PLSQL Oleh Fernardo Casteras, Bunos Aires, Argentina Insinyur listrik Fernardo Casteras memberi kami formula Black-Scholes yang ditulis dalam PLSQL. PLSQL adalah bahasa pemrograman yang digunakan untuk menulis prosedur tersimpan di database relasional ORACLE dan alat front-end, lingkungan yang banyak digunakan di perusahaan. CREATE ATAU REPLACE FUNCTION BLACKSCHOLES (CALLPUTFLAG DI VARCHAR2, S DALAM NOMOR, X DALAM NOMOR, T DALAM NOMOR, R DALAM NOMOR, V DALAM NOMOR) NOMOR KEMBALI D1 NOMOR D2 NOMOR NUMBER: 3.141592653589793238462643 HASIL NOMOR - FUNGSI CND ( X NUMBER) NOMOR KEMBALI NOMOR - NOMOR NOMOR A1 NOMOR: 0.31938153 A2 NOMOR: -0.356563782 A3 NOMOR: 1.781477937 A4 NOMOR: -1.821255978 A5 NOMOR: 1.330274429 NOMOR HASIL BEGIN - L: ABS (X) K: 1 (1 0.2316419 L) HASIL: 1 - 1 SQRT (2 PI) EXP (-POWER (L, 2) 2) (Kekuatan A1 K A2 POWER, K, 2) POWER A3 (K, 3) A4 POWER (K, 4) A5 POWER (K, 5)) IF (X lt 0) KEMUDIAN HASIL: (1 - HASIL) END JIKA - HASIL RETURN - END CND - BEGIN - HASIL: 0 D1: (LN (SX) (R POWER (V, 2) 2) T) (V SQRT (T)) D2: D1 - V SQRT (T) JIKA (CALLPUTFLAG C) HASIL HASIL: S CND (D1) - X EXP (-RT) CND (D2) ELSIF (CALLPUTFLAG P) HASIL HASIL: X EXP (-RT) CND (-D2) - S CND (-D1) END IF - HASIL KEMBALI - END Black-Scholes di Prolog Oleh Lou Odette, MA U SA saya mengujinya di Arity Prolog, tapi harus bekerja di Prolog standar manapun. Call case blackscholes (call, S, X, T, R, V, Price): - D1 adalah (ln (SX) (RVV2) T) (Vsqrt (T)), D2 adalah D1 - (Vsqrt (T)), Cumulativenormal (D1, CND1), cumulativenormal (D2, CND2), Price adalah SCND1 - Xexp (-RT) CND2. (D) adalah D1 - Vsqrt (T), cumulativenormal (-D1). , CND1), cumulativenormal (-D2, CND2), Price adalah Xexp (-RT) CND2 - SCND1. Kumulatif Normal Distribusi cumulativenormal (X, CND): - X lt 0, A1 adalah 0,31938153, A2 adalah -0,356563782, A3 adalah 1,781477937, A4 adalah -1,821255978, A5 adalah 1,330274429, L adalah abs (X), K adalah 1,0 (1,0 0.2316419 L)), CND adalah (1.0sqrt (2pi)) exp (-LL2) (A1K A2KK A3 (K3) A4 (K4) A5 (K5)). Cumulativenormal (X, CND): - A1 adalah 0,31938153, A2 adalah -0,356563782, A3 adalah 1,781477937, A4 adalah -1,821255978, A5 adalah 1,330274429, L adalah abs (X), K adalah 1,0 (0,2316419 L)), CND adalah 1.0 - (1.0 (sqrt (2pi)) exp (-LL2) (A1K A2KK A3 (K3) A4 (K4) A5 (K5))). Black-Scholes di LISP Oleh Robert Brown Saya memulai dengan versi C Anda. Begitu kode Lisp saya menghasilkan output yang sama, saya menambahkan beberapa deklarasi tipe dan melakukan beberapa tes kecepatan. Patokan saya menghitung BlackScholes (p, 100.0, 110.0, 10.0, 0.10, 07) satu juta kali. Berikut adalah hasil timing saya. Saya mengumpulkan versi C dengan quotgcc - O2quot dan versi Lisp untuk kecepatan maksimum - tidak ada pengecekan jenis pada waktu berjalan. Versi C: 1.69 detik Versi Lisp: 1.12 detik Seperti yang Anda lihat, Common Lisp bersaing dengan C dan OCaml dalam hal kecepatan eksekusi. Kode Common Lisp dilampirkan di bawah ini. (declaim (optimize (debug 0) (safety 0) (speed 3))) (defmacro poly-eval (x coeffs) quotFor COEFFS list (a0 a1 a2. ) produce an expression that evaluates the polynomial a0 a1x a2x2 . quot (if (endp (rest coeffs)) (first coeffs) ( (,x (poly-eval, x ,(rest coeffs))) ,(first coeffs)))) (deftype probability () (double-float 0.0d0 1.0d0)) (deftype nonnegative-double-float () (double-float 0.0d0.most-positive-double-float)) (declaim (ftype (function (double-float) probability) cnd)) (defun cnd (x) (declare (type double-float x)) (let ((l (abs x)) (k ( ( 1.0d0 ( 0.2316419d0 l)))) (w (- 1.0d0 ( ( (sqrt ( 2.0d0 pi))) (exp ( ( (- l) l) 2.0d0)) (poly-eval k (0.0d0 0.31938153d0 -0.356563782d0 1.781477937d0 -1.821255978d0 1.330274429d0)))))) (declare (type double-float l k w)) (if (lt x 0.0d0) (- 1.0d0 w) w))) (defun black-scholes (callput price strike time r vol) (declare (type nonnegative-double-float price strike time r vol)) (let ((d1 ( ( (log ( price strike)) ( ( r ( ( vol vol) 2.0d0)) time )) ( vol (sqrt time)))) (d2 (- d1 ( vol (sqrt time))))) (declare (type double-float d1 d2)) (ecase callput (:call (- ( price (cnd d1)) ( strike (exp (- ( r time))) (cnd d2)))) (:put (- ( strike (exp (- ( r time))) (cnd (- d2))) ( price (cnd (- d1)))))))) Black-Scholes in Ruby gt by Michael Neumann, Germany one-to-one translation from Python example Cumulative normal distribution def cnd(x) a1, a2, a3, a4, a5 0.31938153, -0.356563782, 1.781477937, -1.821255978, 1.330274429 l x. abs k 1.0 (1.0 0.2316419 l) w 1.0 - 1.0 Math. sqrt(2Math::PI)Math. exp(-ll2.0) (a1k a2kk a3(k3) a4(k4) a5(k5)) w 1.0 - w if x lt 0 return w end def BlackScholes(callPutFlag, s, x, t, r, v) d1 (Math. log(sx)(rvv2.0)t)(vMath. sqrt(t)) d2 d1-vMath. sqrt(t) if callPutFlag c scnd(d1)-xMath. exp(-rt)cnd(d2) else xMath. exp(-rt)cnd(-d2)-scnd(-d1) end end Black-Scholes in Clean module BlackScholes import StdReal clean Pure functional language, performance similar to C Start blackscholes Put 100.0 95.0 7.0 0. 05 0.47 . Option Call Put The Black and Scholes (1973) Stock option formula blackscholes o s x t r v optionvalue o where optionvalue Call s n(d1) - x exp( rt) n(d2) optionvalue Put x exp( d1) d1 (ln(sx) (rvv2.0)t)(v sqrt t) d2 d1 - v sqrt t The cumulative normal distribution function n x x lt 0.0 1.0 - w otherwise w where w 1.0 - 1.0 sqrt(2.0Pi) exp( ll2.0) poly k 1.0 (1.0 0.2316419 l) l abs x poly A1k A2kk A3 k3.0 A4 k4.0 A5 k5.0 Pi : 3.141592653589793238462643 A1 : 0.31938153 A2 : -0.356563782 A3 : 1.781477937 A4 : -1.821255978 A5 : 1.330274429 Black-Scholes in VB By Marco Sturlese, The Black and Scholes (1973) Stock option formula Public Function BlackScholes(ByVal CallPutFlag As String, ByVal S As Double, ByVal X As Double, ByVal T As Double, ByVal r As Double, ByVal v As Double) As Double Dim d1 As Double, d2 As Double d1 (Math. Log(S X) (r v 2 2) T) (v Math. Sqrt(T)) d2 d1 - v Math. Sqrt(T) If CallPutFlag quotcquot Then BlackScholes S CND(d 1) - X Math. Exp(-r T) CND(d2) ElseIf CallPutFlag quotpquot Then BlackScholes X Math. Exp(-r T) CND(-d2) - S CND(-d1) The cumulative normal distribution function Public Function CND(ByVal X As Double) As Double Dim L As Double, K As Double Const a1 0.31938153. Const a2 -0.356563782. Const a3 1.781477937 Const a4 -1.821255978. Const a5 1.330274429 K 1 (1 0.2316419 L) CND 1 - 1 Math. Sqrt(2 Math. PI) Math. Exp(-L 2 2) (a1 K a2 K 2 a3 K 3 a4 K 4 a5 K 5) Black-Scholes in Postscript Language By Dr. Jose Gomes, Black-Scholes formula in Postscript. Started from code at espenhaugblackscholes. html E 2.718281828459045 def PI 3.141592653589793238462643 def The cumulative normal distribution function CND CNDX exch def CNDa1 0.31938153 def CNDa2 -0.356563782 def CNDa3 1.781477937 def CNDa4 -1.821255978 def CNDa5 1.330274429 def CNDL CNDX abs def CNDK 0.2316419 CNDL mul 1 add 1 exch div def CNDK 5 exp CNDa5 mul CNDK 4 exp CNDa4 mul add CNDK 3 exp CNDa3 mul add CNDa2 CNDK CNDK mul mul add CNDa1 CNDK mul add E 0 CNDL sub CNDL mul 2 div exp mul 0 1 sub 2 PI mul sqrt div mul CNDX 0 lt if def The Black and Scholes (1973) Stock option formula BlackScholes v exch def r exch def T exch def X exch def S exch def CallPutFlag exch def d1 v v mul 2 div r add T mul S X div ln add T sqrt v mul div def d2 d1 T sqrt v mul sub def (c) CallPutFlag eq d1 CND S mul d2 CND E 0 r sub T mul exp mul X mul sub if (p) CallPutFlag eq 0 d2 sub CND E 0 r sub T mul exp mul X mul 0 d1 sub CND S mul sub if def S 60 def X 65 def T 0.25 def r 0.08 def v 0.30 def c all (c) S X T r v BlackScholes def put (p) S X T r v BlackScholes def Fixed findfont 20 scalefont setfont newpath 100 220 moveto ( S) show S 100 string cvs show 100 200 moveto ( X) show X 100 string cvs show 100 180 moveto ( T) show T 100 string cvs show 100 160 moveto ( r) show r 100 mul 100 string cvs show () show 100 140 moveto ( v) show v 100 mul 100 string cvs show () show 100 120 moveto (call) show call 100 string cvs show 100 100 moveto (put ) show put 100 string cvs show Black-Scholes in MEL By James D. Polk, MEL Mayas Embedded Language. Maya is a 3D animation program used in animated feature films and special effects. quotDinosaurquot, etc. And now also for options global float PI PI 3.141592653589793238462643 global proc float BlackScholes(string CallPutFlag, float S, float X, float T, float r, float v) float d1, d2 float val if(CallPutFlag quotcallquot) val S CumNormDist(d1) - X exp(-r T) CumNormDist(d2) return(val) else if(CallPutFlag quotputquot) val X exp(-r T) CumNormDist(-d2) - S CumNormDist(-d1) return(val) global proc float CumNormDist( float X ) global float PI float L, K, w float a1 0.31938153, a2 -0.356563782, a3 1.781477937 float a4 -1.821255978, a5 1.330274429 L abs(X) K 1.0 (1.0 0.2316419 L) w 1.0 - 1.0 sqrt(2 PI) exp(-L L 2) (a1 K a2 K K a3 pow(K,3) a4 pow(K,4) a5 pow(K,5)) if(X lt 0 ) w 1.0 - w Black-Scholes on TI-89 calculator By Warren Severin, 1) This has been developed on a TI-89 calculator. It should work on many TI-8x models with minor tweaking. 2) This program assumes that the TI statistics and list editor application is installed, which should apply to most people. If you dont have it, download it from education. ti . Black-Scholes in J By Eugene McDonell, I wrote an article on Black-Scholes for the British publication Vector, 19.3, January 2003. I have a regular column there called quotAt Play With Jquot, that deals in things having to do with J, a language developed by the late Ken Iverson and Roger Hui, as a successor to Kens APL. My article is online at : Here is a way to implement it in J: BS is used for either call or put. A call uses a positive v, and a put uses a negative v. I learned this device from Arthur Whitney, but I could have learned it from Espen Haug: see his Wilmott paper quotA Look in the Antimatter Mirrorquot for a discussion of the useful symmetries of put and call that permit this. The phrase (,-) uses a J feature that generalizes the customary mathematical notation (fg) x, meaning (f(x))(g(x)). Thus r (,-) hlf sqr v gives a two-element vector: (rhlf sqr v),(r-hlf sqr v). This allows the two items d1 and d2 to be replaced by the two-element list d. The function diff is used to subtract the second item from the first. The erf and cnd functions appear in Abramowitz and Stegun quotHandbook of Mathematical Functionsquot in the sections shown, and were written in J by Ewart Shaw (J. E.H. Shaw Ewart Shaw Department of Statistics, University of Warwick erf : monad define NB. AampS 7.1.21 (rightmost) ((2 y.) dv (sqrt pi)) (exp - y. 2) (1 H. 1.5) y. 2 ) This erf uses Js hypergeometric function, symbolized by quot H. quot, and thus doesnt need a list of coefficients. cnd : monad define NB. AampS 26.2.29 (solved for P) (1 erf y. sqrt 0.5) dv 2 ) J uses symbols for many functions, instead of names. These are the names and the equivalent J symbols of the ones used above: diff : - NB. difference diff 39 13 is 26 dv : NB. divided by 39 dv 3 is 13 exp : NB. exponential exp 1 is 2.71828 hlf : -: NB. half hlf 39 is 19.5 ln : . NB. natural logarithm ln 2.71828 is 0.999999 pi : 1p1 NB. pi pi is 3.14159 sqr : : NB. square sqr 13 is 169 sqrt : : NB. square root sqrt 169 is 13 Here are examples of put and call uses of BS: yc NB. call argument 60 65 0.25 0.08 0.3 yp NB. put argument 60 65 0.25 0.08 0.3 BS yc NB. call result 2.13337 BS yp NB. put result 5.84628 Black-Scholes in Mathcad v11 By Stuart Bruff, Its written in Mathcad v11 (although it should work in v6 to v13). There is real equivalent of a text source code, as you just type the equations in, using a palette for such things as the square root operator (although there are keyboard shortcuts for most common operators, such as integrals and derivatives). See also mathcad Black-Scholes in SAS By Fabrice Douglas Rouah, For SAS Release 6.12 or higher data BS input S X r v T d1 (log(SX) (rv22)T)vsqrt(T) d2 d1 - vsqrt(T) C Scdf(Normal, d1) - Xexp(-rT)cdf(Normal, d2) P Xexp(-rT)cdf(Normal,-d2) - Scdf(Normal,-d1) label S Spot Price X Strike Price r Risk Free Rate v Volatility T Time Periods C BS Call Price P BS Put Price Input as many input values as needed cards 120 95 0.08 0.2 3 120 100 0.08 0.2 3 120 110 0.08 0.2 3 120 120 0.08 0.2 3 proc print label var S X r v T C P run Black-Scholes in APL By Nick Lobachevsky, APL has the undeserved reputation of being unreadable code. Usually, it has a lot more to do with the program author than the language itself. The code is written in a quotdyalectquot called Dyalog APL. dyalog Black-Scholes in Lua By Thomas Munro, -- quotLua is a powerful light-weight programming language designed for -- extending applications. Lua is also frequently used as a general-purpose, -- stand-alone language. Lua is free software. quot - from lua. org -- -- Black-Scholes option formula put into Lua by Thomas Munro, London, 2007. -- Cumulative normal distribution. function cnd(x) -- taylor series coefficients local a1, a2, a3, a4, a5 0.31938153, -0.356563782, 1.781477937, -1.821255978, 1.330274429 local l math. abs(x) local k 1.0 (1.0 0.2316419 l) local w 1.0 - 1.0 math. sqrt(2 math. pi) math. exp(-l l 2) (a1 k a2 k k a3 math. pow(k, 3) a4 math. pow(k, 4) a5 math. pow(k, 5)) if x lt 0 then w 1.0 - w end return w end -- The Black-Scholes option valuation function (1973). -- iscall: true for call, false for put -- s: current price -- x: strike price -- t: time -- r: interest rate -- v: volatility function blackscholes(iscall, s, x, t, r, v) local d1 (math. log(s x) (r v v 2.0) t) (v math. sqrt(t)) local d2 d1 - v math. sqrt(t) if iscall then return s cnd(d1) - x math. exp(-r t) cnd(d2) else return x math. exp(-r t) cnd(-d2) - s cnd(-d1) end end Black-Scholes in Fortress By Thomas Munro ( The Black-Scholes formula expressed in the unfinished language Fortress. Thomas Munro, London 2007. From Wikipedia: Fortress quotis intended to be a successor to Fortran, with improvements including Unicode support and concrete syntax that is similar to mathematical notation. The language is not designed to be similar to Fortran. Syntactically, it most resembles Scala, Standard ML, and Haskell. quot ) Black-Scholes in AutoIt By Russell Lazarus AutoIt is a freeware Windows automation language which is particularly adept at manipulation of GUI windows and controls. AutoIt scripts can be compiled with a run-time interpreter that allows users to run on most Windows platforms without requiring software installation. For more information, visit the AutoIt web sit at: autoitscript . BlackScholes stock option function Func BlackScholes() Local CallPutFlag, S, w, T, r, v, d1 (Log(S w) (r v 2 2) T) (v Sqrt(T)), d2 d1 - v Sqrt(T) If CallPutFlag quotcquot Then Local callval (S CND(d1) - w Exp(-r T) CND(d2)) ElseIf CallPutFlag quotpquot Then Local putval (w Exp(-r T) CND(-d2) - S CND(-d1)) EndIf EndFunc gtBlackScholes The cumulative normal distribution function Func CND(w) Const a1 0.31938153, a2 -0.356563782, a3 1.781477937, a4 -1.821255978, a5 1.330274429, Pi 3.14159265 w1 w L Abs(w) K 1 (1 0.2316419 L) w 1 - 1 Sqrt(2 Pi) Exp(-L L 2) (a1 K a2 K 2 a3 K 3 a4 K 4 a5 K 5) If w1 lt 0 Then w 1 - w EndIf Return w Black-Scholes in GNU By Dave Prashant Prashant Dave Ph. D. prashant dot dave at alumni dot purdue dot edu Black Scholes Option Pricing Formula Written in bc. Details on bc are available at gnu. orgsoftwarebc This code is based on the C code written by Dr. Espen Gaarder Haug Usage: bc - l lt bsbc. txt define cnd (x) a1 0.31938153 a2 -0.356563782 a3 1.781477937 a4 -1.821255978 a5 1.330274429 if (x gt 0 ) l x else l - x k 1.0 (1.0 0.2316419 l) pi 4a(1) w 1.0 - 1.0 sqrt(2 pi) e(-l l 2) (a1 k a2 k k a3 (k3) a4 (k4) a5 (k5)) if (x lt 0 ) w 1.0 - w return w define blackscholes (f, s, x, t, r, v) d1(l(sx)(rvv2)t)(vsqrt(t)) d2d1-vsqrt(t) if (f 0) return s cnd(d1)-x e(-rt)cnd(d2) else return x e(-r t) cnd(-d2) - s cnd(-d1) First argument is 0 for call and nonzero for put blackscholes(0, 60, 65. 25. 08. 30) Black-Scholes in gnuplot By Dave Prashant Prashant Dave, Ph. D. prashant dot dave at alumni dot purdue dot edu GNUPlot Code Implementation of Black Scholes Usage: gnuplot blackscholes. gnu d1 (S, X, T, r, v) (log(S1.0X1.0)(rvv2.0)T)(vsqrt(T)) d2 (S, X, T, r, v) (log(S1.0X1.0)(r-vv2.0)T)(vsqrt(T)) BlackScholes(CallPutFlag, S, X, T, r, v) (CallPutFlag eq quotcquot). (S norm(d1(S, X,T, r,v))-X exp(-rT)norm(d2(S, X,T, r,v))). (X exp(-r T) norm(-d2(S, X,T, r,v)) - S norm(-d1(S, X,T, r,v))) print BlackScholes(quotcquot, 60, 65, 0.25, 0.08, 0.30) Black-Scholes in F By Michael de la Maza This code was transliterated from the OCAML code located here espenhaugblackscholes. html let pow x n exp (n log(x) ) let cnd x let a1 0.31938153 let a2 -0.356563782 let a3 1.781477937 let a4 -1.821255978 let a5 1.330274429 let pi 4.0 atan 1.0 let l abs(x) let k 1.0 (1.0 0.2316419 l) let w ref (1.0-1.0sqrt(2.0pi)exp(-ll2.0)(a1ka2kka3(pow k 3.0)a4(pow k 4.0)a5(pow k 5.0))) if (x lt 0.0) then w : 1.0 - w w callputflag: c if call option otherwise put option s: stock price x: strike price of option t: time to expiration in years r: risk free interest rate v: volatility let blackscholes callputflag s x t r v let d1(log(s x) (rvv2.0)t)(vsqrt(t)) let d2d1-vsqrt(t) let res ref 0.0 if (callputflag c) then res : scnd(d1)-xexp(-rt)cnd(d2) else res : xexp(-rt)cnd(-d2)-scnd(-d1) res gt blackscholes c 60.0 65.0 0 .25 0.08 0.3 val it. float 2.133371862 gt blackscholes p 60.0 65.0 0.25 0.08 0.3 val it. float 5.846285627 Objective-C is the programming language used for iPhones. With this code as inspiration to thet started I hope we will see a lot of great option software fro iPhones. F or a detailed description of the Black-Scholes-Merton formula see: Haug, E. G. (2007): quotDerivatives Models on Models quot Wiley Publishing, see Chapter 2 in particular Black, F. and Scholes, M. (1973): quotThe Pricing of Options and Corporate Liabilities, quot Journal of Political Economy, 81, 637-654 Merton, R. C. (1973): quotTheory of Rational Option Pricing, quot Bell Journal of Economics and Management Science, 4, 141-144 If you hate computers and computer languages dont give up its still hope What about taking Black-Scholes in your head instead If the option is about at-the-money-forward and it is a short time to maturity then you can use the following approximation: call put StockPrice 0.4 volatility Sqrt( Time )The Framework In this three part series, we introduced the Option Greeks in the first post. In the second post, we discussed the practical Application of Option Greeks with respect to options trading. In this concluding post, we will understand the usage of an option calculator. An option calculator is a tool which helps you calculate the Greeks, i. e. the delta, gamma, theta, vega, and rho of an option. Along with the calculation of the option Greeks, the option calculator can also be used to calculate the theoretical price of an option (also called fair value of an options premium) and the implied volatility of the underlying. The option calculator uses a mathematical formula called the Black-Scholes options pricing formula, also popularly called the Black-Scholes Option Pricing Model. This is probably the most revered valuation model in Economics, so much so that its publishers (Robert C. Metron and Myron Scholes) received a Nobel Prize in Economics in 1997. Briefly, the framework for the pricing model works like this: We feed the model with a bunch of inputs Inputs include: Spot price, Interest rate, Dividend, and the number of days to expiry. Along with these mandatory inputs, we also input either the price of the option or the implied volatility of the underlying, but not both . The pricing model churns out the required mathematical calculation and gives a bunch of outputs The output gives us the value of Option Greeks. Along with the Option Greeks, we also get one of the following: The Implied volatility of the underlying, provided one of the input is the option price or The theoretical value of options premium, provided the input is the implied volatility of the underlying The illustration below gives the schema of a typical options calculator: Let us inspect the input side: Spot Price This is the price at which the underlying is trading. Note, we can even replace the spot price by the futures price. We use the futures price when the option contract is based on futures as its underlying. Usually, commodity and in some cases currency options are based on futures. For equity option contacts, always use the spot price. Interest Rate This is the risk-free rate prevailing in the economy. Use the RBI 91 day Treasury bill rate for this purpose. As of September 2014, the prevailing rate is 8.6038 per annum. Dividend This is the dividend expected per share in the stock, provided the stock goes ex-dividend within the expiry period. For example, today is September 11 and you wish to calculate the option Greeks for the ICICI Bank option contract. Assume ICICI Bank is going ex-dividend on September 18 with a dividend of Rs. 4. The expiry for September series is September 25. In this situation you need to give an input of Rs. 4. Number of days to expiry This the number of calendar days left to expiry. Volatility This is where it gets a little confusing, so I suggest you pay extra attention. As mentioned earlier, along with option Greeks you can use the option calculator to calculate either the implied volatility of the underlying or the theoretical option price but not both at the same time If you wish to calculate the theoretical option price as one of the desired outputs, then volatility has to be one of the inputs. For Nifty option contracts, use the India VIX index value. Alternatively, if you have a view on volatility from today to expiry, you can input that as well. You can do the same thing for stocks. Option Price, also called the Actual Market Value If you wish to calculate the implied volatility of the underlying you need to input actual market value data. The actual market data is simply the price at which the option is trading in the market. Once these inputs are fed to Black-Scholes option pricing model, the model churns out the math to give us the required output. The logic on which Black-Scholes model works is quant heavy involving concepts of stochastic calculus. For a quick introduction on the working of a Black-Scholes model, Id encourage you to watch this video . We get the following values on the output side: Along with the Greeks, the output includes either the implied volatility of the underlying or the theoretical option price. Option Calculator on Zerodha Trader (ZT) Keeping the above framework in perspective, let us explore the Option Calculator on Zerodha Trader (ZT). To invoke the option calculator, click Tools 8211gt Option Calculator as shown below. Or you can simply place your cursor on an option scrip and use the shortcut key ShiftO. This is how the calculator appears on the terminal: The calculator can be broken down into three sections as shown in the image below: The top section highlighted in blue is used to select the option contract, this is fairly straightforward. The left section highlighted in red is the input field. Let us look into this. We begin by selecting either the Underlying or the Futures price. Id suggest you select underlying as the default option. Once the underlying has been selected, you need to manually enter the value of the underlying in the Spot Price (in Rupees) field. The next two input fields are Actual Market Value and Volatility . At this stage you need to decide what the option calculator should calculate for you. If you want to calculate the fair value of the option premium also called the Theoretical Option Price then leave the Actual Market Value field blank and proceed to enter the volatility data. As I mentioned earlier, for Nifty options use the India VIX index value for the volatility field. Alternatively, if you want to calculate the volatility of the underlying leave the Volatility blank, but make sure you input the market price of the option in Actual Market Value. For the interest rate , take the 91 day T-bill rate data from the RBI website . Dividends (in Rupees) would be for the index and the actual dividend value in case of a stock. Also, in case dividends are expected within the expiry of the contract, make sure you enter the ex-dividend date. The last input field is the number of days left to expiry. Input the total number of calendar days here. Note, Zerodha Trader (ZT) has two models based on which the Greeks can be calculated, i. e. Black-Scholes Pricing Model and another model called the Cox-Ross-Rubinstein Binomial Method. The binomial method is also popularly used, however, Id advocate the Black-Scholes model as it is more advanced and precise. It is worth mentioning that the difference in output values between the two models is not really much. Lastly, look at the bottom section of the Output field (highlighted in green ). Just besides the Calculate button you have two options: Select Volatility if you want the option calculator to calculate the volatility for you. If you want to calculate the theoretical option price, select the Option Price. Have a look at the image below with all the input data loaded: Notice two things: Along with the Greeks, I intend to calculate the Option price (highlighted in blue). Also Actual Market Value is left blank (highlighted in red). I8217ve taken the volatility value from the India VIX index. The dividend field is blank since I have selected 8100 Nifty Call option ( index option), hence the value in ex-dividend date field is irrelevant. Once the input values are loaded, click Calculate to generate the output. The following image shows the output: The first field in the output field is the theoretical option price (also called the fair value) of the call and put option. The calculator is suggesting the fair value of 8100 call option should be 81.14 and the fair value of 8100 put option is 71.35. However, the call option value as seen on the NSE option chain is 83.85. The difference, though not significant, mainly occurs due to factors such as wrong volatility assumptions, bid-ask spread, liquidity, transaction charges, and taxes. Following the theoretical option price you can find the data on Greek values. As of today Nifty spot is 8085, and the closest ATM option is 8100. As we had discussed in the previous post, the ATM option should have a delta of approximately 0.5. In fact, the calculator is telling us that the delta is 0.525 for the call option and -0.475 for the put option. This is in line with our discussion on delta in the previous post. Following the delta value we find other Greek values such as Gamma, Theta, Vega, and Rho. Also, by default the calculator calculates the Greeks of: Put option of the same strike, same expiry A simple long straddle Option Calculator to calculate volatility Let us now use the option calculator to calculate the volatility of the underlying. To do this, I leave the Volatility field blank (highlighted in blue) and select Volatility (highlighted in red) option. Further, I input the Actual Market Value of the 8100 Call option as observed on NSE, which in this case happens to be 83.85 (see the NSE Quote image above). After selecting this click calculate: It turns out that the volatility of Nifty is 12.96 as opposed to 12.5175 as India VIX suggested. Well, the difference is less than 50 basis points this should also explain why the calculator calculated the Theoretical Option Price as 81.14 as opposed to 83.84. In fact, instead of 12.5175 if we now give Volatility input as 12.96 we will get the accurate Option price. See the image below: Conclusion: Option calculators are mainly used to calculate the option Greeks, volatility of the underlying, and the theoretical option price. Sometimes small differences arise owing to variations in input assumptions. Hence for this reason, it is good to have room for the inevitable modeling errors. However, by and large, the option calculators are fairly accurate. Lastly, we hope you enjoyed this three-part series on Option Greeks. Stay connected, stay profitable. Ive been trading and investing in the Indian markets for over a decade. I strongly believe that trading is not a gift that you are born with but a skill that you can develop over time. At Zerodha, Im involved in Equity Research amp Education initiative. I hold a Masters Degree in Risk amp Asset Management from EDHEC Business School, France and a Bachelor of Engineering from Bangalore University. 128 comments

Comments