On veritrader 1.5 we have the ability to use a counter trend system based on bolly band breaks and targets.
Since Bollinger bands are a moving target .. lets suppose we have a system that sells at 2 standard deviation above theM.A and buys back at 0.5 below. If the trade is triggered and the market moves in our favour the bolly bands move lower too ... so the question is does one place the order at the beginning of the day and take profit if that level is seen ? or wait until we see a penetration during a particular day as these 2 could be at different levels.
Thanks for any comments
Chris
Bollinger Band Targets
Bolly Band VBA code required
Dear All,
Does anyone have a link or code for calculating a Bolly Band in VBA?
Thanks in advance
WiseOwl
Does anyone have a link or code for calculating a Bolly Band in VBA?
Thanks in advance
WiseOwl
don't know whether it will feed your need, but Futures Magazine offers an free spreadsheet to calculate BB, check http://www.futuresmag.com/downloads/files/bbands.zip
Cheers Cnyub!
Didn't get it on Futures Mag...but here's my version
SimpleMA = CalcSimpleMA(I, BollingerRange)
OneStandardDeviation = CalcOneStandardDeviation(I, BollingerRange, SimpleMA)
CurrentBollingerLowerBand = Round(SimpleMA - (SDStop * OneStandardDeviation), 0)
Function CalcSimpleMA(I, BollingerRange)
Rem TypicalPrice = 0
WeightedPrice = 0
For n = I - (BollingerRange - 1) To I
TodaysHigh = Range(HighCol & n)
TodaysLow = Range(LowCol & n)
TodaysClose = Range(CloseCol & n)
Rem TypicalPrice = TypicalPrice + ((TodaysHigh + TodaysLow + TodaysClose) / 3)
WeightedPrice = WeightedPrice + ((TodaysHigh + TodaysLow + TodaysClose + TodaysClose) / 4)
Next
Rem SimpleMA = TypicalPrice / BollingerRange
CalcSimpleMA = WeightedPrice / BollingerRange
End Function
Function CalcOneStandardDeviation(I, BollingerRange, SimpleMA)
SumSigmaSquare = 0
For n = I - (BollingerRange - 1) To I
TodaysLow = Range(LowCol & n)
SumSigmaSquare = SumSigmaSquare + ((SimpleMA - TodaysLow) ^ 2)
Next
SigmaSquare = SumSigmaSquare / BollingerRange
CalcOneStandardDeviation = Sqr(SigmaSquare)
End Function
Didn't get it on Futures Mag...but here's my version
SimpleMA = CalcSimpleMA(I, BollingerRange)
OneStandardDeviation = CalcOneStandardDeviation(I, BollingerRange, SimpleMA)
CurrentBollingerLowerBand = Round(SimpleMA - (SDStop * OneStandardDeviation), 0)
Function CalcSimpleMA(I, BollingerRange)
Rem TypicalPrice = 0
WeightedPrice = 0
For n = I - (BollingerRange - 1) To I
TodaysHigh = Range(HighCol & n)
TodaysLow = Range(LowCol & n)
TodaysClose = Range(CloseCol & n)
Rem TypicalPrice = TypicalPrice + ((TodaysHigh + TodaysLow + TodaysClose) / 3)
WeightedPrice = WeightedPrice + ((TodaysHigh + TodaysLow + TodaysClose + TodaysClose) / 4)
Next
Rem SimpleMA = TypicalPrice / BollingerRange
CalcSimpleMA = WeightedPrice / BollingerRange
End Function
Function CalcOneStandardDeviation(I, BollingerRange, SimpleMA)
SumSigmaSquare = 0
For n = I - (BollingerRange - 1) To I
TodaysLow = Range(LowCol & n)
SumSigmaSquare = SumSigmaSquare + ((SimpleMA - TodaysLow) ^ 2)
Next
SigmaSquare = SumSigmaSquare / BollingerRange
CalcOneStandardDeviation = Sqr(SigmaSquare)
End Function
Unfortunately, the Futures magazine spreadsheet contains an error. The proper volatility function for calculating Bollinger Bands in Excel is =stdevp(), not stdev().
jab
http://www.BBands.com/
jab
http://www.BBands.com/