PureBytes Links
Trading Reference Links
|
The answer is non obvious, or at least it took me a bit to spot. you are
using minus twice for the lower band. Thus the calc gives you an upper band
for the lower band. Hence you don't calculate the % indicator and get a flat
line. So either take the minus sign in the lower band or minus out of the %
calculation and it ought to work.
Good trading.
----- Original Message -----
From: "Thomas J. Festa" <festat@xxxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Sunday, April 03, 2005 9:49 PM
Subject: %b Indicator
> My %b indicator is plotting a flat line at 0.00, can anyone help with the
> following code in TS4.0?
>
> Function: My_Lower_BB
>
> Input: PRICE(Numeric),LENGTH(Numeric),SDEV(Numeric);
> My_Lower_BB = BollingerBand(PRICE, LENGTH, - SDEV);
>
> ======================================================
> Function: My_Upper_BB
>
> Input: PRICE(Numeric),LENGTH(Numeric),SDEV(Numeric);
> My_Upper_BB = BollingerBand(PRICE, LENGTH, SDEV);
>
> ======================================================
> Function: My_PctBollinger
>
> Input: PRICE(Numeric),BBLGTH(Numeric),SDEV(Numeric);
>
> IF My_Upper_BB(PRICE, BBLGTH, SDEV) - My_Lower_BB(PRICE, BBLGTH, -SDEV) <>
0
> Then
>
> My_PctBollinger = ((PRICE - My_Lower_BB(PRICE, BBLGTH, -SDEV)) /
> (My_Upper_BB(PRICE, BBLGTH, SDEV) - My_Lower_BB(PRICE, BBLGTH, -SDEV)));
> ======================================================
> Indicator: My_%b
>
> {%b of Price(Close)}
> {from the book 'Bollinger on Bollinger Bands by John Bollinger C2002}
>
> Inputs: Price(AvgPrice), BBLgth(21), SDev(2);
>
> {Calculate %b with formula %Bollinger = ((Price - My_LowerBB) /
(My_UpperBB
> - My_LowerBB)) }
>
> Value1 = 100 * My_PctBollinger(Price, BBLgth, SDev); { %b in
> percent-value }
>
> Plot1(Value1, "My_%b");
> Plot2(80, "OverBought");
> Plot3(50, "Neutral");
> Plot4(20, "OverSold");
>
>
>
> Thomas J. Festa, CMT
> Proprietary Trader & Technical Analysis Investment Consultant
> Cell: (908) 581-8880
>
> Confidentiality Notice: The information contained in this e-mail and any
> attachments may be legally privileged and confidential. If you are not an
> intended recipient, you are hereby notified that any dissemination,
> distribution, or copying of this e-mail is strictly prohibited. If you
have
> received this e-mail in error, please notify the sender and permanently
> delete the e-mail and any attachments immediately. You should not retain,
> copy or use this e-mail or any attachment for any purpose, nor disclose
all
> or any part of the contents to any other person.
>
>
>
>
|