Size:
Color:
Black-Scholes? You mean those golf-playing quant characters whose model that ignores fat tails (black swans) lost a few billion dollars for Long Term Capital Management in the wake of Russian default? Will the bail outs ever stop!? :)
Size:
Color:
Disregard the 2nd link, because it's "web ready" i.e. catered to ASP.NET users. The first one seems like it would do the job but there's something wrong with your copy/paste. Here's it (untested, but with a few tweaks):
CODE:
Please log in to see this code.
Size:
Color:
QUOTE:
Black-Scholes? You mean those golf-playing quant characters whose model that ignores fat tails (black swans) lost a few billion dollars for Long Term Capital Management in the wake of Russian default? Will the bail outs ever stop!? :)
He, he, he, he! That's really funny!! :D :D
Lets not forget they got
Nobel Prize for their work!
================
Thanks for the quick response, Eugene!
It is my hope some day its included in WL6 Community Components (or Indicators). BUT... before you do that one would need to verify if the values are reasonably accurate. It will take me quite a bit of time to do that; hopefully, some other user will beat me to it.
Size:
Color:
Right, and let's also not forget they gave our President, in charge of 2 wars, the Nobel Peace Prize.
Size:
Color:
Well said.
Size:
Color:
The formula doesn't work. Test code:
CODE:
Please log in to see this code.
For Calls, it just returns the value of the stock price (the first variable) even if you keep changing other variables.
For Puts also, returns silly values.
Can you identify where the formula is broken?
Size:
Color:
In your parameters. 60 years to maturity? That's some long-term investment horizon.
Size:
Color:
Most formulas convert the time input, usually in days, into years internally. Perhaps this one doesn't. Regardless, you can test these parameters:
CODE:
Please log in to see this code.
where the strike price and stock price are same, T is 0.06....and you still get silly results.
Or choose any parameters that you fancy.
Size:
Color:
OK I agree and suggest contacting its author(s) at espenhaug.com.
Size:
Color:
Uh, all right. All I was trying to do was see if you could quickly spot where the formula was failing, because at a quick glance I sure couldn't.
*/
Different question: Can you point me to source code of an indicator that returns a value, not a series? I have studied the code for most indicators but they all create series.
Size:
Color:
If you're looking for an example of the Value method implementation in an indicator, consider digging in TASCIndicators (you won't find one in Community Indicators yet).
Size:
Color:
I went through all the TASC indicators' source code, they are all creating series. Can you point me to a specific indicator? Even better, how would you implement the Value method on the BS formula above? (faulty though the indicator is, I could learn from the example - which is all I need).
Size:
Color:
All indicators have a Series method. That's required. A Value method only makes sense for indicators that are "stable", unlike EMA, ATR, etc.
So, in TASCIndicators you'll find Value methods, for example, in Alpha, BearPowerVG, BullPowerVG, CG, FIRSmoother, TTF, ...
Size:
Color:
Those Value methods are a subset of the Dataseries method, so extrapolation is a bit difficult for me. Can you point to an indicator/function that only uses the Value method? (Or, if you are not going out to play golf with Black & Scholes ;) ;) can you convert the formula above into an indicator using the Value method?)
*/
Oh, and thinking about the fact the code doesn't convert rates and times, etc. into decimal and year(s) internally made me realize that it actually wants the input in that format. So the original test code needs to be modified thus:
CODE:
Please log in to see this code.
and that yields the values one would expect! So the formula is right after all.
Size:
Color:
I quickly checked some values generated by this formula against a couple of option calculators on the internet - www.cboe.com and
http://www.margrabe.com/OptionPricing.html; while all three generate slightly different values, they are all reasonably close. So the formula may be included as a community indicator/study, if you wish.
Size:
Color:
Good catch. I'll add it to Community Components in the upcoming update.
Size:
Color:
May I make a suggestion? It might be better to modify the formula so that its more user-friendly - one that accepts time in days, percentages as whole numbers (thus 60 days will be input as 60, not as 0.1643835, 1% as 1, not as 0.01, etc); just a couple of lines of code will need to be added so that the formula can internally convert the input numbers into the required format.
Size:
Color:
Feel free to modify it. I'll appreciate if you could submit your changes to me.
Size:
Color:
Here you are, Eugene.
CODE:
Please log in to see this code.
Size:
Color:
Thank you.
Size:
Color:
Thank you, too. It was a collaborative effort.
Size:
Color:
Added to Community Components 2010.10.
Size:
Color:
Very interesting.
Has anyone actually used BS to track options in Wealth-Lab, or is it being used strictly as an indicator to track potential option prices on the main symbbol?
I would dearly like to see some examples of how to code the changes of the days remaining, perhaps based on the "IsOptionExpiryDate" method, and cycling to the next option expiration monthe, after the current option expires.
Thanks,
Eb
Size:
Color:
QUOTE:
I would dearly like to see some examples of how to code the changes of the days remaining, perhaps based on the "IsOptionExpiryDate" method, and cycling to the next option expiration monthe, after the current option expires.
Hope this helps:
TradingDaysBetweenDatesDaysBetweenDates
Size:
Color:
Yes indeed,
Thanks very much.
Size:
Color: