logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jose  
#1 Posted : Friday, April 8, 2005 2:16:39 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula below. [code:1:634d49a949] ========================= Keltner & Bollinger Bands ========================= ---8<--------------------------- { ©Copyright 2004~2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User inputs } pds:=Input("Keltner/Bollinger Bands periods", 1,252,10); spread:=Input("Keltner Bands % spread", 0,1000,100)/100; dev:=Input("Bollinger Bands deviation", .001,10,1); plot:=Input("[1]Keltner, [2]Bollinger, [3]Keltner+Bollinger",1,3,1); { Keltner bands } KBmid:=Mov(Typ(),pds,S); KBtop:=KBmid+Mov(H-L,pds,S); KBtopDiff:=(KBtop-KBmid)*spread; KBtop:=KBmid+KBtopDiff; KBbot:=KBmid-Mov(H-L,pds,S); KBbotDiff:=(KBbot-KBmid)*spread; KBbot:=KBmid+KBbotDiff; KBwidth:=KBtop-KBbot; KBwidthAvg:=Cum(KBwidth)/Cum(KBwidth>-1); { Bollinger bands } BBtop:=BBandTop(C,pds,S,dev); BBmid:=Mov(C,pds,S); BBbot:=BBandBot(C,pds,S,dev); { Plot on price chart } If(plot=1,KBtop,BBtop); If(plot=1,KBmid,If(plot=2,BBmid,KBtop)); If(plot=1,KBbot,BBbot); If(plot=1,KBbot,If(plot=2,BBbot,KBbot)) ---8<--------------------------- [/code:1:634d49a949] jose '-) http://www.metastocktools.com
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.