PDA

View Full Version : Getting a value to who in DataBox


funk101
04-14-2007, 04:47 AM
How do I do this? I have a function in my strategy that does a calculation, and I would like for it to show up in the DataBox. Do I have to create an indicator in order for this to happen? It's just a function. Point me in the right direction please.

NinjaTrader_Dierk
04-14-2007, 05:23 AM
The databox shows values on indicators series. So, yes you have to create an indicator, stuff your value into a data/plot series which then will be displayed in the data box.

funk101
04-14-2007, 07:31 AM
Ok, this is my code generated from wizard. On my onBarUpdate() I have these lines of code:

double d = 0;

d = (((CCI(6)[0] - CCI(14)[0]) / (CCI(6)[1] - CCI(14)[1]))) * 100;

Value.Set(d);

Basically, just calculating percentage. I would like the value of "d" to show up in the DataBox. Right now, it's not working.

NinjaTrader_Ray
04-14-2007, 09:13 AM
Did you add a plot in Initialize()?

funk101
04-14-2007, 10:14 AM
Ok, it's because I'm trying to access the data one bar ago for this calculation. The logs say "index out of bounds". Check the code below. So, what does that mean for me? There's plenty of bars on the chart. Does that mean that the indicator does not have access to those? Don't understand.

NinjaTrader_Ray
04-14-2007, 11:12 AM
See this post.

http://ninjatrader.mywowbb.com/forum14/1911.html