NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 02-23-2009, 12:01 PM   #1
ninja.man
Junior Member
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default .Reset() plots close values, not null values

Hello,

I am working on an indicator that plots the low of the day, if that day’s low is lower than the previous day’s low.

Specifically, a day’s low is added to a DataSeries if the day makes a lower low. If the day doesn’t make a new low, the DataSeries stores a null value using the .Reset() method.

The problem I am experiencing is that the .Reset() method doesn’t seem to be setting a null value. When the indicator is added to a chart, the instances where a null value is expected are plotted on the chart as the day’s Close Value. I have checked my code and cannot see a reason why it is plotting the Close.

The indicator is attached.

For the sake of clarification, I have also attached and a .png showing the indicator as it currently plots and also showing how I would like it to plot.

Is there anyway to achieve the desired indicator plot (as shown in the .png).

Many thanks.
Attached Images
File Type: gif 001.png (54.1 KB, 15 views)
Attached Files
File Type: zip TestIndicator.zip (1.8 KB, 6 views)
ninja.man is offline  
Reply With Quote
Old 02-23-2009, 01:22 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Hi ninja.man, please check this link - http://www.ninjatrader-support.com/H...iesObject.html

The Reset() method will differentiate between 'visualization' and 'plotting', meaning the null value will be stored internally for calculations, but is not used in plotting as this may not be visually appealing.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-23-2009, 01:42 PM   #3
ninja.man
Junior Member
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default

Hello Bertrand,

I looked through that page in the hope of finding a solution before I posted on the forum, and modeled my code specifically on what that page contains--still I am getting a plot at the close of the day, rather than a null value. Perhaps if you have the time you can take a minute to review the code in the indicator I posted. It is very simple and should take just a moment to see where the error is. I myself have triple checked it, but as I am not a programmer, I do not see where I am making the mistake!
ninja.man is offline  
Reply With Quote
Old 02-23-2009, 03:41 PM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

There is no mistake, the difference is just the null value is stored internally and not used for actual plotting of the indicator.

You may want to check this reference sample for an idea how to connect Plots with the DataSeries object - http://www.ninjatrader-support2.com/...ead.php?t=3227
NinjaTrader_Bertrand 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 instrument strategies and Close[1] values Operandi Strategy Development 1 09-17-2008 03:46 AM
Can indicators return values other than Plot values? higler General Programming 2 04-29-2008 05:17 AM
Indicator: Exposing indicator values that are not plots NinjaTrader_Josh Reference Samples 0 01-15-2008 02:27 AM
Reset values in a DataSeries Rollins Indicator Development 2 12-09-2007 01:05 AM
Where do I enter "close at time" values? dberliner SuperDOM and other Order Entry Windows 1 11-02-2006 06:39 AM


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