![]() |
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
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2007
Location: , ,
Posts: 250
Thanks: 1
Thanked 2 times in 1 post
|
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 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Can you strip down your indicator and provide a simple as possible (!) sample which demonstrates your observation? Thanks
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2007
Location: , ,
Posts: 250
Thanks: 1
Thanked 2 times in 1 post
|
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... |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Certified NinjaScript Consultant
|
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?
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Certified NinjaScript Consultant
|
How would I set a DataSeries to infinate? I don't see anything about this in the help file DataSeries Class page. Thanks!
|
|
|
|
|
|
#8 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Please try e.g.
Code:
new DataSeries(this, MaximumBarsLookBack.Infinite);
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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. |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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? |
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
Thanks for your efforts Harry, got it to reproduce here - we're checking into.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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. |
|
|
|
|
|
#15 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
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?
Bertrand
NinjaTrader Customer Service |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
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 |