Quote from Daring: I would like to understand this, is there an English explanation ?
It's a little commandline program written in the programming language C++, with comments at the beginning.
It simply calculates how many shares one needs to buy additionally to average down the loss to a desired percent value.
There are some examples given in the comment section of the code.
One needs a C++ compiler to generate the executable program.
Under the Linux operating system such tools like compiler etc. are usually included,
under Windows you would need to install a C++ compiler first, there are some free available, for example in cygwin, mingw etc. --> just google.
Since the algorithm (the formula) is given, it should be easy to use it in a spreadsheet application like Microsoft Excel or OpenOffice Calc etc.
It's basically this line:
c = -(a*b*p + (100*a*b - 100*a*d) * (fShort ? -1.0 : 1.0)) / (d*p)
It's a little commandline program written in the programming language C++, with comments at the beginning.
It simply calculates how many shares one needs to buy additionally to average down the loss to a desired percent value.
There are some examples given in the comment section of the code.
One needs a C++ compiler to generate the executable program.
Under the Linux operating system such tools like compiler etc. are usually included,
under Windows you would need to install a C++ compiler first, there are some free available, for example in cygwin, mingw etc. --> just google.
Since the algorithm (the formula) is given, it should be easy to use it in a spreadsheet application like Microsoft Excel or OpenOffice Calc etc.
It's basically this line:
c = -(a*b*p + (100*a*b - 100*a*d) * (fShort ? -1.0 : 1.0)) / (d*p)
you made something simple into something complex. no one is going to compile a little c++ formula to get answer. They wont compile anything.
Quote from 2rosy: you made something simple into something complex. no one is going to compile a little c++ formula to get answer. They wont compile anything. MAKE IT EASY
Sorry, I don't have time, the code is intended more for sw-developers as they know what it is and how to use it,
or howto convert it to other programming languages.