Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add and BarsPeriod
Collapse
X
-
Add and BarsPeriod
I want to make a strategy where the user will have the ability to set a time frame but I want to make sure that the time frame that they have chosen is not the chart time frame. In the documentation, it says that the BarsPeriod method should not be accessed from the initialize method but that the add method should. Essentially I need to check the chart time frame before running the Add method. How can I do this?Tags: None
-
Welcome to our forums here - programmatically this would not be possible, your understanding is correct. One way would be monitoring for the time frame chosen and then raising a runtime error that would not let the user proceed if the chart timeframe is chosen, or you would manage this process via user inputs from the UI.BertrandNinjaTrader Customer Service
-
Well I think this information should be accessible for a few reasons.
1.)It is true that nt is still building the bars array but the base timeframe is known immediately and never changes.
2.)The user has already selected this in his paramaters so that should be accessible.
3.)It doesn't seem logical that I can't know what the current time frame is at the time that I need to define all of my time frames.
Also is there a problem in having duplicate time frames? Could I define the chart time frame as an additional time frame?
Comment
-
Thanks for the feedback in this regard, this is noted on our feedback / enhancement tracking lists, however currently dynamic adding of series would not be supported unfortunately. You can internally add the series in again, however for realtime order submission the primary series should be used.BertrandNinjaTrader Customer Service
Comment
-
My suggestion isn't necessarily to add time series dynamically (although this would be nice) but to have access to the chart timeframe at the time the timeseries is added. This would mean having access the chart time frame in the initialize method OR dynamically adding timeseries. Both would provide the needed result.
Comment
-
Originally posted by bfis108137 View PostMy suggestion isn't necessarily to add time series dynamically (although this would be nice) but to have access to the chart timeframe at the time the timeseries is added. This would mean having access the chart time frame in the initialize method OR dynamically adding timeseries. Both would provide the needed result.
Comment
-
Essentially I would do nothing. If the user chose the timeframe of the chart then I would just not add that timeframe. Also I want access to the 1 minute bars for strategies that would work on ticks. I tried ticks and it's too slow. Anyways if the user chose 1 minute as the chart time frame then I would also know to not add that tf.
Comment
-
Originally posted by bfis108137 View PostEssentially I would do nothing. If the user chose the timeframe of the chart then I would just not add that timeframe. Also I want access to the 1 minute bars for strategies that would work on ticks. I tried ticks and it's too slow. Anyways if the user chose 1 minute as the chart time frame then I would also know to not add that tf.
"2. If a multi-series script adds an additional Bars object that already exists on the chart, the script will use the preexisting series instead of creating a new one to conserve memory. This includes that series' session template as applied from the chart."
in the "Notes" section of the fourth folded section on this page of the NT Help: http://www.ninjatrader.com/support/h...nstruments.htm
My suggestion would be to provide the user some notice, so that they can correct this if they desire, and just ignore it if that is their intent.Last edited by koganam; 01-02-2014, 01:26 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fersanmito, Today, 03:45 AM
|
0 responses
8 views
0 likes
|
Last Post
![]()
by fersanmito
Today, 03:45 AM
|
||
Started by several, 03-18-2025, 03:53 AM
|
12 responses
189 views
1 like
|
Last Post
![]()
by ntwong
Today, 01:46 AM
|
||
Started by kevinenergy, 11-28-2023, 11:04 AM
|
3 responses
77 views
0 likes
|
Last Post
|
||
Started by SilverSurfer1, 01-31-2025, 10:02 PM
|
5 responses
77 views
0 likes
|
Last Post
![]()
by Lee63
Today, 01:11 AM
|
||
Started by DayTradingDEMON, 03-21-2025, 02:10 PM
|
7 responses
42 views
0 likes
|
Last Post
![]() |
Comment