PDA

View Full Version : column shows wrong value


ct
12-22-2009, 06:14 AM
I have an indicator with only one plot. It is not a plot but used to pass values to the market analyzer so I can display things in a certain color using color conditions. It is always set to a literal value. It is set to Exceed.Set(0) in the first statement of OnBarUpdate();

Why does the market analyzer show this column as the last price when I never set it to a price value but a literal hard coded value of 1 to 12?

I have Analyzer lookback set to 501, (the indicator is set to 500).

Cliff

NinjaTrader_Josh
12-22-2009, 07:12 AM
Cliff,

When you don't set a value it takes on a default value as a place holder and that value is Close[0].

ct
12-22-2009, 07:16 AM
Josh
Thanks for the reply and info. Shouldn't this code take care of it? Exceed being the plot. I am using Jurik's as well just in case there is an issue there.

protected override void OnBarUpdate()
{
Exceed.Set(0);
.
.
.
.

Cliff

ct
12-22-2009, 07:20 AM
Thinking about it. Does it need to be set to a value pointer and not a literal?

ct
12-22-2009, 07:23 AM
Nope tried it. Didn't help.

private int Zero = 0;
Exceed.Set(Zero);

Cliff

NinjaTrader_Austin
12-22-2009, 08:36 AM
ct, if a plot isn't set every single bar, NinjaTrader will substitute in the close price instead of just leaving the value at 0. Would you mind posting the code for us to look at to see if anything else looks amiss?

ct
12-22-2009, 08:40 AM
Austin

can I email it?

Cliff

NinjaTrader_Austin
12-22-2009, 08:51 AM
Cliff, you sure can email it. support@ninjatrader.com attention 'austin - thread 23989'. Thank you.

ct
12-22-2009, 11:16 AM
Austin

Is a value of zero considered "not set"? I do set it to a value but zero.

Cliff

NinjaTrader_Austin
12-22-2009, 11:23 AM
Cliff, I just whipped up a script to test whether or not 0 is "set", and my findings are that the plots can indeed be set to 0.

Are you sure that your script assigns a value to the plot for every single bar? If not, NT will just fill in the close price.

ct
12-22-2009, 11:30 AM
It is the first statement of th OnBarUpdate() section,. It is not conditioned so I would think it gets executed.

Cliff

NinjaTrader_Austin
12-22-2009, 11:47 AM
Cliff, that sure is how it looks. I'd love to test this out and see for myself but I don't have the Jurik indicator set. Is there any way you could strip it down some without the Jurik stuff while retaining the same behavior?