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 06-04-2010, 12:08 AM   #1
randomwalker
Member
 
Join Date: Mar 2010
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
Default I cannot get this line plot and show in databox

the following is the codes trying to plot a horizontal line of yesterday VWAP on today's intraday chart. However, it just cannot get plot on the chart, any idea?

if (Bars.FirstBarOfSession )
{

if (Time[0].DayOfWeek == DayOfWeek.Monday)
timeOfInterest = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day - 3, 16, 30, 0);
else
timeOfInterest = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day - 1, 16, 30, 0);
}
barsAgo = GetBar(timeOfInterest) ;


Plot0.Set(VWAP().VWAPLine[barsAgo]);
randomwalker is offline  
Reply With Quote
Old 06-04-2010, 06:07 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Any errors in the log tab? Do you include a check for enough CurrentBars at the OnBarUpdate() start? Otherwise you run into issues reaching back at the start of your charts as there're no bars back then to calc for.

http://www.ninjatrader.com/support/f...ead.php?t=3170
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-04-2010, 10:18 PM   #3
randomwalker
Member
 
Join Date: Mar 2010
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
Default

The message from log tab is that:" Error calling the 'OnBarUpdat' method for indicator on bar 78 :year, month and day parameters describle an unrepresentable datetime" And I run another indicator "SampleGetBar" downloaded from this support forum and see the same message from logtab. What should I do?
randomwalker is offline  
Reply With Quote
Old 06-07-2010, 06:42 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

You would need to print out associated values to debug where the issues stems from in your code at this time, I believe you would see this for example for an 'irregular' session day as last Monday (Memorial Day in the US) for example.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 04-26-2012, 06:59 AM   #5
Drummer
Junior Member
 
Join Date: Jan 2011
Posts: 19
Thanks: 0
Thanked 1 time in 1 post
Default

I have code that successfully draws horizontal lines to my indicator panel in "maximum" display mode (right click the verticle axis) but I do not see the lines in a data box. How do I get these horizontal lines to display in a data box?
Drummer is offline  
Reply With Quote
Old 04-26-2012, 07:02 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

That would unfortunately not be possible, only plots could be displayed in the data box.

More control over the databox contents is on our feedback list for the next major NT version update, I've added your request in.

Thanks,
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
Replace databox and show price at mouse cursor? grose General Programming 1 02-25-2010 09:50 AM
Plot name in DataBox is not updated cls71 Version 7 Beta General Questions & Bug Reports 1 12-16-2009 02:21 AM
Last indicator value does not show in databox when +1 displaced Wessel Version 7 Beta General Questions & Bug Reports 3 12-15-2009 11:21 AM
horizotal line show value starfill Charting 7 09-17-2009 04:35 AM
Databox vs plot on chart zeller4 Indicator Development 2 11-29-2008 08:00 PM


All times are GMT -6. The time now is 01:28 AM.