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 05-02-2007, 01:30 AM   #1
BradB
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 180
Thanks: 0
Thanked 1 time in 1 post
Post imported post

I put together a little indicator that changes the background color (backcolor=) for bars that occur during a specified period of the day, based on parameters. What I would like to do is allow someone to choose their own background color from the Indicators panel, like a normal plotted indicator, but I'm not really doing a plot here. Any suggestions?
BradB is offline  
Reply With Quote
Old 05-02-2007, 01:36 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Post imported post

Please try setting up an indicator with one plot and just don't set any value for the plot series. You then should be fine.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-02-2007, 01:52 AM   #3
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post


Take a look at the source code for VolumeProfile indicator.

Pay attention to the following:

Color variables under the Variables section Color properties under the properties section

- You need to include a property that exposes the color variable

- You need to include a property that serializes the color
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-08-2007, 02:17 PM   #4
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default

Some what of a follow up question. I am using BackColorAll and this paints the entire chart. Is there a way of limiting the painting of the background to just the panel that the indicator is running in? If my indicator is running in panel 2, I just want the background area of panel 2 painted. Right now I get panel 1 and 2 painted.
scjohn is offline  
Reply With Quote
Old 05-08-2007, 02:22 PM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Have you tried the property BackColor ?

See this link - http://www.ninjatrader-support.com/H...BackColor.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-09-2007, 07:29 AM   #6
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default

Thanks, That did the trick.

A suggestion: IN the documentation maybe you could cross link property(s) that are similar in nature, like BackColor and BackColorAll.
scjohn is offline  
Reply With Quote
Old 05-09-2007, 07:39 AM   #7
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Thanks for your suggestion.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-23-2007, 11:45 PM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Does BackColor and BackColorAll only work for indicators? I can't quite seem to get it to paint its colors in my strategy.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-24-2007, 02:38 AM   #9
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Yes it should.

In case it does not:
- please post simple-as-possible indicator and startegy to demonstrate the problem
- which instrument and time frame did you try?

Thanks
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-24-2007, 04:01 AM   #10
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

From what you are saying it seems like I need an indicator that utilizes BackColor on my charts for when I run a strategy for it to paint anything. What I was hoping for was to be able to call the BackColor() from within my strategy without having to go to an indicator. I just wanted to paint the bars where my strategy entered and where it exited to make it stand out more.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-24-2007, 05:41 AM   #11
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Sorry, misunderstanding. Yes BackColor(All) works for strategies as well.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 11-17-2008, 11:57 AM   #12
maitreja
Junior Member
 
Join Date: Apr 2008
Posts: 25
Thanks: 0
Thanked 0 times in 0 posts
Default

Hallo, I'm resolving this:

My main chart for manual trading is NQ. I want to change background of this chart in depence of NYSE TICK, e.g. Tick is > 900, I want to change backcolor to green, TICK is < -900, backcolor has to be red. I have read here that it's not possible to create indicator depending on two different instruments. So I tried to create strategy, but it doesn't work. How to join strategy to chart?
Thanks
maitreja

if(BarsInProgress == 1){
if(Close[0] < -900 ){
BackColorAll = Color.Red;
}
else if(Close[0] > 900){
BackColorAll = Color.Green;
}
}
maitreja is offline  
Reply With Quote
Old 11-17-2008, 12:05 PM   #13
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Hi maitreja,

To add a strategy to a chart you need to first be connected to a data feed.
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-17-2008, 12:48 PM   #14
maitreja
Junior Member
 
Join Date: Apr 2008
Posts: 25
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh, I'm connected
maitreja is offline  
Reply With Quote
Old 11-17-2008, 12:52 PM   #15
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Press Ctrl+S from your chart to bring up the Strategy selection window. You will then need to add your strategy to the chart.
NinjaTrader_Josh 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


All times are GMT -6. The time now is 05:36 AM.