// futtest.cc // // Binomial futures option pricing model: test // #include #include "fut.h" main() { fut c1; valhedge x; double futprice,strikeP; cout << "\nType the futures price, a space, the strike" << " price, and then ENTER.\n" << "Make the futures price negative to terminate." << "\n\n"; while(1) { cout << "futures-price strike-price: "; cin >> futprice >> strikeP; if(futprice < 0.0) { cout << endl; return(0);} if(!cin) { cout << "invalid input" << endl; return(1);} x = c1.eurcall(futprice,strikeP); cout << "call option value = " << x.value << "\n" << "hedge (number of contracts) = " << x.delta << "\n\n";}}