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

Notification

Icon
Error

Options
Go to last post Go to first unread
PTJim  
#1 Posted : Tuesday, July 25, 2006 6:17:37 PM(UTC)
PTJim

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/10/2006(UTC)
Posts: 252

Thanks: 11 times
Was thanked: 9 time(s) in 6 post(s)
Specifically, I'm wondering if MS has an ability to color the area between two bands, as illustrated in the July 2006 issue of Technical Analysis of Stocks & Commodities magazine, pages 50 and 78 in a discussion of Wilson Relative Price Channels. Without commenting on the merits of the Wilson technique, it would be useful to have this ability at times - see how it highlights the Bullish range and the Bearish range. Have checked the MS manual and Properties settings for bands but can't find any way to do it, nor do I see anything in the TASC code listings, although it's shown for other TA software platforms. For those who don't have the magazine, picture (for example) coloring in the area between the upper Bollinger Band and the moving-average line. If it's not possible, I'd vote for putting it on the MetaStock Wishlist, along with a simple way to specify colors +/- a specific point (like green/red for MACD Histogram +/- 0).
wabbit  
#2 Posted : Tuesday, July 25, 2006 11:35:32 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
The is no discrete way to colour a region, but there is a work around.... --8<---------------------------------------- {Shaded Regions} {shades the region between two lines} x0:=Mov(C,10,S); {line 1} x1:=Mov(C,200,S); {line 2} If(x0>x1,If(Mod(Cum(1),2)=0,x0,x1),x0); If(x0>x1,If(Mod(Cum(1),2)=0,x1,x0),x0); If(x1>x0,If(Mod(Cum(1),2)=0,x0,x1),x1); If(x1>x0,If(Mod(Cum(1),2)=0,x1,x0),x1); x0;x1; --8<---------------------------------------- Judicious use of colours, line styles and weights can have some interetsing effects. Hope this helps. wabbit :D
Jose  
#3 Posted : Tuesday, July 25, 2006 11:55:11 PM(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)
Try this "Boll Band filler" indicator: [code:1:9bad6a4d15] {©Copyright 2002~2006 Jose Silva. For personal use only. http://www.metastocktools.com } { User inputs } pds:=Input("Bollinger Bands periods",1,2520,21); dev:=Input("BB Std Deviation",0,10,1); { Boll Bands } band1:=BBandTop(C,pds,S,dev); band2:=BBandBot(C,pds,S,dev); { Boll Bands filler } even:=Frac(Cum(1)/2)=0; filler1:=If(even,band1,band2); filler2:=If(even,band2,band1); { Plot on price chart } filler1; { <- Bright Green } filler2; { <- Bright Green } band1; { <- Red } band2; { <- Blue } [/code:1:9bad6a4d15] jose '-)
Jose  
#4 Posted : Wednesday, July 26, 2006 12:07:40 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)
You've beat me to it, Wabbit - I thought you'd be busy working on your better logic. ;) jose '-)
wabbit  
#5 Posted : Wednesday, July 26, 2006 12:32:16 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
No need.... because you beat me to it!! ;) And, just for good measure I should update this shading code that I was playing with ages ago, to refine its logic... --8<---------------------------------------- {Shaded Regions} {shades the region between two lines} x0:=Mov(C,10,S); {line 1} x1:=Mov(C,200,S); {line 2} even:=Mod(Cum(1),2)=0; If(x0>x1,If(even,x0,x1),x0); If(x0>x1,If(even,x1,x0),x0); If(x1>x0,If(even,x0,x1),x1); If(x1>x0,If(even,x1,x0),x1); x0;x1; --8<---------------------------------------- wabbit :D
Jose  
#6 Posted : Wednesday, July 26, 2006 1:29:54 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)
...Which can then be further simplified this way: [code:1:19020eaa73] {Shaded Regions} {shades the region between two lines} x0:=Mov(C,10,S); {line 1} x1:=Mov(C,200,S); {line 2} even:=Mod(Cum(1),2)=0; If(even,x0,x1); If(even,x1,x0); x0;x1; [/code:1:19020eaa73] jose '-)
wabbit  
#7 Posted : Wednesday, July 26, 2006 7:08:11 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
I can't remember the exact pattern, but I added the extra lines to allow for two lines inside the "shaded region" with the two envelope lines. I used to have something like your code, but found that if I got the combination of colours, line styles and weights right, I ended up with something that looked much more funky... It wasn't any more useful... just more fun to look at! wabbit :D
PTJim  
#8 Posted : Wednesday, July 26, 2006 5:28:32 PM(UTC)
PTJim

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/10/2006(UTC)
Posts: 252

Thanks: 11 times
Was thanked: 9 time(s) in 6 post(s)
Thank you, guys. I had a feeling that, if I'd missed a built-in MS parameter, one or more of you would have a workaround. Sure enough. Youse guys are good.
Derek Worswick  
#9 Posted : Thursday, July 1, 2010 7:25:12 AM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi,

Is it possible the restrict the Shaded Region betwen "horizontal line 1" & "horizontal line 2"

to say the last 50 days of the Chart ( if Cum(1)=Lastvalue(cum(1)-50) }

{Shaded Regions}
{shades the region between two lines}

-----------8<----------------------------------------------

Line1:=Input("horizontal line 1",0.65,15000,970);
Line2:=Input("horizontal line 2",1.00,15000,934);
x0:=Line1;
x1:=Line2;

even:=Mod(Cum(1),2)=0;
If(even,x0,x1);
If(even,x1,x0);

x0;x1;

---------8<-------------------------------------------------

Kind regards,

Derek

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.