Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 03-08-2009, 11:48 PM   #1

Join Date: Apr 2008
Location: Chicago
Posts: 14
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Bollinger Band Shading in Tradestation

Hi:
Does anyone know if there is a way to shade in the area between upper/lower Bollinger Bands as shown in attached pic?

Thanks!
Attached Thumbnails
Bollinger Band Shading in Tradestation-bb-shading.jpg  
dhelmin is offline  
Reply With Quote
Old 03-09-2009, 12:10 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Bollinger Band Shading in Tradestation

not with EasyLanguage.

:-(
Tams is offline  
Reply With Quote
Old 03-09-2009, 10:33 AM   #3
zdo

Join Date: Nov 2007
Location: boonies
Posts: 1,349
Ignore this user

Thanks: 317
Thanked 355 Times in 256 Posts
Blog Entries: 104

Re: Bollinger Band Shading in Tradestation

see solidus's posts re shading etc on TS forums... it can be done...
zdo is offline  
Reply With Quote
Old 03-09-2009, 11:36 AM   #4

Join Date: Apr 2008
Location: Chicago
Posts: 14
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Bollinger Band Shading in Tradestation

Thanks ZDO. I think I'm missing something. The only thing I see is where he talks about paintbar colors. Is this what you are talking about?

Variables:
barColorText("White");

Condition1 = Close > Close[1];
Condition2 = Close < Close[1];
Condition3 = Close = Close[1];

If Condition1 then barColorText = "Green"
else if Condition2 then barColorText = "Red"
else if Condition3 then barColorText = "Yellow";

Plot1(barColorText, "Bar Color");
dhelmin is offline  
Reply With Quote
Old 03-09-2009, 11:48 AM   #5

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Bollinger Band Shading in Tradestation

you can mimic painting the background by layering a thick bar behind the price bars as background color.

give this a try:
set the first 2 plots as "bar high" and "bar low".

Code:
inputs:
	BollingerPrice( Close ),
	TestPriceUBand( Close ),
	TestPriceLBand( Close ),
	Length( 20 ),
	NumDevsUp( 2 ),
	NumDevsDn( -2 ),
	Displace( 0 ) ;

variables:
	var0( 0 ),
	var1( 0 ),
	var2( 0 ),
	var3( 0 ) ;

var0 = AverageFC( BollingerPrice, Length ) ;
var1 = StandardDev( BollingerPrice, Length, 1 ) ;
var3 = var0 + NumDevsUp * var1 ;
var2 = var0 + NumDevsDn * var1 ;

condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then 
	begin
	Plot1[Displace]( var3, "bar high" ) ;
	Plot2[Displace]( var2, "bar low" ) ;
	Plot4[Displace]( var3, "UpperBand" ) ;
	Plot5[Displace]( var2, "LowerBand" ) ;
	Plot6[Displace]( var0, "MidLine" ) ;

	                  
	if Displace <= 0 then
		begin
		condition1 = TestPriceLBand crosses over var2 ;
		if condition1 then
			Alert( "Price crossing over lower price band" ) 
		else 
		begin 
		condition1 = TestPriceUBand crosses under var3 ;
		if condition1 then
			Alert( "Price crossing under upper price band" ) ;
		end;
		end ;
	end ;

Attached Thumbnails
Bollinger Band Shading in Tradestation-bb_paintbar.gif  
Tams is offline  
Reply With Quote
Old 03-09-2009, 12:39 PM   #6

Join Date: Apr 2008
Location: Chicago
Posts: 14
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Bollinger Band Shading in Tradestation

Thats exactly what I want to do for tradestation. Thank you!

I made an indicator with your code and on inputs typed high on testpriceUband and low on testpriceLband. It wouldn't accept bar high.

On the chart it just shows a regular Bollinger Band and doesn't show any shading. Any thoughts? thank you for your help!
dhelmin is offline  
Reply With Quote
Old 03-09-2009, 12:48 PM   #7

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Bollinger Band Shading in Tradestation

you have to set these 2 plots as "bar high" and "bar low"

Plot1[Displace]( var3, "bar high" ) ; <--- set this as bar high
Plot2[Displace]( var2, "bar low" ) ; <--- set this as bar low


if you go to Format Study, you will see that I have entered the description of the 2 plots as "bar high" and "bar low".
Tams is offline  
Reply With Quote
Old 03-09-2009, 12:56 PM   #8

Join Date: Apr 2008
Location: Chicago
Posts: 14
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Bollinger Band Shading in Tradestation

I think I'm missing the part where you enter "bar high" "bar low". Under edit Easy Language its already there just as I copied from your code.
dhelmin is offline  
Reply With Quote

Reply

Tags
bollinger bands, moving average

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rubber Band Indicator neal51 Trading Indicators 42 02-05-2012 04:20 PM
Question regarding Bollinger Bands Robert Technical Analysis 22 08-08-2009 10:37 PM
Problem with Better Bollinger Bands HBBHVN Coding Forum 1 02-24-2009 06:12 AM
Indicator for Bollinger Band pajusa Technical Analysis 5 03-20-2008 10:45 AM
Rsi w/Bollinger bands tradestation 8 sergej Coding Forum 8 08-19-2007 06:04 PM

All times are GMT -4. The time now is 12:37 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.