![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Mar 2010
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
|
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]); |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2010
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
|
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?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2011
Posts: 19
Thanks: 0
Thanked 1 time in 1 post
|
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?
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
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,
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |