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

Reply
Old 12-13-2008, 12:26 AM   #1

Join Date: Dec 2007
Location: Longwood
Posts: 28
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Help with Creating a 9/30 Crossover Paintbar Indicator

I have no coding experience with tradestation, so I'm not sure if I can do this. I'd like to create a paintbar indicator that will change candle colors when the 9ema crosses the 30wma. Blue when the 9ema crosses above the 30wma, and red when the reverse occurs. Is it possible to do, and if so how would I go about getting started to figure it out?
Disco Scottie is offline  
Reply With Quote
Old 12-13-2008, 07:54 AM   #2

Join Date: Apr 2007
Posts: 6
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Re: Help with Creating a 9/30 Crossover Paintbar Indicator

Code:
If {yourMA1} > {yourMA2} then PlotPB(H,L,O,C,"Long",Blue) else PlotPB(H,L,O,C,"Short",Red);
This eats up Plot1-4, so if you want to plot the MAs from the same indicator code you'll have to start with Plot5({yourMA},"MA");

I haven't used TS in ages, but back in the day it would only allow 4 plots per indicator. I'm assuming they've gotten beyond this by now.

Last edited by chop51; 12-13-2008 at 07:58 AM. Reason: weird formatting without the [code] tags
chop51 is offline  
Reply With Quote
Old 12-12-2010, 11:12 PM   #3

Join Date: Nov 2010
Posts: 4
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with Creating a 9/30 Crossover Paintbar Indicator

TS has one built in on the platform
Look for under paintbar studies.
You will see paint bar study MA Avg crossover.
Just plot and change the lengths of the MA to what you like
pgain is offline  
Reply With Quote
Old 12-13-2010, 04:38 AM   #4

Join Date: Jul 2010
Posts: 60
Ignore this user

Thanks: 13
Thanked 15 Times in 13 Posts

Re: Help with Creating a 9/30 Crossover Paintbar Indicator

Hi Disco,
pgain is correct,

If you still find difficulties in finding the code, here it is.. just copy and paste it into a new paintbar.

Code:
inputs: 
	Price( Close ), 
	FastLength( 7 ), 
	SlowLength( 14 ), 
	UpColor( Cyan ), 
	DnColor( Blue ) ;

variables: 
	FastAvg( 0 ), 
	SlowAvg( 0 ) ;

FastAvg = Average( Price, FastLength ) ;
SlowAvg = Average( Price, SlowLength ) ;

if FastAvg > SlowAvg then 
	begin
	PlotPaintBar( High, Low, "MACross", UpColor ) ;
	Alert( "FastAvg above SlowAvg" ) ;
	end
else if FastAvg < SlowAvg then
	begin
	PlotPaintBar( High, Low, "MACross", DnColor ) ;
	Alert( "FastAvg below SlowAvg" ) ;
	end
else
	NoPlot( 1 ) ; { unpaint the bar }
Looking forward to help you to achieve your trading Goals ..

Good Luck,
Easytrader_I.
EasyTrader_I is offline  
Reply With Quote

Reply

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
Trend Indicator Paintbar Squire69 Coding Forum 12 08-15-2010 05:11 PM
moving average crossover with volume surge cjstrader5 Technical Analysis 6 02-07-2009 06:56 AM
Creating Gap-downs by Hitting Bids? RobinHood Beginners Forum 4 08-29-2008 11:24 AM
Creating a RSS Feeder for News brownsfan019 Market Analysis 10 05-25-2008 09:33 AM
Up and DownTicks PaintBar jojojo Coding Forum 0 11-15-2007 04:05 AM

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