Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            26 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, Yesterday, 09:53 PM
            2 responses
            49 views
            0 likes
            Last Post wzgy0920  
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            191 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,232 views
            0 likes
            Last Post xiinteractive  
            Working...
            X