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-24-2009, 01:22 PM   #1
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default DataSeries converting

I have a data series that contains the difference between two bar numbers.

private DataSeries scalpSeries;

I want to use High[scalpSeries[0]] to get the high of the bar back.

Compiler says cant convert double to integer ..
gg80108 is offline  
Reply With Quote
Old 04-24-2009, 02:09 PM   #2
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

What are you trying to do with High[]? High[] is a DataSeries containing the high price information of the bars. It is not a function you can pass another DataSeries into.

If you are trying to find the highest value in your DataSeries consider using MAX().
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-24-2009, 02:51 PM   #3
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

I want to find the High[x] x bars back.. My dataseries contains the "x" bars back number, like scalpSeries[1] might return 2, scalpSeries[2] might return 5 etc.
gg80108 is offline  
Reply With Quote
Old 04-24-2009, 02:58 PM   #4
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

Try casting it as an int.

High[(int) scalpSeries[0]]
NinjaTrader_Josh 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
How to copy DataSeries to another DataSeries xewoox General Programming 8 12-02-2008 07:53 AM
need help converting volatility indicator maestrom Indicator Development 1 10-29-2008 10:02 AM
Converting easy language chartlearner General Programming 11 09-23-2008 11:39 AM
problems converting a few lines Burga1 General Programming 4 12-04-2007 09:17 PM
Converting double to int JangoFolly General Programming 8 09-11-2007 02:01 PM


All times are GMT -6. The time now is 03:04 PM.