NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-09-2008, 01:31 PM   #1
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default dataseries integer values?

Hi,

I'm using the following code to store values into dataseries classes, the values being stored are "CurrentBar" numbers, thus they are integers. This seems to cause a problem (errors) with my code because the dataseries values should be "double" values (??)...can I get a clarification?...is it possible to setup "integer dataseries"??

private DataSeries HI_StoK;
HI_StoK = new DataSeries(this);
...
if((VarStoch(3, 5, 3, 3).VarStoK[1] < 97) && (VarStoch(3, 5, 3, 3).VarStoK[0] >= 97))
{NEW_HIGH = CurrentBar; HI_StoK.Set(NEW_HIGH);} //set "last high" (bars)
...
if(HI_StoK[AI_index] < NEW_RISE){LO_CONSTRAINT = HI_StoK[AI_index];}
Burga1 is offline  
Reply With Quote
Old 04-09-2008, 01:35 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Sure, please see this reference for IntSeries class.

http://www.ninjatrader-support.com/H...riesClass.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-09-2008, 01:51 PM   #3
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you, that helped.
Burga1 is offline  
Reply With Quote
Old 04-09-2008, 02:09 PM   #4
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Sorry, I have a follow-up question. It seems that my .Set commands are not properly being populated with the correct information (CurrentBar #)...my code is as follows, it seems the dataseries .Sets are all "0" instead of the CurrentBar number? Anybody got an idea as to why?

private IntSeries LO_StoK;
LO_StoK = new IntSeries(this);
...
if((VarStoch(3, 5, 3, 3).VarStoK[1] > 3) && (VarStoch(3, 5, 3, 3).VarStoK[0] <= 3))
{NEW_LOW = CurrentBar; LO_StoK.Set(NEW_LOW);}
//set "last low" (bars)

BTW: the integer value for "NEW_LOW" seems to store the correct value, however it is not updating to the LO_StoK dataseries...
Burga1 is offline  
Reply With Quote
Old 04-09-2008, 08:16 PM   #5
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Any errors in the Control Center logs?
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-09-2008, 08:53 PM   #6
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

No, however I believe I got this straightened out, thanks for the reply...
Burga1 is offline  
Reply With Quote
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
Checking for Empty dataseries values richa61416 Strategy Development 2 03-19-2008 07:12 AM
Rounding off to an integer? Burga1 General Programming 1 01-02-2008 10:20 PM
Reset values in a DataSeries Rollins Indicator Development 2 12-09-2007 01:05 AM
Getting Historical Values Using DataSeries.. nmussa General Programming 4 10-03-2007 07:47 AM
error combining ema with an integer Thomas Strategy Development 3 08-16-2007 05:40 AM


All times are GMT -6. The time now is 09:19 PM.