PDA

View Full Version : Intermittent Indicator Problem...


tazatek
03-27-2010, 06:24 AM
I've got a problem with a few indicators (not sure if it's indicator specific)

When I went to plot the CCI directly, I got only a single red line at 0

When I calculated the CCI and assigned to a double, and then plotted the double, all was fine.

I printed the values of Input, CCI(Input,10)[0] and ccivalue (a double)

What I found was that CCI(Inpute,10)[0] had a value of 0, while the computed double and Input values were what I'd expect.




Here's the code I was using:


double cciout = CCI(Input,10)[0];

// Always works
//Plot0.Set(cciout);

// Sometimes works
Plot0.Set(CCI(Input,10)[0]);

// always prints values
Print("cciout : " + cciout);
Print("Input[0] : " + Input[0]);

// Sometimes just prints 0 for entire history
Print("Input(CCI): " + CCI(Input,10)[0]);



I've had it happen with FastStochastics and CCI, though I suspect that Its not indicator specific.

It does seem to finally start producing values if I open another indicator and come back to it....

I don't see any error's in the log window. Is there an actual log file I can check into?

I can't reproduce it all the time, but I wanted to document for future reference, and see if anyone else has seen this.


Matt

NinjaTrader_Austin
03-27-2010, 03:50 PM
tazatek, could you please post the complete code here so we can test this out? And if you can reproduce it consistently please let us know how.

tazatek
03-27-2010, 07:26 PM
OK

I think I have a reproducible indicator here that shows the problem

In the indicator, if I have a variable and hand it into certain indicators (Stochastics in my example), then a zero value is returned.

However, if a literal number is handed in as parameters, it works just fine.

Another interesting thing is that even if the value is 0, the value of Values[0] has the right value, but isn't plotted.

I've commented the indicator, and there is a true/false loop so that you can easily see the indicator in action both working and not working.

Matt


PS - no errors in the logs noted.

tazatek
03-28-2010, 10:17 AM
More weird things that I think are related (but perhaps not)


1. My lines are holding state that they shouldn't. I've changed all my lines (ALL OF THEM) to have a value of transparent when they start up. But when I open the indicator (in a new chart, or even after NT restart)... all my old lines are showing up. Some of them are in logic loops that should never even get seen!!!

My thought is that the DB is somehow holding onto state, and not letting go when it should. I've reset/repaired the DB w/o success.

2. After I shutdown NT, waited for about 30 seconds for all processes to complete, and restarted, NT started, but with an added message that only one instance can be run. I've only had it happen once, so maybe I double tapped, but it could also be that NT isn't completely shutting down, or taking too long to shut down.

All this leads me to believe that mis-matched memory/object correlation is happening somewhere. I'm fully aware that it could be that I'm not conforming to newer NT 7 standards, but I'll need someone to point out what I'm doing wrong to help out.


I was thinking.... Is it possible that for the beta versions, we need to completely wipe out the old install before installing the new? Could there be incompatibilities from older versions to the newer?

Matt

NinjaTrader_Josh
03-29-2010, 09:06 AM
Please see my response in your other thread. The issue is with the Indicator = Stochastics() line.