![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 | |
|
Certified NinjaScript Consultant
|
Quote:
C# is case sensitive. |
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Thanks: 0
Thanked 2 times in 2 posts
|
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 |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
|
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 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
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
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |