Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

defining special bar types in code

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

    defining special bar types in code

    I have a bar type called:
    RJay renkoSpectrum 2.0 PSSC

    and i would like to use it in my code as the same as this other code.

    if (BarsPeriod.Id == PeriodType.Minute) {Hvn_Line = 2;}
    if (BarsPeriod.Id == PeriodType.Tick) {Hvn_Line = 2;}
    if (BarsPeriod.Id == PeriodType.RJay renkoSpectrum 2.0 PSSC) {Hvn_Line =10;}

    I've tryed several ways but keep getting an error.
    Ninjatrader .data.periodtype Does not contain a definition for RJay renkoSpectrum 2.0 PSSC

    Any help would be appreciated

    #2
    Hello,

    You will need to refer to the base PeriodType. This will be something like Custom0 or Final1, etc.

    You can find this by going to (My) Documents\NinjaTrader 7\bin\Custom\Type and open the .cs file for the bar type you're using.

    In there you should find something such as:

    Code:
    		public .RJayRenkoSpectrum() : base(PeriodType.Custom2)
    		{
    		}
    This is just pesudeo code and your bar type may be different, however you should be able to locate the PeriodType used for this bar type which would be similar to the above.

    Once you know the base period type you can explicitly refer to it in your code by using:

    Code:
    PeriodType.Custom2)
    MatthewNinjaTrader Product Management

    Comment


      #3
      Of corse its not listed in custom/bin....

      I only have the .dll in bin/custom

      It's something I bought and its not open source. Will I not be able to work with it then?

      Comment


        #4
        Hi,

        Yes, in that case you' might want to check with the developer to make sure.

        However you can always try to grab the bars period type by running the following on a chart with that bars type used:

        Code:
        Print(Bars.BarsType.DisplayName + "  " + Bars.BarsType.Period.Id.ToString());
        The Bars.BarsType.Period.Id should get you what you're looking for.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Ty, that found it


          odd...
          its Custom4
          but its not liking it at all, it compiles but makes other charts not work correctly, very odd
          Last edited by ghostpipper; 11-15-2013, 09:24 AM.

          Comment


            #6
            Originally posted by ghostpipper View Post
            Ty, that found it


            odd...
            its Custom4
            but its not liking it at all, it compiles but makes other charts not work correctly, very odd
            Hi ghostpipper,

            If you need assistance, contact me.

            RJay
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            569 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            548 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            548 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X