Upcoming deliverables for remainder of semester - to Dec 14 Nov 18th (Wednesday): “book” data file will be uploaded to class site –A second file will contain a sample of expected results Nov 23rd: submit library and test driver which will use above data file –See last slide for feedback! Nov 30th: Second quiz –Will cover the remainder of MMM (chapter 13 to end). Dec 7th: Third and final quiz (first 15 minutes of class) –3 total for the semester, average of 3 will account for 20% of grade –Third quiz will cover contents of lectures (see slides on the website) Dec 14th: Final presentations –Each team will present for 15 minutes –Each team will force rank the other teams presentations!
Units consistency $10,000,000 of a bond 9% coupon, 20 years to maturity Current price: and yield is: 6% Market value is: $10,000,000 * = $13,467,220 Bump yield by up by 100 basis points (1%) and price is now: Our data file has amounts in 000’s so $10,000,000 would be entered as 10,000 (with no comma) Dollar Value of an “01” (DV01) - price diff between starting yield and 1/100th of a percent move of yield, or 1 basis point, (1/100th of above example). Additionally, it is the average of two shifts: the absolute value of the differences resulting from both an up and down move. “Risk” for us is defined as Amount * DV01/100 and thus stays in thousands since Amount is in thousands… double yield_delta_abs = fabs(bump_amount); // yield goes up, price goes down double down_price = PV(base_yield + yield_delta_abs); double price_delta_down = base_price - down_price; // yield goes down, price goes up double up_price = PV(base_yield - yield_delta_abs); double price_delta_up = up_price - base_price; dv01 = (price_delta_up + price_delta_down ) / 2.0;
Mid-term feedback I shouldn’t have to re-compile to run against another file in a different location Units should be in thousands throughout Provide a README file Use meaningful, descriptive variable names - as opposed to “a”, “b”, “c” Free memory Identify class member data consistently like: “_price” Use mf TCM() for indentifying bond (not ID - this will be used internally) Always use curly braces Don’t copy objects - pass by const ref or use pointers Comment the main and include the string “main” in the name Price and dv01 is a percentage so need to divide by 100 before calculating market value, etc. Use the run.sh shell script Timer routines were provided so they would be included Use indents and comments in source code Format output using tabs and newlines Parameterize by filename but need to check if not passed Amounts can be negative (short positions) Debug io kills performance - #ifdef out before submitting Interface classes should not contain state, add another level in hierarchy Use interface classes as pointers not the derived types Text titles cut/pasted - archaic comments are evil Unnecessary copying from provided objects (could use pointers) Only build what you have to - don’t “program to impress your friends” Don’t use makefiles for anything other than building code - use shell instead