tradingjamie
Newbie
- Messages
- 4
- Likes
- 0
Hello All,
Would anyone be able to help me coding a straight envelope in prorealtime please.
Essentially, the code I have so far is:
where COEFF (the coefficient) is a user defined variable, which I set to default to 0.05
Now the problem is that 0.05 doesn't work for all stocks - so that I find for some stocks I need to manually adjust COEFF to make the envelope fit the stock properly (i.e. the envelope touches the highest high made in the past 3 months, or lowest low)
Does anyone know how to do this?
Thanks
Would anyone be able to help me coding a straight envelope in prorealtime please.
Essentially, the code I have so far is:
Code:
myEma= exponentialaverage[21](close)
upperband = myEma +(myEma * COEFF)
lowerband = myEma -(myEma * COEFF)
return upperband,lowerband
where COEFF (the coefficient) is a user defined variable, which I set to default to 0.05
Now the problem is that 0.05 doesn't work for all stocks - so that I find for some stocks I need to manually adjust COEFF to make the envelope fit the stock properly (i.e. the envelope touches the highest high made in the past 3 months, or lowest low)
Does anyone know how to do this?
Thanks