Learn Finance C++, Lesson 35, Black Scholes Monte Carlo Engine, Part I
We're going to head towards a Monte Carlo engine over the next few lessons.
There's not too much going on here, except the setting up of the calls from main() to the soon-to-be-created new class. It has to be done, however, though this lesson is perhaps just for those who want the 'full' experience, and who learn best by going through all of the motions. We build up the parameters to the Monte Carlo engine and then work out what we need to send the new class for it to be able to deliver us call and put option prices.
Today we'll finish off the DurationBond class, by calculating a duration for the input bond details.
http://andyjamesduncan.wordpress.com
Finished code blocks:
http://andyjamesduncan.wordpress.com/2013/02/25/learn-finance-c-lesson-34-inheritance-part-ii/
...
https://www.youtube.com/watch?v=NduKDXRlZSw
In this lesson we build up header file for the new BSM (Black Scholes Merton) header file, to include all of the bits and pieces we will need later to price call and put options.
http://andyjamesduncan.wordpress.com
The code modules for this new class will appear with the final part of this lesson series.
...
https://www.youtube.com/watch?v=NBrsb4ugxEY
We now begin to build our first class, one to price a bond. It's a slightly long-winded and complicated process, but we'll take it one step at a time until it's done.
http://andyjamesduncan.wordpress.com
Finished code block:
http://andyjamesduncan.wordpress.com/2013/02/14/learn-finance-c-lesson-27-bond-class-part-i/
...
https://www.youtube.com/watch?v=LKVbfPdZ5kQ
We're heading towards more on strings, arrays, and then pointers, but before we get there, let's leave this program in a fit state, by formatting the output in a better way. We'll do this via another 'enum' and by the sets() column-width setting function, used in conjunction with 'cout'.
http://andyjamesduncan.wordpress.com
Finished code block:
http://andyjamesduncan.wordpress.com/2013/01/22/learn-finance-c-lesson-12a-setw-and-column-report-formatting/
...
https://www.youtube.com/watch?v=E00riagHt9g
So why do we need references and pointers? To save unnecessary and slow data copying between functions, usually. Pointers and references give C++ enormous speed, as they tap directly into computer memory structures, almost down to machine-code level. Here, we run through four different ways of changing an integer value via a function subroutine call, using 'pass by value', 'pass by reference', and two different ways of 'pass by pointer'.
http://andyjamesduncan.wordpress.com
Finished code block:
http://andyjamesduncan.wordpress.com/2013/02/05/learn-finance-c-lesson-22-pass-by-value-references-pointers-and-indirect-pointers/
...
https://www.youtube.com/watch?v=lwlcxbx2eOs
The second part of our lesson collection on building a Bond Class in C++.
http://andyjamesduncan.wordpress.com
Finished code blocks:
http://andyjamesduncan.wordpress.com/2013/02/15/learn-finance-c-lesson-28-bond-class-part-ii/
...
https://www.youtube.com/watch?v=wLYWMwsQgcY
Many times we would prefer to enter varying parameters into a program without necessarily having to type them in each time. We can do that, when we run a program from the command line, by taking advantage of two special arguments which go into the main() function of any C++ program. The first is ARGC, which is a number telling you how many parameters the program has. It is always at least one, because the name of the executable program itself is always the first program parameter. If we add any more program parameters on the command line, ARGC increases. The second parameter is a pointer to a special array, called ARGV, which contains all the program parameters, as well as the executable program name at the start of the list. Watch the lesson for more details.
http://andyjamesduncan.wordpress.com
Finished code block:
http://andyjamesduncan.wordpress.com/2013/01/17/learn-finance-c-lesson-10-introducing-argc-and-argv-and-command-line-entry/
...
https://www.youtube.com/watch?v=jZiIc2bRqjs
In our inaugural Libertarianism.UK Podcast, we discuss with Sean Gabb the current state of UK politics. Sean Gabb is one of the best known libertarian figures in the UK and the author of more than 40 books. He is also the Director of the Centre for Ancient Studies.
Please remember to like, share, and subscribe to help us grow the podcast.
Timecodes
0:00 - Intro
1:10 - Heating Bills in the UK
2:12 - Who is Sean Gabb?
2:50 - The General State of UK Politics
4:24 - From Margaret Thatcher to Boris Johnson
10:07 - Can a New Party of the Right be Created?
15:50 - Secession in the UK
21:26 - Totalitarianism in the UK?
24:20 - What About Brexit?
27:20 - Nigel Farage
29:41 - How Can Things be Improved?
34:15 - Richard Blake et al
You can find out more about Sean Gabb, here:
https://www.seangabb.co.uk/
You can find out more about the Centre for Ancient Studies, here:
https://www.classicstuition.co.uk/about/
Some quotes from the Podcast:
“Come the next election, we have a choice. We can vote Labour and get the Leftists we voted for or we can vote Conservative for the Leftists we didn't vote for.”
“All of the bad things that have happened in this country over the past few generations really started with the election of Margaret Thatcher.”
“You think to yourself, England is still around me. England hasn't been destroyed. It can't be destroyed. It will triumph. But it's not true.”
“You can talk about the organic linkage and development of our constitution and our national ways, but in general I'm afraid the nation has been atomised into a mass of terrified and obedient sheep.”
“As a classics teacher, in which I do some limited good, I do the limited good that I can to hand on our civilisation to another generation, and that's as much as I can do.”
“There is no revolutionary class in this country. And in the absence of that, the most that we can hope for is that there will this time be a successful revolution in America, and fresh orders will be sent out from the new people in Washington to their satellites in London. And we might see some improvement because of that, but I do not see any spontaneous reform in this country.”
“We are already closer to totalitarianism than supposedly Communist China.”
“[On Brexit] the idea is to wait until enough of the leavers have died out or until lavish grants of citizenship have produced a new majority, then announce that circumstances have changed and run a rigged referendum and take us back in. They may not take us formally into the European Union and there will be some very creative new membership agreement. But I think the ruling class in this country was rather surprised and frightened when the referendum went the wrong way for their view of things. First of all, they tried to stop it by just refusing to go through with the will of the people. And then they had to go through some form of the will of the people. But it’s just part of this holding operation, to keep things ticking over until the whole thing can be reconstituted.”
“I have a great deal of respect for Nigel Farage as an individual and he is the man who got us as far as we've got in leaving the European Union. I think the problem with his party is that it is filled with the usual Tory boys.”
“Conservatives talk about freedom. They talk about free markets. They talk about tradition. And they have been in power now for twelve years and we're living in a Leftist, totalitarian police state which is growing progressively worse.”
“The only thing that we can do is to form ourselves into libertarian communities. Now that sounds rather utopian and vague, but what I mean is this: if you need an accountant, you go to someone who shares your personal political opinions. If you want to take legal action or if you want someone to paint your house or clean your windows or re-plaster your walls, you should make sure to give your preference to people who broadly share your outlook on life.”
Music Attributions:
Song: Alexey Anisimov - So Much Fun
Music provided by Tunetank.
Free Download: https://tunetank.com/track/5689-so-much-fun/
Song: AlexGuz - Fashionable Jazz
Music provided by Tunetank.
Free Download: https://tunetank.com/track/1768-fashionable-jazz/
If you want to see more content like this, to help us out please like, share, and subscribe on whichever streaming service you found this video podcast.
...
https://www.youtube.com/watch?v=zKWnp8SORiA
Before we move on further with pointers, we also have to uncover another dark C++ secret, and that is references, which are similar to pointers, but different. Here, we examine how to set up a reference, and the kinds of places they are used, to aid speed and decision making.
http://andyjamesduncan.wordpress.com
Finished code block:
http://andyjamesduncan.wordpress.com/2013/02/04/learn-finance-c-lesson-21-references-aliases-to-variables-and-references-with-functions/
...
https://www.youtube.com/watch?v=ibyKRfAM1Fo