![]() |
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 |
|
Senior Member
Join Date: Jun 2007
Posts: 112
Thanks: 0
Thanked 0 times in 0 posts
|
Hi, I'm trying to create a multiple time frame dynamically. Essentially what I want to do is, depending on the current time frame of the chart, I would like to create a second time frame say 5 times the current one which is a 3 minute chart.
In the initialize method, I have Add(BarsPeriod.Id, 5 * BarsPeriod.Value); I have also tried to pull out that multiplication and have it done prior to passing it into the Add function, but when I print out in BarsInProgress == 1, I call the function Print(BarsArray[1].Period) and it shows up as 5. Is it possible to dynamically change the value for Add or do I have to pass in a constant? Any help appreciated. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Unfortunately you cannot access BarsPeriod from within the Initialize() method. This means you will not be able to dynamically load bar objects.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Nov 2008
Location: Australia
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
Could a request to include some sort of method to get the time frame be included on the "to do" list? This is really a very basic need , considering that NT offers support for multiple time frames. Similar need appears to be obvious for querying an instrument on the chart. Without it is really impossible to write a strategy (or an indicator) that would be flexible enough to be considered universally usefull. Most of us are (or are trying to be) traders, not programmers, so less time we spend on code development the better... Your assistance will be trully appreciated. Roman |
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Thanks for your suggestion. We'll add it to the list of future considerations.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple charts with different times frames. | rmmsmh | Charting | 10 | 04-12-2009 11:49 PM |
| Multiple time frames | Oli | Charting | 4 | 06-26-2008 02:11 AM |
| Using multiple time frames from days into minutes | Sidhartha | General Programming | 2 | 04-12-2008 04:34 AM |
| time frames | knightrider123 | Market Analyzer | 2 | 07-11-2007 01:09 AM |
| Dynamic base pointer or time reference for secondary time interval | ct | Strategy Development | 11 | 06-20-2007 02:27 PM |