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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 09-01-2011, 02:57 PM   #1
gbrest
Junior Member
 
Join Date: May 2009
Location: Tonganoxie, Kansas
Posts: 18
Thanks: 1
Thanked 0 times in 0 posts
Default How do I make a public value NOT display?

I have a DataSeries I am passing to another program to use there and for backtesting. I defined the series in Initialize() as follows:

Add(new Plot(new Pen(Color.Transparent, 1), PlotStyle.Line, "AdxDirection"));

In the properties section I added:

[Browsable(false)]
[XmlIgnore()]
public DataSeries AdxDirection
{
get { return Values[6]; }
}

Everything works fine. I just don't want the value of AdxDirection to display in the Plots section of the indicator. I want it to be 'invisible' to everyone except the program. I tried just making AdxDirection a variable as follows:

public DataSeries AdxDirection;

...and that worked fine except I get a sereailization error when I try to save the workspace. Any ideas?

gbrest is offline  
Reply With Quote
Old 09-01-2011, 03:05 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
Default

Hello,

When you say the plots section of the indicator, do you mean the indicator settings? Or you want to hide the plot completely from the chart/display?

If you're referring to the plots section of the indicator parameters, please add PlotsConfigurable = false; in the Initialize() section.

This cannot be configured per plot - it will disable all of the plots from being configurable

If you were speaking of the chart/display, setting the plot to transparent should hide it. Can you point me to where exactly this is displaying?
NinjaTrader_Matthew is offline  
Reply With Quote
Old 09-01-2011, 08:17 PM   #3
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

Just kill (delete or comment out) the plot instruction and properties. I presume you will be storing double values. If integer, 1 = up, -1 = down?, use IntSeries or String Series if "U" and "D".

Define your DataSeries in Vars

private DataSeries adxDirectionSeries;

create it in initialize

adxDirectionSeries = new DataSeries(this);

set the value in OnBarUpdate?

adxDirectionSeries.Set(xyz);

Expose it in Properties

[Browsable(false)]
[XmlIgnore()]
[Description("ADX Whatever")]
public DataSeries AdxDirection
{
get { Update();
return adxDirectionSeries; }
}

This will create the public DataSeries w/o a plot.
snaphook is offline  
Reply With Quote
The following 2 users say thank you to snaphook for this post:
Old 09-02-2011, 06:22 AM   #4
gbrest
Junior Member
 
Join Date: May 2009
Location: Tonganoxie, Kansas
Posts: 18
Thanks: 1
Thanked 0 times in 0 posts
Default

Snap-
GREAT answer!!! Thank you very much. You hit the nail dead on the head!!
gb
gbrest 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
Public DataSeries neb1998 Indicator Development 3 06-23-2011 10:53 AM
How to make indicator display simple colored status Lonneman Indicator Development 4 05-31-2011 10:38 AM
Calling public Variables gg80108 General Programming 1 03-11-2010 02:11 PM
Public Beta In Sight? jeremymgp Version 7 Beta General Questions & Bug Reports 1 01-22-2010 11:28 AM
Initializing a public DataSeries RandyT General Programming 11 08-25-2009 11:05 AM


All times are GMT -6. The time now is 10:01 PM.