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 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-09-2009, 08:33 PM   #1
Kmdom3
Junior Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default Add ( ) with range bars

Good Evening everyone,

Here's my issue,
I'm attempting to add multiple time frames to my strategy, using the Add() method. I want to add multiple range bar time frames.
I'm typing Add (PeriodType.Range, 15);
I then get an error message stating NinjaTrader.Data.PeriodType does not contain a definition for 'range.' Error type CS0117

I checked the error code but didn't find much help when it came to range bars.

Any help would be greatly appreciated.
Kmdom3 is offline  
Reply With Quote
Old 05-09-2009, 08:50 PM   #2
roonius
Certified NinjaScript Consultant
 
Join Date: Oct 2008
Location: Chicago, IL
Posts: 523
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to roonius
Default

Quote:
Originally Posted by Kmdom3 View Post
Good Evening everyone,

Here's my issue,
I'm attempting to add multiple time frames to my strategy, using the Add() method. I want to add multiple range bar time frames.
I'm typing Add (PeriodType.Range, 15);
I then get an error message stating NinjaTrader.Data.PeriodType does not contain a definition for 'range.' Error type CS0117

I checked the error code but didn't find much help when it came to range bars.

Any help would be greatly appreciated.
Are you sure you are adding PeriodType.Range and not PeriodType.range?
C# is case sensitive.
roonius is offline  
Reply With Quote
Old 05-09-2009, 09:28 PM   #3
Kmdom3
Junior Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by roonius View Post
Are you sure you are adding PeriodType.Range and not PeriodType.range?
C# is case sensitive.
I actually tried both, realizing that C# is case-sensitive, and neither worked.
Kmdom3 is offline  
Reply With Quote
Old 05-09-2009, 11:06 PM   #4
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Thanks: 0
Thanked 2 times in 2 posts
Default

If you do:

Add(PeriodType.Minute, 1);

does that work? What about tick? ie: Add(PeriodType.Tick, 233);

Let's establish you have those working, if it is just Range that is a problem, or if none of the above are working.

Also, what period type are you using to run the actual strategy on (if running on a chart, what time period, or if backtesting, what time period) ie minute, tick, range?

Mike
ctrlbrk is offline  
Reply With Quote
Old 05-10-2009, 08:08 AM   #5
RJay
Senior Member
 
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
Default

Kmdom3,

This worked for me.

Add(PeriodType.Range, 15);

When you type the following... Add(PeriodType.

you should see an intellisense pop-up with period type selection. Double click on Range. Finish the line of code and compile.

Good Luck,

RJay
RJay is offline  
Reply With Quote
Old 05-10-2009, 07:19 PM   #6
Kmdom3
Junior Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks, turns out it was simple as removing the space between Add(), I'm used to C++, where spaces didn't matter.
Sorry for wasting your time with that inane question, appreciate everybody's help.
Last edited by Kmdom3; 05-10-2009 at 07:25 PM. Reason: add a footnote
Kmdom3 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
Range bars TrendLineBreak Charting 2 07-20-2008 10:51 PM
range bars Creamers Charting 1 07-17-2008 02:53 PM
Range Bars Dobbes Charting 6 06-26-2008 03:30 PM
Range Bars? goforbroke Charting 2 02-06-2008 04:40 PM
Momentum bars or Price Range Bars Akros Indicator Development 7 06-10-2007 04:55 AM


All times are GMT -6. The time now is 05:14 PM.