Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add and BarsPeriod

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • koganam
    replied
    Originally posted by bfis108137 View Post
    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.
    Then, no harm, no foul. the literature, distinctly says that if you add a time frame that already exists, it will essentially just be ignored anyway. As it says:

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

    Leave a comment:


  • bfis108137
    replied
    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.

    Leave a comment:


  • koganam
    replied
    Originally posted by bfis108137 View Post
    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.
    Assuming that this could be done, what action did you intend to take if the time frames did clash? If you were going to issue a warning and bypass processing, then just do the same in OnStartUp() instead, or even in OBU when (CurrentBar == 0).

    Leave a comment:


  • bfis108137
    replied
    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.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    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.

    Leave a comment:


  • bfis108137
    replied
    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?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    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.

    Leave a comment:


  • bfis108137
    started a topic Add and BarsPeriod

    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?

Latest Posts

Collapse

Topics Statistics Last Post
Started by martyn73, 09-06-2019, 01:27 PM
6 responses
310 views
0 likes
Last Post bltdavid  
Started by xfactscout, Today, 02:26 PM
2 responses
9 views
0 likes
Last Post xfactscout  
Started by T_man, 02-26-2025, 11:51 AM
2 responses
46 views
0 likes
Last Post Fertryd2  
Started by SheriDi, Today, 02:24 PM
1 response
19 views
0 likes
Last Post SheriDi
by SheriDi
 
Started by sofortune, Today, 02:41 PM
1 response
4 views
0 likes
Last Post NinjaTrader_Clayton  
Working...
X