NinjaTrader Support Forum  

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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 02-10-2007, 05:20 AM   #1
lewdfinger
Junior Member
 
Join Date: Jan 2007
Location: Calgary, Canada
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Code:
double channelLow = MIN(Low, Bob);

double channelHigh = MAX(High, Bob);
Bob is an integer input for bars back. When I compile I get the message: Cannot implicitly convert type 'NinjaTrader.indicator.MAX' to 'double' and Cannot implicitly convert type 'NinjaTrader.indicator.MIN' to 'double'

Am I doing something wrong?

KD
lewdfinger is offline  
Reply With Quote
Old 02-10-2007, 06:10 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Post imported post

Yes. MIN/MAX are indicators. To access value at most current bar try

double channelLow = MIN(Low, Bob)[0];
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-10-2007, 07:13 AM   #3
lewdfinger
Junior Member
 
Join Date: Jan 2007
Location: Calgary, Canada
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Thanks Man! I thought that [0] was implicit, but adding it fixed the problem.
lewdfinger 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


All times are GMT -6. The time now is 02:29 AM.