Hi,
I am newly stuck on something I am working on. And so i really need your precious help.
I have a dataset of closing prices of a stock(nbmps) on which i want to calculate the moving averages and the upper and lower bands such as the bollinger band indicator.
I found somewhere few hints about what i am trying to do and i write my code as follow:
gen moveave1= (F1.nbmps+nbmps+L1.nbmps)/4
gen upperband= moveave1*1.04
gen lowerband= moveave 1*0.96
Here's the problem:
line nbmps moveave1 uppperband lowerband Data
when I plot the drawing shows me 4 lines (1 of prices and it's ok) and the other 3 are give or take equal, they do not differ in position, they are overlaid.
I read that usually to generate the upper band somebody use 0.04+SMA.
But i don't know, even because I am a newbie user of stata so maybe I am writing something wrong.
All answers are welcome
Thank for your collaboration
Chris
I am newly stuck on something I am working on. And so i really need your precious help.
I have a dataset of closing prices of a stock(nbmps) on which i want to calculate the moving averages and the upper and lower bands such as the bollinger band indicator.
I found somewhere few hints about what i am trying to do and i write my code as follow:
gen moveave1= (F1.nbmps+nbmps+L1.nbmps)/4
gen upperband= moveave1*1.04
gen lowerband= moveave 1*0.96
Here's the problem:
line nbmps moveave1 uppperband lowerband Data
when I plot the drawing shows me 4 lines (1 of prices and it's ok) and the other 3 are give or take equal, they do not differ in position, they are overlaid.
I read that usually to generate the upper band somebody use 0.04+SMA.
But i don't know, even because I am a newbie user of stata so maybe I am writing something wrong.
All answers are welcome
Thank for your collaboration
Chris
Comment