New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
bollinger band width fn code is written wrong
The distance between two points in 3d space is always positive, hence it can not be calculated without using absolute value, unless you screwed up and wrote the code wrong, which is what they did. In trying to display the bbWidth of the bull bear spread: !AAIIBULL-!AAIIBEAR said chart is formed from bad data. Two questions. Since neither of the givens: !AAIIBULL or !AAIIBEAR are below -100, if I can shift these parameters up, +100 units, then the bbWidth will be properly displayed. Does someone know how to do this, or is there some other kludge that would work? Second question, since Talia at Stockcharts help, who responded to my question by kindly directing me here, made no note of any intent to write a work order to get the code fixed, so it works properly, it would be propitious if someone here knew how to do this, or knew someone to get it done. Absolute value functions in perl or c are not hard to work with, it merely needs to be inserted in the code so that it works properly.
barneyFife
0
Answers
It seems likely the BBwidth function would have been written originally for stocks (before difference charts were available), which do not trade to negative prices, so that case was not considered in the code.
I can't think of too many situations where charts include negative numbers, except this one and in some indicators (and lately, some european and japanese interest rate charts). Also, I'm not sure there is a true theoretical justification for using the indicator as you suggest, although it is interesting. So, my guess is a request to modify stable code in a heavily used indicator for a situation few users encounter might be considered but would probably have to receive a low priority, considering the effort and expense and risk involved in writing, testing and incorporating the change, when weighed against more urgent upgrades and fixes and resources available.
Nevertheless, it might be worthwhile to submit a suggestion to upgrade the BBwidth function, including as much information as you can, and a business-oriented justification. From my experience, suggestions are considered and prioritized and have been implemented, so it's worth a shot.
...so I don't really need the bbWidth. Question Answered, thanks markd.
barneyFife
barneyFife
(!AAIIBULL+100) - (!AAIIBEAR+100)
or
(!AAIIBULL-!AAIIBEAR) + 100
...maybe a syntax I am unaware of " ' ` [ { ?