MCOV |
Open Source Monte Carlo Option Valuer |
|
Home Contact Download Releases Installation Read-Me License Monte Carlo Strategy Objects C++ Classes C++ Files mcovaluer.h mcovaluer.cxx mcov.cxx |
mcov.cxxTiny C++ Main Program using MCOV SoftwareThis is the mcov.cxx file that comes with a MCOV distribution (without the license section)...
// ================================================================
// Use a Monte Carlo technique to estimate an option's value.
//
// See copyright notice and license at end of this file.
//
// Notes:
//
// - This file illustrates two ways of creating an mcoValuer
// object:
// - using default strategies and limits
// - using your own strategies and limits
//
// - Program arguments are not checked here because the
// mcoValuer does thorough argument checking.
//
// ----------------------------------------------------------------
#include <cstdlib>
#include <iostream>
#include "mcovaluer.h"
using namespace std;
// ----------------------------------------------------------------
// Estimate an option value using an mcoValuer object.
int main (int argc, char *argv[]) {
if (argc < 5 || argc > 6) {
cout << "\n"
<< "Usage:\n"
<< " mcov history_file put-call strike_price "
<< "days_to_expiry [tries]\n"
<< " Examples:\n"
<< " mcov mydata1.opd C 47.50 11\n"
<< " mcov xiu2003.opd P 45.00 19 1000\n"
<< " History-File: one line/trading-day, \n"
<< " Earliest first; may contain gaps;\n"
<< " Lines: daynum closing-price
|