Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ading Custom Bar Type Series

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

    Ading Custom Bar Type Series

    Hi,

    I have the following questions:

    1. I have a custom bar type which I would like to add to another chart via AddSeries. Is there a correct syntax for doing this?

    2. I have added the custom bar series and it seems to work, although I am not sure that the addition was done correctly. Nevertheless,

    a. Is the added secondary series limited to the same 'Days to load' as the primary series? I am assuming that the answer is yes, but please confirm. Is there a way to load a different number of days in the secondary series?

    b. Is the added secondary series limited to the same 'Break at EOD' setting as the primary series? I am assuming yes but again, please confirm. Is it possible to have a different Break at EOD setting for the secondary series?

    Essentially I am asking how to specify the settings for the secondary series to be added when that secondary series is a custom bar type. Thank you.

    #2
    Hello Zeos6,

    Thanks for opening the thread.

    The advised syntax to follow would be that listed in the help guide. For the instance of referencing a BarsPeriodType that is outside of the built in enum, you could cast the index of your BarType as BarsPeriodType to add it.

    Code:
    AddDataSeries("AAPL", new BarsPeriod { BarsPeriodType = (BarsPeriodType) 14, Value = 1 }, "US Equities RTH");
    For a programmatic way to identify the index that the Custom BarType has, I suggest to look at NinjaTrader_Jesse's script for identifying Custom BarTypes.

    AddDataSeries() will load enough bars to satisfy the entered Days to load unless you use the overload to specify your own desired number of bars to load.

    Break At EOD is also referred to by IsResetOnNewTradingDay. There are overloads to set this as well. The default is false.

    AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm

    NinjaTrader_Jesse's BarType identifier: https://ninjatrader.com/support/foru...tid=-1&lpage=1

    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim. Appreciate this.

      As an aside, I came across the following, to be used in the State.Defaults:

      Code:
      BarsPeriod = new BarsPeriod() { BarsPeriodType = (BarsPeriodType)144, BarsPeriodTypeName = "MyCustomBar" };
      Is this valid? If yes, how would this be used with the AddSeries?

      Comment


        #4
        Hello Zeos6,

        The syntax for creating a BarsPeriod object is documented in the help guide. Please reference the documentation to lookup syntax.

        I have also provided an example in my previous post. Note that the index used (14) is casted to a BarsPeriodType when the BarsPeriod is created. Your syntax implies that you are using your platform's 144th BarType and you are not setting a Value for the BarsPeriod.

        Please see NinjaTrader_Jesse's indicator if you would like further direction on finding the index of the BarType you would like to add.

        BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks for the reply Jim. It doesn't answer the question in the slightest. The reason I asked was that that statement seems to be the only way to reference the custom bar type by its name and I wondered whether that could be done.

          Comment


            #6
            We don't have any documentation for using BarsPeriodTypeName so I would suggest to cast the index of the BarType you want to use.

            Jesse's indicator shows how you can loop through BarTypes and find the index of your BarTypes. You can also modify the code to look for specific index by name. The indexes of Custom BarTypes can vary per platform, so this would make a good universal approach for finding an index of a desired BarType rather than assuming it owns a certain index.

            If this detail does not answer your question, please let me know.
            JimNinjaTrader Customer Service

            Comment


              #7
              Thanks Jim. Will check it out.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              32 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              4 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              19 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              6 views
              0 likes
              Last Post cre8able  
              Started by Haiasi, Today, 06:53 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X