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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 10-09-2008, 09:02 AM   #1
mazachan
Senior Member
 
Join Date: Jun 2007
Posts: 112
Thanks: 0
Thanked 0 times in 0 posts
Default Dynamic Multiple Time Frames?

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.
mazachan is offline  
Reply With Quote
 

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


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