Go Back   NinjaTrader Support Forum > Application Technical Support > Charting

Charting Support for NinjaTrader Advanced Charting.

Reply
 
Thread Tools Display Modes
Old 01-09-2013, 11:44 AM   #1
arbuthnot
Senior Member
 
Join Date: Feb 2012
Location: UK
Posts: 402
Thanks: 170
Thanked 49 times in 44 posts
Default My indicators sometimes disappearing

Hi guys

I've had some strange things happening today!

I've had situations where one of my indicators appears on one chart but not another.

Then, on a minute-based chart, I initially loaded two of my own indicators, call them, A and B. That worked. Then I changed the chart to range bars (which I frequently do without problem), and A remained there but B disappeared. then, on the same chart, B would work but A wouldn't. (A and B are similar but not identical.)

I uninstalled then reinstalled NT but the problem is as it was before.

In 'Log', there are messages in yellow like:

Quote:
Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
But there are errors for indicators that have since worked and I haven't tweaked in any way before they appeared or reappeared.

Any advice on this would be greatly appreciated.
arbuthnot is offline  
Reply With Quote
Old 01-09-2013, 11:51 AM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 5,757
Thanks: 190
Thanked 784 times in 750 posts
Default

Hello,

Were these indicators you developed, or were they developed by a 3rd party?

If you increase the "days to load" on the charts where they are not working, can you get them to calculate?

If these were developed by you, can you clarify if they are multi-series scripts?
NinjaTrader_Matthew is online now  
Reply With Quote
Old 01-09-2013, 12:03 PM   #3
arbuthnot
Senior Member
 
Join Date: Feb 2012
Location: UK
Posts: 402
Thanks: 170
Thanked 49 times in 44 posts
Default

Thanks very much for getting back to me so promptly, Matthew.

1) These are indicators I've developed myself, which I've had for a few weeks and never experienced this before.

2) There were certainly enough days on the chart, as I usually load a minimum of 50. I usually use range bars, such as 15R in EUR/USD cash. On both the these indicators I have:

Code:
private int period = 50;

...

if(CurrentBar < Period)
            
            {return;}
and there are many, many more than 50 bars on the chart.

3) No, these are not multi-series scripts.

I look forward to hearing from you again.
arbuthnot is offline  
Reply With Quote
Old 01-09-2013, 12:44 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 5,757
Thanks: 190
Thanked 784 times in 750 posts
Default

I'd suggest adding Try-Catch blocks to your script and replicating the error. This should help you isolate to the exact block of code that is causing the error. If you're unsure what that segment is causing it, please let us know and we'd be happy to help you figure that out.

Please see the following reference sample on how to use these debugging resource:

http://www.ninjatrader.com/support/f...ead.php?t=9825
NinjaTrader_Matthew is online now  
Reply With Quote
Old 01-11-2013, 05:03 AM   #5
arbuthnot
Senior Member
 
Join Date: Feb 2012
Location: UK
Posts: 402
Thanks: 170
Thanked 49 times in 44 posts
Default

Thanks again, Matthew. This is my first opportunity to get back to you on this. It's extremely helpful to know about Try-Catch blocks.

May I just recap what the situation was and is still (pls see the error messages mentioned in my first post.):

I have several indicators which have all compiled and worked perfectly until very recently. The coding was not changed in any way before the problem started.

What happens is sometimes they appear and sometimes they don't! My point is this: if they are capable of appearing on charts at any time, it must surely mean that they have been coded correctly and there can't be issues such as: not enough bars, etc.

What I didn't mention before is that they all have something in common: they all use the MRO method (for the less experienced: this is the Most Recent Occurrence Method [very useful], the coding of which must involve loops.)

I think my NT installation must be defective in some way. I did do an uninstall/reinstall since the problem started, but it changed nothing as far as this issue started.

When you do an uninstall/reinstall, all the charts come up as before, which means that all the data must be kept on the hard disk somewhere. Is there a way of doing a complete reinstall (after doing a backup, obviously) so that Windows completely 'forgets' the previous installation?

You see, I don't think there can be a problem with the coding of these indicators (that I've developed myself), as I've said, otherwise these indicators would never show. Or am I wrong?

Or would there be another way of addressing this problem?

Any suggestions will be greatly appreciated!
arbuthnot is offline  
Reply With Quote
Old 01-11-2013, 07:11 AM   #6
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 5,757
Thanks: 190
Thanked 784 times in 750 posts
Default

I personally do not feel that a reinstall is going to have any effect here. I understand your indicators worked for a few weeks, but there is a scenario you are facing now that has caused this and it sounds like it only happens with your indicators. I don't have enough information about your indicators to give you any very specific advice, but you should be able to isolate through the debug process, which is a natural step of any development process. I just don't see what would break in NinjaTrader where this specific issue would crop out just for you and your indicators out of nowhere.

With that said, you're completely free to try a complete wipe of NinjaTrader and test again.

Please follow the steps listed below to completely uninstall and reinstall NinjaTrader:

Close all running applications.

Then from the Start menu select --> Control Panel --> Add and Remove Programs.

From Add and Remove Programs select NinjaTrader 7 and click Remove.

Then manually delete the folder "NinjaTrader 7" located under Start --> My Documents.

Delete any NinjaTrader installation files. This can be done by going to Start --> My Computer --> Search button --> search for (NinjaTrader*) --> select Local C Disk and then press search.

Then you will need to clear your internet browser cache and history. You will clear this from within your internet browser (with IE, Tools-->Options, delete cookies and files, clear history).

Reboot your machine.

Once these steps are completed, download NT7 from the link below:
http://www.ninjatrader.com/download-registration

Please let us know if you are able to get up and running after the reinstall.
NinjaTrader_Matthew is online now  
Reply With Quote
Old 01-11-2013, 07:55 AM   #7
koganam
Senior Member
 
Join Date: Feb 2008
Location: http://omegasigmaindicators.com
Posts: 4,882
Thanks: 31
Thanked 2,033 times in 1,663 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by arbuthnot View Post
Thanks again, Matthew. This is my first opportunity to get back to you on this. It's extremely helpful to know about Try-Catch blocks.

May I just recap what the situation was and is still (pls see the error messages mentioned in my first post.):

I have several indicators which have all compiled and worked perfectly until very recently. The coding was not changed in any way before the problem started.

What happens is sometimes they appear and sometimes they don't! My point is this: if they are capable of appearing on charts at any time, it must surely mean that they have been coded correctly and there can't be issues such as: not enough bars, etc.

What I didn't mention before is that they all have something in common: they all use the MRO method (for the less experienced: this is the Most Recent Occurrence Method [very useful], the coding of which must involve loops.)

I think my NT installation must be defective in some way. I did do an uninstall/reinstall since the problem started, but it changed nothing as far as this issue started.

When you do an uninstall/reinstall, all the charts come up as before, which means that all the data must be kept on the hard disk somewhere. Is there a way of doing a complete reinstall (after doing a backup, obviously) so that Windows completely 'forgets' the previous installation?

You see, I don't think there can be a problem with the coding of these indicators (that I've developed myself), as I've said, otherwise these indicators would never show. Or am I wrong?

Or would there be another way of addressing this problem?

Any suggestions will be greatly appreciated!
Have you checked your log for any error records? It sounds as if your indicator is blowing up from some calculation exception, which is why it only fails sometimes, not always. The most usual culprit seems to often be an untrapped division by zero.
koganam is offline  
Reply With Quote
Old 01-13-2013, 07:20 AM   #8
arbuthnot
Senior Member
 
Join Date: Feb 2012
Location: UK
Posts: 402
Thanks: 170
Thanked 49 times in 44 posts
Default

Thanks as always, Matthew, for the superb information.

Just as it's a good idea, every couple of years, to reinstall Windows (the best way of getting rid of all that 'junk'!), I'm wondering whether a complete reinstall of NT might not be a bad idea every year or so provided of course you're 100% backed up, especially if there do appear to be some glitches. (These are just my own thoughts.)

As and when I do this, I'll certainly report back to this thread.
arbuthnot is offline  
Reply With Quote
Old 01-13-2013, 07:33 AM   #9
arbuthnot
Senior Member
 
Join Date: Feb 2012
Location: UK
Posts: 402
Thanks: 170
Thanked 49 times in 44 posts
Default

Thanks very much, koganam, you may well have put your finger on it.

There could just be a glitch (though Matthew doubts this) in which case I should do a complete reinstall (see my previous post) or the indicator is indeed 'blowing up' (a great way of putting it) as you suggest.

This is the type of error message I was getting:

Quote:
Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
As I've said, all three of these indicators use the MRO method, which may be a hint. I think the 'bar 50' could be at the exact point where the calculations start (after the CurrentBar...return). I'll definitely look into this.

Another approach, given they have all worked properly previously - and sometimes now - could be to copy the code to a totally fresh indicator (not one simply 'saved as') and then delete the original. This might be the answer...

Much obliged as ever.
arbuthnot is offline  
Reply With Quote
Old 01-13-2013, 03:58 PM   #10
koganam
Senior Member
 
Join Date: Feb 2008
Location: http://omegasigmaindicators.com
Posts: 4,882
Thanks: 31
Thanked 2,033 times in 1,663 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by arbuthnot View Post
Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
Well nigh almost always a "division by zero" error.
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
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
Indicators disappearing in Market Replay arbuthnot Charting 3 09-05-2012 11:50 AM
Disappearing lines cube101 Charting 18 11-05-2010 03:07 PM
disappearing workspace Jay_NL Miscellaneous Support 11 12-29-2009 02:25 PM
NT just disappearing! eDanny Miscellaneous Support 9 02-20-2009 01:59 PM
Indicators disappearing dtf139 Historical NinjaTrader 6.5 Beta Threads 10 01-10-2008 03:32 PM


All times are GMT -6. The time now is 08:24 AM.

FULL RISK DISCLOSURE: Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.