NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-08-2007, 10:57 AM   #1
avlasov
Junior Member
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Thumbs up Sma To Plot Color Bars Not Lines

Hello, I am trying to edit/develop a simple indicator which will plot colored bars instead of lines.(so when its an up cross all bars are one color and when its a down cross bars are another color.

I was looking at editing the heikenashi, cut out the code and enter something like "if ma1 cross over ma2, plot green".. you get the point. I did this on tradestation, however it will take me a little while to get used to ninjascript

any advice how to convert ma crosses into bars?

thank you
avlasov is offline  
Reply With Quote
Old 12-08-2007, 01:11 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Instead of PlotStyle.Line use PlotStyle.Bars when you are adding the plot in the Initialize() method.

http://www.ninjatrader-support.com/HelpGuideV6/Add.html
http://www.ninjatrader-support.com/H...deV6/Plot.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-08-2007, 01:55 PM   #3
avlasov
Junior Member
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default plot

thank you, yes thats what I tried before.
However the lines go all over the screen and not on the bars ... I must be doing it wrong.
avlasov is offline  
Reply With Quote
Old 12-08-2007, 03:32 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Are you trying to just paint the price bars a different color? If thats the case then you want to use BarColor = Color.Green. Or something like that.

http://www.ninjatrader-support.com/H.../BarColor.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-08-2007, 03:37 PM   #5
avlasov
Junior Member
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default !

Right on the money! thank you there Josh. TradeStation spoiled me I guess. haha.
avlasov is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Color Plot Question TraderGuy General Programming 2 11-12-2007 04:39 PM
Use Indicator plot color in DrawLine() MJT Indicator Development 1 06-01-2007 03:13 PM
Color Plot Problem on Modified CCI Indicator KBJ Indicator Development 5 04-18-2007 01:21 PM
Changing Plot color within code tquinn Indicator Development 8 02-19-2007 08:27 AM
How to plot text (outside of bars) richard Indicator Development 1 06-07-2006 08:31 PM


All times are GMT -6. The time now is 03:27 PM.