BBW for another ticker than actual

Hi!

Is it possible to get the BBW for one ticker when I´m working with another ticker?

If so, how?
I tried the function Foreign, but I can´t get BBW with this function.

Best regards,
Leif Axelsson
Sweden

What is BBW?
Do you mean Bollinger Bands Width?

frg = Foreign( "^GSPC", "C");

frgBBtop = BBandTop(frg, 20, 2);
frgBBbottom = BBandBot(frg, 20, 2);
frgBBmid = MA(frg, 20);

BBW = (frgBBtop -frgBBbottom)/frgBBmid;

I just looked into Charts - Bands folder and there is formula of BBands width there. So you just have to replace ParamField by Foreign there and save AFL to new file name.

P = Foreign( "^GSPC", "C"); // ParamField( "Price field BB", -1 );

Sorry, there isn't bands width in Charts - Bands folder. It is an AFL made by myself. But second post has code of BBW. :slight_smile:

Thank You for all help!

/Leif