Welcome to the Traders Laboratory Forums.
Technical Analysis The technical discussion forum for traders.

Reply
Old 05-21-2008, 02:11 PM   #1

Join Date: Nov 2007
Posts: 17
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Help with TS Paint Bar

Hi all

I need help with TS paint bar

I like to paint bar with MACD Histogram colors

inputs: FastLength( 12 ),
SlowLength( 26 ),
MACDLength( 9 ) ,

HistabvZeroUpColor(Green) ,
HistabvZeroDwnColor(DarkG reen),
HistblwZeroFallColor(Red) ,
HistblwZeroRiseColor(Dark Red);


variables: MACDValue(0),
MACDAvg(0),
MACDDiff(0);

MACDValue = MACD( Close, FastLength, SlowLength );
MACDAvg = XAverage(MACDValue, MACDLength);
MACDDiff = MACDValue - MACDAvg ;

Plot1( MACDValue, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg" ) ;
{Plot3( MACDDiff, "MACDDiff" ) ;}
Plot4( 0, "ZeroLine" ) ;

var:color(0);
plot3(MACDDiff,"MACDDiff" ,color);

if MACDDiff > 0 Then begin
If MacdDiff > MacdDiff[1] then setplotcolor(3, HistabvZeroUpColor)
else setplotcolor(3, HistabvZeroDwnColor);
end;
if MACDDiff < 0 Then begin
If MACDDiff < MACDDiff[1]then setplotcolor(3, HistblwZeroFallColor)
else setplotcolor(3, HistblwZeroRiseColor);
end;





{ Alert criteria }
if MACDDiff crosses over 0 then
Alert( "Bullish alert" )



thanks in advance
sean is offline  
Reply With Quote
Old 05-21-2008, 06:30 PM   #2

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 292 Times in 105 Posts

Re: Help with TS Paint Bar

Here you go this should do it,

inputs: FastLength( 12 ),
SlowLength( 26 ),
MACDLength( 9 ) ,
HistabvZeroUpColor(Green) ,
HistabvZeroDwnColor( DarkGreen ),
HistblwZeroFallColor(Red) ,
HistblwZeroRiseColor(Dark Red);

variables: MACDValue(0),
MACDAvg(0),
MACDDiff(0);

MACDValue = MACD( Close, FastLength, SlowLength );
MACDAvg = XAverage(MACDValue, MACDLength);
MACDDiff = MACDValue - MACDAvg ;



plotpb(h,l,o,c,"MACDDiff" );

if MACDDiff > 0 Then begin
If MacdDiff > MacdDiff[1] then begin
setplotcolor(1, HistabvZeroUpColor);
setplotcolor(2, HistabvZeroUpColor);
setplotcolor(3, HistabvZeroUpColor);
setplotcolor(4, HistabvZeroUpColor);
end;
If MacdDiff < MacdDiff[1] then begin
setplotcolor(1, HistabvZeroDwnColor);
setplotcolor(2, HistabvZeroDwnColor);
setplotcolor(3, HistabvZeroDwnColor);
setplotcolor(4, HistabvZeroDwnColor);
end;
end;

if MACDDiff < 0 Then begin
If MACDDiff < MACDDiff[1]then begin
setplotcolor(1, HistblwZeroFallColor);
setplotcolor(2, HistblwZeroFallColor);
setplotcolor(3, HistblwZeroFallColor);
setplotcolor(4, HistblwZeroFallColor);
end;
If MACDDiff > MACDDiff[1]then begin
setplotcolor(1, HistblwZeroRiseColor);
setplotcolor(2, HistblwZeroRiseColor);
setplotcolor(3, HistblwZeroRiseColor);
setplotcolor(4, HistblwZeroRiseColor);
end;
end;




{ Alert criteria }
if MACDDiff crosses over 0 then
Alert( "Bullish alert" )




Hope this helps

Blu-Ray
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 05-21-2008, 08:00 PM   #3

Join Date: Nov 2007
Posts: 17
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with TS Paint Bar

wow speed of light - great

thanks
sean is offline  
Reply With Quote

Reply

Tags
paint, paintbar

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
Paint Bar Comparison Robert2617 Technical Analysis 5 11-17-2008 07:00 AM

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