Hallo Forum
I've created my own "Range" indicator inspired by the "Bollinger bands", allowing me to always keep track of where the Close is relative to its 52 week High/Low. The formula looks like this.
function preMain() {
setDefaultBarFgColor(Color.white, 0);
setStudyTitle("Range");
setCursorLabelName("Range");
addBand( 50, PS_SOLID, 3, Color.black, 0);
}
function main ()
{return (close()-llv(252,low()))/(hhv(252,high())-llv(252,low()))*100}
Suposse I'm dealing with a stock in an extensive uptrend and it turnes out that the last time it produced what I call a genuine "All Time Low" (AroonDown (set to 252) = 100) was way more than 252 days ago; then I would have to not only replace the LLV/HHV functions with the AroonUp & AroonDown indicators, I would also have to reference that particular "ATL" which was produced the last time AroonDown (set to 252) went to a 100. In Metastock you use the "ValueWhen" function to do it:
(C-ValueWhen(1,AroonDown(252) = 100,L))/(ValueWhen(1,AroonUp(252) =100,H)-ValueWhen(1,AroonDown(252) = 100,L))
What I would like to know is whether there exsists a similar functionallity in Java script?
Kind reagrds
Gotan4711
I've created my own "Range" indicator inspired by the "Bollinger bands", allowing me to always keep track of where the Close is relative to its 52 week High/Low. The formula looks like this.
function preMain() {
setDefaultBarFgColor(Color.white, 0);
setStudyTitle("Range");
setCursorLabelName("Range");
addBand( 50, PS_SOLID, 3, Color.black, 0);
}
function main ()
{return (close()-llv(252,low()))/(hhv(252,high())-llv(252,low()))*100}
Suposse I'm dealing with a stock in an extensive uptrend and it turnes out that the last time it produced what I call a genuine "All Time Low" (AroonDown (set to 252) = 100) was way more than 252 days ago; then I would have to not only replace the LLV/HHV functions with the AroonUp & AroonDown indicators, I would also have to reference that particular "ATL" which was produced the last time AroonDown (set to 252) went to a 100. In Metastock you use the "ValueWhen" function to do it:
(C-ValueWhen(1,AroonDown(252) = 100,L))/(ValueWhen(1,AroonUp(252) =100,H)-ValueWhen(1,AroonDown(252) = 100,L))
What I would like to know is whether there exsists a similar functionallity in Java script?
Kind reagrds
Gotan4711
Comment