NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 10-21-2009, 04:54 PM   #1
rt-trader
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 250
Thanks: 1
Thanked 2 times in 1 post
Default Maximum Bars Lookback

I am using a Plot override to draw graphics. The logic works fine in NT 6.5 and works in NT 7 back 256 bars after which the indexing seems to get lost and values retrieved from OBU are incorrect. The value are correct in OBU and plot correctly from there.

I have set the Max bars lookback parameter to infinite but the issue doesnt change.

This could be a scripting error on my part. However, it seesm strange that the problem occurs after 256 bars - perhaps there is an issue with Maximum bars lookback within graphics?

Also - is there on overide setting for Max bars that can be included in Initialize?

Thanks
rt-trader is offline  
Old 10-21-2009, 10:39 PM   #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
Default

Can you strip down your indicator and provide a simple as possible (!) sample which demonstrates your observation? Thanks
NinjaTrader_Dierk is offline  
Old 10-22-2009, 12:35 AM   #3
rt-trader
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 250
Thanks: 1
Thanked 2 times in 1 post
Default

Dierk,

I emailed the indicator and a screen shot to you @ support a couple of hours back.

Let me know if you need more info...
rt-trader is offline  
Old 10-22-2009, 01:34 AM   #4
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

Would you mind sending it right to me again (in case you're online). "dierk AT ninjatrader DOT com". Our support team might be offline for a couple of more hours.
NinjaTrader_Dierk is offline  
Old 12-05-2009, 02:00 AM   #5
lawyse
Certified NinjaScript Consultant
 
lawyse's Avatar
 
Join Date: Aug 2008
Location: Atlanta, GA
Posts: 84
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to lawyse
Default Also having this problem

I have 2136 bars on my chart and the indicator looks for identical numbers in a DataSeries, referencing each bar back using a for loop. Even though I set the indicator to infinate, it still gives the error about 256 bars . Quick fix here?
lawyse is offline  
Old 12-05-2009, 04:21 AM   #6
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

Not sure what you mean by "quick fix". I suggest inspecting your code if you're using custom data series and setting them to "infinite" as well.
NinjaTrader_Dierk is offline  
Old 12-05-2009, 09:31 AM   #7
lawyse
Certified NinjaScript Consultant
 
lawyse's Avatar
 
Join Date: Aug 2008
Location: Atlanta, GA
Posts: 84
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to lawyse
Default

How would I set a DataSeries to infinate? I don't see anything about this in the help file DataSeries Class page. Thanks!
lawyse is offline  
Old 12-06-2009, 04:38 AM   #8
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

Please try e.g.
Code:
new DataSeries(this, MaximumBarsLookBack.Infinite);
Thanks
NinjaTrader_Dierk is offline  
Old 03-30-2010, 08:38 AM   #9
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 80 times in 66 posts
Default Out of Index Exception caused by MaximumBarsLookback.Infinite

Have coded an indicator that uses several DateTimeSeries[] arrays (6x6). It works fine on NT 6.5. but shows a strange behavior on NT 7.0.0.12 The DateTimeSeries[] objects are used to assign a Date to each bar which is printed via a customized plot.

(1) Observed as expected: If Maximum bars look back is set to "Twohundredfiftysix", the DateTimeSeries[] only stores correct values for the last 256 bars. If I go further back, false dates are displayed.

(2a) Observed as expected: If I set Maximum bars look back to infinite, I can horizontally scroll the chart back and the dates displayed are correct.
(2b) Alternatively I can set DataSeries(this, MaximumBarsLookBack.Infinite) via indicator code.

Everything works fine (adding indicator or refreshing via F5), if I add the indicator, when the chart is right-aligned to the last bar - as per default when the chart is opened.

Not expected

However, if I add the indicator, after having horizontally scrolled back the chart a few days, I get a plot error with an out-of-index exception. This exception is not triggered with NT 6.5, and it is not triggered with NT7, as long as Maximum bars lookback is not set to "Inifnite". So it must be caused by the custom plot accessing the DateTimeSeries, while not pointing to one of the last bars.

What I do not understand so far....

-> Indicator can be added, when chart is in default position -> once added you can scroll back to the beginning of the chart and everything is ok.

-> Indicator can not be added in MaximumBarsLookback.Infinite mode, if chart is scrolled back a few days. Out-of-index exception is triggered.

Thanks for your help.
Harry is offline  
Old 03-30-2010, 08:52 AM   #10
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

Hi Harry, would you have a stripped down version exhibiting the 'not expected' issues you raised so I can check into and reproduce here?

Thanks in advance
NinjaTrader_Bertrand is offline  
Old 03-30-2010, 10:21 AM   #11
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 80 times in 66 posts
Default

Hi Bertrand,

thanks for your answer. I do not have a stripped down version of the indicator. More over I think that a stripped down version would not expose this behavior. I think that NT 7 limits the use of memory in a different way that NT 6.5 did. The same code works for NT 6.5

Below an indicator Test, which

-> ok in 256 bars mode
-> ok in infinite mode, if put on, when chart right-aligned
-> not working (out-of-index exception), if put on when chart in middle position

To check just open a 65 day, 30-minute chart, add indicator; set right chart margin to 100 under chart properties and set Maximum bars look back to "Infinite". Then scroll horizontally and refresh via F5. You will find that the indicator can be added or will cause an exception depending on the position of the scroll bar. Once added it will work to the left of the place where it was added, but not to the right.

Any ideas?
Attached Files
File Type: zip Test.zip (16.9 KB, 11 views)
Harry is offline  
Old 03-30-2010, 11:21 AM   #12
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

Thanks for your efforts Harry, got it to reproduce here - we're checking into.
NinjaTrader_Bertrand is offline  
Old 04-01-2010, 03:21 PM   #13
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Harry,

The message indicates you most likely ran into some issue with the way you are programming in the Plot method. This is an unsupported method. Unfortunately we are not able to debug the 5000 lines of code in the indicator. I suggest you strip it down to a single plot which you can reproduce the issue with. Maybe try using some try-catch blocks around to see which line breaks the logic. Error message means that you are accessing an index that simply does not exist in your code in the scenario you have described.
NinjaTrader_Josh is offline  
Old 04-02-2010, 03:23 AM   #14
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 80 times in 66 posts
Default

Thank you Josh for the answer,

I am sorry that I could not simplify the indicator to produce the error, there are some hints that it must be memory related....

(1) The out-of-index error only occurs, when I set the DateTimeSeries[] array to MaximumBarsLookBack. Infinite.
(2) In the region OnBarUpdate() the indicator writes DateTime values to the DateTimeSeries[] arrays.
(3) Plot retrieves these values and prints them.

The code works on NT 6.5. but causes an out-of-index error on NT 7. This error only occurs with MaximumBarsLookBack.Infinite. The error occurs more likely, if I use a smaller period (1 min) than if I use a larger period.

So the problem is likely not caused by the code but by MaximumBarsLookBack.Infinite. If I write a new code with a single DateTimeSeries, I might not activate the bug. I will think about writing an indicator that isolates the problem.
Harry is offline  
Old 04-02-2010, 05:18 AM   #15
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

Hi Harry, thanks for clarifying and adding those remarks, appreciated.

Do you see the same result if setting the lookback for the DateTimeSeries programmatically to be infinite?
NinjaTrader_Bertrand is offline  
 

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
Maximum bar size for minute bars. NickA Charting 4 08-07-2009 12:15 AM
NT not saving the lookback period on my charts properly? JS999 Charting 3 04-27-2009 04:47 AM
Maximum Volume Value innovation Miscellaneous Support 6 10-20-2008 06:51 AM
Lookback period? FireFly Charting 2 10-14-2008 02:22 PM
Highest High in a LookBack Period daven Indicator Development 2 09-28-2007 12:39 PM


All times are GMT -6. The time now is 09:38 AM.