//+-------------------------------------------------------------------+ //| Made/Modified by Alejandro Galindo | //| | //| If this work/modification is helpful to you | //| send me a PayPal donation to ag@elcactus.com | //| any help is apreciated :) | //| Thanks. | //+-------------------------------------------------------------------+ /*[[ Name := BBpB Author := Copyright © 2005 Alejandro Galindo Separate Window := Yes First Color := MediumSeaGreen First Draw Type := Line First Symbol := 217 Use Second Data := No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input: BBPeriod(20); Input: StdDeviation(2); Input: Bars_(300); Variable : shift(0); Variable: BBpB(0); SetLoopCount(0); // loop from first bar to current bar (with shift=0) For shift=Bars_-1 Downto 0 Begin BBpB=(Close[shift]-iBands(BBPeriod,StdDeviation,MODE_LOW,shift))/(iBands(BBPeriod,StdDeviation,MODE_HIGH,shift)-iBands(BBPeriod,StdDeviation,MODE_LOW,shift)); SetIndexValue(shift, BBpB); End;