![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
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];} |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Sure, please see this reference for IntSeries class.
http://www.ninjatrader-support.com/H...riesClass.html
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you, that helped.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
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... |
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Any errors in the Control Center logs?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
No, however I believe I got this straightened out, thanks for the reply...
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |