• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 seagraph, Today, 03:27 PM
            0 responses
            11 views
            0 likes
            Last Post seagraph  
            Started by dedouglas, Today, 02:54 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by elkhatabi, 08-01-2019, 06:36 PM
            5 responses
            52 views
            0 likes
            Last Post NinjaTrader_RyanL  
            Started by mr_trade, Today, 01:01 PM
            4 responses
            19 views
            0 likes
            Last Post mr_trade  
            Started by Renorail, Today, 12:31 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Working...
            X